package com.ozs.plan.doman;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ozs.common.annotation.Excel;
import com.ozs.system.domain.SysFileRef;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@TableName("plan_practical")
public class ProvisionalPlan {

    @ApiModelProperty(value = "主键ID")
    @TableField("plan_practical_id")
    @TableId(type = IdType.AUTO)
    private Long planPracticalId;

    @ApiModelProperty(value = "年度计划ID")
    @TableField("plan_year_id")
    private Long planYearId;

    @NotNull(message = "采购单位不能为空")
    @ApiModelProperty(value = "采购单位（登录账号的单位）")
    @TableField("purchase_dept_id")
    private String purchaseDeptId;

    @Excel(name = "采购单位")
    @TableField(exist = false)
    private String purchaseDeptName;

    @Excel(name = "项目名称")
    @NotNull(message = "项目名称不能为空")
    @ApiModelProperty(value = "项目名称")
    @TableField("project_name")
    private String projectName;

    @Excel(name = "项目类型")
    @ApiModelProperty(value = "项目类型（0：装备类；1：物资类；2：服务类；3：工程类）")
    @TableField("project_type")
    private String projectType;
    @TableField(exist = false)
    private String projectTypeStr;

    @Excel(name = "需求概况")
    @ApiModelProperty(value = "需求概况")
    @TableField("demand_overview")
    private String demandOverview;

    @Excel(name = "概算金额（万元）")
    @ApiModelProperty(value = "概算金额(万元（保留小数点后两位）")
    @TableField("evaluation")
    private BigDecimal evaluation;

    @ApiModelProperty(value = "是否为超限额计划(0:未超额，1:超额)")
    @TableField("is_excess")
    private String isExcess;

    @Excel(name = "采购服务站")
    @ApiModelProperty(value = "采购服务站")
    @TableField("purchase_services")
    private String purchaseServices;

    @TableField(exist = false)
    private String purchaseServicesStr;
    /**
     * 机关业务指导处(科)
     */
    @TableField("organ_division")
    private String organDivision;
    @TableField(exist = false)
    private String organDivisionStr;
    /**
     * 预算科目
     */
    @TableField("budget_account")
    private String budgetAccount;
    @TableField(exist = false)
    private String budgetAccountStr;
    @Excel(name = "计划提报需求时间", dateFormat = "yyyy-MM")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "计划提报需求时间--->需求单位成功提报采购需求的日期（具体到月）")
    @TableField("plan_demand_sub_time")
    private Date planDemandSubTime;

    @Excel(name = "计划完成采购时间", dateFormat = "yyyy-MM")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "计划完成采购时间--->公示中标结果的日期，即填制中标信息的日期（具体到月）")
    @TableField("plan_purchase_finish_time")
    private Date planPurchaseFinishTime;

    @Excel(name = "计划交付（实施）时间", dateFormat = "yyyy-MM")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "计划交付时间--->供应商完成并交付后，使用单位收到标的日期，即填制建设文档的日期")
    @TableField("plan_deliver_time")
    private Date planDeliverTime;

    @Excel(name = "项目属性")
    @ApiModelProperty(value = "项目属性（0:应急应战项目， 1:重大规划任务项目， 2:规划任务项目， 3:一般项目）")
    @TableField("project_attr")
    private String projectAttr;

    @TableField(exist = false)
    private String projectAttrName;

    @ApiModelProperty(value = "计划调整情况及理由--->如计划需要变更，在填写申请修改时需填写调整情况及理由，审核单位审核通过后显示该信息")
    @TableField("adjust_reason")
    private String adjustReason;

    @Excel(name = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "项目状态(0:计划待提交，1:计划待审核，2:计划已退回，3:计划已审核)")
    @TableField("project_status")
    private String projectStatus;
    @TableField(exist = false)
    private String projectStatusStr;
    @ApiModelProperty(value = "退回原因")
    @TableField("refuse_reason")
    private String refuseReason;

    @ApiModelProperty(value = "0：正常，1：已删除")
    @TableField("del_flay")
    private String delFlay;

    @ApiModelProperty(value = "计划类型（0：季度计划，1：临时计划）")
    @TableField("plan_type")
    private String planType;

    @ApiModelProperty(value = "创建者")
    @TableField("created")
    private String created;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "修改者")
    @TableField("updated")
    private String updated;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    private Date updateTime;

    /**
     * 上传附件
     */
    @ApiModelProperty(value = "附件关联")
    @TableField(exist = false)
    List<SysFileRef> sysFileRefs;

    /**
     * 是否显示审核按钮 （true:显示，false：不显示）
     */
    @TableField(exist = false)
    private Boolean flag;

    /**
     * 是否可以执行发函（true为可以）
     */
    @TableField(exist = false)
    private String sendLetterDo;
    /**
     * 发函状态（0：未发函或已处理，1：确认发函）
     */
    private String sendLetter;
    /**
     * 发函内容
     */
    private String letterStr;
}
