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;

/**
 * <p>
 * 设备申请记录表
 * </p>
 *
 * @author xiezhuangz
 * @since 2022-12-21
 */
@Data
@ApiModel
@TableName("equipment_apply")
@ColumnWidth(30)
@HeadRowHeight(15)
@ContentRowHeight(20)
@ContentStyle(borderLeft = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
@ExcelIgnoreUnannotated
public class EquipmentApply implements Serializable {

    private static final long serialVersionUID = -7007500427160868420L;

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

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

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

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

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

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

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

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

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

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

    @TableField(exist = false)
    @ExcelProperty(value = "申请人",order = 3)
    @ApiModelProperty(value = "申请人姓名", dataType = "String")
    private String applyPersonName;

    /**
     * 领用时间/借用时间/闲置时间/封存时间/检修时间
     */
    @TableField("time")
    @ExcelProperty(value = "申请时间",order = 4)
    @ApiModelProperty(value = "领用时间/借用时间/闲置时间/封存时间/检修时间", dataType = "String")
    private String time;

    /**
     * 归还时间（设备借用）
     */
    @TableField("back_time")
    @ApiModelProperty(value = "归还时间（设备借用）", dataType = "String")
    private String backTime;

    /**
     * 检修保养人（设备检修保养验收申请）
     */
    @TableField("overhaul_person")
    @ApiModelProperty(value = "检修保养人（设备检修保养验收申请）", dataType = "String")
    private String overhaulPerson;

    /**
     * 申请说明
     */
    @TableField("apply_desc")
    @ApiModelProperty(value = "申请说明", dataType = "String")
    private String applyDesc;

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

    /**
     * 处理结果（设备领用、借用处理结果）
     */
    @TableField("process_result")
    @ApiModelProperty(value = "处理结果（设备领用、借用处理结果）", dataType = "String")
    private String processResult;

    /**
     * 版本号
     */
    @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")
    @ApiModelProperty(value = "创建时间", dataType = "String")
    private String createTime;

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

    /**
     * 设备列表
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "设备列表", dataType = "List")
    private List<EquipmentApplyEquipment> equipmentList;

    /**
     * 设备详细列表
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "设备详细列表", dataType = "List")
    private List<EquipmentFixedAssets> equipmentInfoList;

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

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


    /**
     * 检修申请id
     */
    @TableField("acceptance_check_id")
    @ApiModelProperty(value = "检修申请id", dataType = "String")
    private String acceptanceCheckId;

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

}
