package com.casic.missiles.model.equipment;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.casic.missiles.annotation.DictCodeField;
import com.casic.missiles.constants.MeterDictCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * 测量设备-标准装置申请记录实体
 *
 * @author xiezhuangz
 * @version 1.0
 * @date 2022/12/19
 */

@Data
@ApiModel
@TableName("equipment_standard_apply")
@ColumnWidth(30)
@HeadRowHeight(15)
@ContentRowHeight(20)
@ContentStyle(borderLeft = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
@ExcelIgnoreUnannotated
public class EquipmentStandardApply implements Serializable {

    private static final long serialVersionUID = 2350122203753664479L;

    /**
     * 主键
     */
    @TableId("id")
    @ApiModelProperty(value = "主键", dataType = "Long")
    private Long id;

    /**
     * 申请编号
     */
    @TableField("apply_no")
    @ExcelProperty(value = "申请编号",order = 0)
    @ApiModelProperty(value = "申请编号", dataType = "String")
    private String applyNo;

    /**
     * 标准装置ID
     */
    @TableField("standard_equipment_id")
    @NotBlank(message = "标准装置ID不能为空")
    @ApiModelProperty(value = "标准装置ID", dataType = "String")
    private String standardEquipmentId;

    /**
     * 申请类型-字典code
     */
    @TableField("apply_type")
    @NotBlank(message = "申请类型不能为空")
    @ApiModelProperty(value = "申请类型-字典code", dataType = "String")
    @DictCodeField(message = "申请类型不合法", cacheName = MeterDictCode.STANDARD_APPLY_TYPE)
    private String applyType;

    /**
     * 申请名称
     */
    @TableField("apply_name")
    @ApiModelProperty(value = "申请名称", dataType = "String")
    private String applyName;

    /**
     * 申请名称
     */
    @TableField("apply_time")
    @ExcelProperty(value = "申请时间")
    @ApiModelProperty(value = "申请时间", dataType = "String")
    private String applyTime;

    /**
     * 申请单位
     */
    @TableField("apply_unit")
    @ApiModelProperty(value = "申请单位", dataType = "Long")
    private String applyUnit;

    /**
     * 申请单位名称
     */
    @TableField(exist = false)
    @ExcelProperty(value = "申请单位",order = 6)
    @ApiModelProperty(value = "申请单位名称", dataType = "String")
    private String applyUnitName;

    /**
     * 申请人
     */
    @TableField("apply_person")
    @ApiModelProperty(value = "申请人", dataType = "Long")
    private String applyPerson;

    /**
     * 申请人名称
     */
    @TableField(exist = false)
    @ExcelProperty(value = "申请人",order = 7)
    @ApiModelProperty(value = "申请人名称", dataType = "String")
    private String applyPersonName;

    /**
     * 申请类型名称
     */
    @TableField(exist = false)
    @ExcelProperty(value = "申请类型",order = 1)
    @ApiModelProperty(value = "申请类型名称", dataType = "String")
    private String applyTypeName;

    /**
     * 标准代码
     */
    @TableField(exist = false)
    @ExcelProperty(value = "标准代码",order = 2)
    @ApiModelProperty(value = "标准代码", dataType = "String")
    private String standardNo;

    /**
     * 标准名称
     */
    @TableField(exist = false)
    @ExcelProperty(value = "标准名称",order = 3)
    @ApiModelProperty(value = "标准名称", dataType = "String")
    private String standardName;

    /**
     * 标准所在部门
     */
    @TableField(exist = false)
    @ExcelProperty(value = "标准所在部门",order = 4)
    @ApiModelProperty(value = "标准所在部门", dataType = "String")
    private String constructionStandardUnitName;

    /**
     * 标准负责人
     */
    @TableField(exist = false)
    @ExcelProperty(value = "标准负责人",order = 5)
    @ApiModelProperty(value = "标准负责人", dataType = "Long")
    private String standardOwner;

    /**
     * 审批状态-字典code
     */
    @TableField("approval_status")
    @DictCodeField(message = "审批状态不合法", cacheName = MeterDictCode.APPROVAL_STATUS)
    @ApiModelProperty(value = "审批状态-字典code", dataType = "String")
    private String approvalStatus;

    /**
     * 审批状态名称
     */
    @TableField(exist = false)
    @ExcelProperty(value = "审批状态",order = 9)
    @ApiModelProperty(value = "审批状态名称", dataType = "String")
    private String approvalStatusName;

    /**
     * 流程实例ID
     */
    @TableField("process_id")
    @ApiModelProperty(value = "流程实例ID", dataType = "String")
    private String processId;

    /**
     * 版本号
     */
    @TableField("version")
    @ApiModelProperty(value = "版本号", dataType = "String")
    private String version;

    /**
     * 备注
     */
    @TableField("remark")
    @ApiModelProperty(value = "备注", dataType = "String")
    private String remark;

    /**
     * 删除标记
     */
    @TableField("is_del")
    @ApiModelProperty(value = "删除标记", dataType = "Integer")
    private Integer isDel;


    /**
     * 创建人
     */
    @TableField("create_user")
    @ApiModelProperty(value = "创建人", dataType = "String")
    private String createUser;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @ExcelProperty(value = "申请事件",order = 8)
    @ApiModelProperty(value = "创建时间", dataType = "String")
    private String createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @ApiModelProperty(value = "更新时间", dataType = "String")
    private String updateTime;

    /**
     * 标准装置
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "标准装置", dataType = "Object")
    private EquipmentStandardEquipment meterStandardEquipment;

    /**
     * 文件列表
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "文件列表", dataType = "List")
    private List<EquipmentStandardApplyFile> fileList;

    /**
     * 替换后的设备(回显)
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "替换后的设备(回显)", dataType = "List")
    private List<EquipmentStandardSupportEquipment> newSupportEquipmentList;

    /**
     * 需要被替换的设备列表(回显)
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "需要被替换的设备列表(回显)", dataType = "List")
    private List<EquipmentStandardSupportEquipment> oldSupportEquipmentList;

    /**
     * 配套设备列表(新增)
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "配套设备列表(新增)", dataType = "List")
    private List<EquipmentStandardApplyEquipment> applyEquipmentList;

    /**
     * 任务id
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "任务id（同意、驳回等操作使用）", dataType = "String")
    private String taskId;

    /**
     * 可选决策项
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "可选决策项（1同意驳回拒绝 2同意驳回 3同意拒绝，用于待审批列表同意/驳回/拒绝按钮展示）", dataType = "Integer")
    private Integer decisionItem;
}
