package com.jeeplus.test.cw.contractRegistration.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.core.domain.BaseEntity;
import com.jeeplus.core.query.Query;
import com.jeeplus.core.query.QueryType;
import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author: 王强
 * @create: 2022-11-08 10:42
 **/
@Data
@TableName(value = "cw_work_contract_info")
public class ContractInfo extends BaseEntity {

    //合同编号（字典值）
    public static final String BIZ_CODE = "10";

    //合同 基字流水号
    public static final String SERIAL_NUMBER1 = "17";
    //合同 咨字流水号
    public static final String SERIAL_NUMBER2 = "18";
    //合同 框字流水号
    public static final String SERIAL_NUMBER3 = "19";
    //合同 审字流水号
    public static final String SERIAL_NUMBER4 = "20";
    //合同 验字流水号
    public static final String SERIAL_NUMBER5 = "21";
    //合同 特字流水号
    public static final String SERIAL_NUMBER6 = "22";

    @Query(tableColumn = "a.contract_name")
    @Excel(name = "合同名称", width = 30)
    private String contractName;            //合同名称
    @Query(tableColumn = "a.contract_no")
    @Excel(name = "合同编号", width = 30)
    private String contractNo;              //合同编号

    /**
     * 委托方联系人名称
     */
    @TableField(exist = false)
    @Excel(name = "委托方", width = 30)
    private String clientContactsName;

    /**
     * 案卷号
     */
    @TableField(exist = false)
    @Excel(name = "案卷号", width = 16)
    private String filedNo;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "签约日期", width = 16,exportFormat="yyyy-MM-dd")
    private Date signingDate;             //签约日期
    @Query(tableColumn = "a.contract_amount")
    @Excel(name = "合同金额（元）", width = 16, type = 10)
    private Double contractAmount;          //合同金额（元）

    @TableField(exist = false)
    @Excel(name = "所属部门", width = 16)
    private String departmentName;

    /**
     * 创建人
     */
    @TableField(exist = false)
    @Excel(name = "创建人", width = 12)
    private String createName;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 16,exportFormat="yyyy-MM-dd")
    private Date createDate;
    @Excel(name = "状态", width = 10,dict = "cw_status")
    private String status;                  //状态

    /**
     * 纸质归档状态
     */
    @Excel(name = "纸质归档状态", width = 16,dict = "filed_type")
    private String filedPaperType;

    /**
     * 借用状态
     */
    @Excel(name = "借用状态", width = 12,dict = "borrow_type")
    private String borrowType;

    private String payerSubject;            //付款主体
    private String paymentMethod;           //付款方式
    private Double predictAmount;          //预计金额（元）
    private Double actualContractAmount;    //合同实际金额
    private String contractNum;             //合同份数
    private String paymentAgreement;        //付款约定
    @TableField(fill = FieldFill.UPDATE)
    private String changeNum;               //修改次数
//    @Query(tableColumn = "a.department")
    private String department;              //所属部门
    private String clientContacts;          //委托方联系人
    private String clientContactsPhone;     //委托方联系人电话
    private String contractApprovalType;    //合同归档审批类型
    private String procInsId;               //流程id
    private String processDefinitionId;     //

    @TableField(fill = FieldFill.INSERT)
    private String createBy;                //创建人名称

    @TableField(exist = false)
    @Query(tableColumn = "c.id",type = QueryType.EQ)
    private String createId;                //创建人id

    @TableField(exist = false)
    private String contractStatus;          //合同状态

    @TableField(exist = false)
    private String taskFiledId;

    @TableField(exist = false)
    private String taskFiledProcInsId;

    @TableField(exist = false)
    private String taskFiledPaperProcInsId;

    /**
     * 归档状态
     */
    @Query(tableColumn = "a.filed_type")
    private String filedType;

    @TableField(exist = false)
    private String[] contractAmounts;

    @TableField(exist = false)
    private String[] contractDates;

    /**
     * 附件信息
     */
    @TableField(exist = false)
    private List<WorkAttachmentDto> contractProperList;

    /**
     * 被服务单位信息
     */
    @TableField(exist = false)
    private List<CwWorkClientBaseDTO> cwWorkClientContactDTOList;

    /**
     * 归档附件信息
     */
    @TableField(exist = false)
    private List<WorkAttachmentDto> contractInfoList;

    /**
     * 合同金额类别
     */
    private String contractAmountType;

    /**
     * 对方合同编号
     */
    private String contractOpposite;

    /**
     * 收费标准
     */
    private String contractFee;

    private String fees;
    /**
     * 确认案卷号
     */
    @TableField(exist = false)
    private String confirmFiledNo;

    @TableField(exist = false)
    private String taskBorrowId;

    /**
     * 客户id
     */
    @TableField(exist = false)
    private String customerId;

    /**
     * 客户编号
     */
    @TableField(exist = false)
    private String customerNo;

    /**
     * 统一社会信用代码
     */
    @TableField(exist = false)
    private String uscCode;

    /**
     * 客户地址
     */
    @TableField(exist = false)
    private String address;

    /**
     * 付款描述
     */
    private String paymentDescribe;

    /**
     * 合同类型
     */
    private String contractType;

    /**
     * 合同流水号
     */
    private String contractSerialNumber;

    @TableField(exist = false)
    private String taskId;

    /**
     * 数据审核人
     */
    @TableField(exist = false)
    private List<String> auditUserIds;

    @TableField(exist = false)
    private String filePaperTaskId;

    /**
     * 数据审核人  纸质归档
     */
    @TableField(exist = false)
    private List<String> auditUserIdsFP;
}
