Contract.java 6.76 KB
package vion.model;

import com.baomidou.mybatisplus.annotation.*;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import io.github.linpeilie.annotations.ReverseAutoMapping;
import lombok.Getter;
import lombok.Setter;
import vion.dto.ContractDTO;
import vion.vo.ContractVO;

import java.math.BigDecimal;
import java.util.Date;


/**
 * 合同
 */
@Getter
@Setter
@TableName(value = "tbl_contract_info")
@AutoMappers({
        @AutoMapper(target = ContractVO.class),
        @AutoMapper(target = ContractDTO.class),
})
public class Contract {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 合同名称
     */
    @TableField(value = "\"name\"", condition = SqlCondition.LIKE)
    private String name;

    /**
     * 合同编号
     */
    @TableField(value = "contract_no", condition = SqlCondition.LIKE)
    private String contractNo;

    /**
     * 合同类型:1-维保合同 2-框架合同 3-集成合同 4-供货合同 5-供货施工合同 0-其他
     */
    @TableField(value = "\"type\"")
    private Integer type;

    /**
     * 合同签订日期
     */
    @TableField(value = "sign_date")
    private Date signDate;

    /**
     * 合同维保开始日期
     */
    @TableField(value = "maintain_sdate")
    private Date maintainSdate;

    /**
     * 合同维保结束日期
     */
    @TableField(value = "maintain_edate")
    private Date maintainEdate;

    /**
     * 合同进度:1-签订 2-到货 3-系统验收(初验) 4-项目验收(终验) 5-质保 6-第一笔维保款 7-第二笔维保款 8-第三笔维保款 9-维保进度款 10-维保验收款
     */
    @TableField(value = "\"status\"")
    private Integer status;

    /**
     * 合同总金额
     * <p>
     * 更新合同时,合同相关金额计算是由合同收款记录计算的,不能通过更新接口自己修改
     */
    @TableField(value = "total_amount")
    @ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
    private BigDecimal totalAmount;

    /**
     * 合同已收金额
     */
    @TableField(value = "paid_amount")
    @ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
    private BigDecimal paidAmount;

    /**
     * 合同应收金额:
     * 根据【合同进度】,由系统判断出应该收到的金额
     */
    @TableField(value = "receivable_amount")
    @ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
    private BigDecimal receivableAmount;

    /**
     * 合同未收金额:total-paid
     */
    @TableField(value = "outstanding_amount")
    @ReverseAutoMapping(targetClass = ContractDTO.class, ignore = true)
    private BigDecimal outstandingAmount;

    /**
     * 合同签订主体
     */
    @TableField(value = "subject")
    private String subject;

    /**
     * 合同甲方名称
     */
    @TableField(value = "customer_name", condition = SqlCondition.LIKE)
    private String customerName;

    /**
     * 销售人员名称
     */
    @TableField(value = "sale_name", condition = SqlCondition.LIKE)
    private String saleName;

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

    /**
     * 记录创建者
     */
    @TableField(value = "create_user")
    private Long createUser;

    /**
     * 记录最后一次修改者
     */
    @TableField(value = "modify_user")
    private Long modifyUser;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;

    /**
     * 合同质保周期(月)
     */
    @TableField(value = "warranty_period")
    private Integer warrantyPeriod;

    /**
     * 终验日期,目前取值为合同阶段为系统初验或者终验的 nodeDate
     */
    @TableField(value = "final_date")
    private Date finalDate;

    /**
     * 开票金额
     */
    @TableField(value = "invoice_amount")
    private BigDecimal invoiceAmount;

    /**
     * 录入时间
     */
    @TableField(value = "entry_time")
    private Date entryTime;

    /**
     * 财务状态
     */
    @TableField(value = "financial_status")
    private Integer financialStatus;

    /**
     * 合同背景情况说明
     */
    @TableField(value = "back_info")
    private String backInfo;

    @TableField(exist = false)
    private Date originalModTime;

    /**
     * 合同签订付款比例
     */
    @TableField(exist = false)
    private BigDecimal signRatio;

    /**
     * 合同签订付款日期
     */
    @TableField(exist = false)
    private Date signDate1;

    /**
     * 合同到货付款比例
     */
    @TableField(exist = false)
    private BigDecimal arriveRatio;

    /**
     * 合同到货付款日期
     */
    @TableField(exist = false)
    private Date arriveDate;

    /**
     * 合同系统验收付款比例
     */
    @TableField(exist = false)
    private BigDecimal systemCheckRatio;

    /**
     * 合同系统验收付款日期
     */
    @TableField(exist = false)
    private Date systemCheckDate;

    /**
     * 合同项目验收付款比例
     */
    @TableField(exist = false)
    private BigDecimal projectCheckRatio;

    /**
     * 合同项目验收付款日期
     */
    @TableField(exist = false)
    private Date projectCheckDate;

    /**
     * 合同质保付款比例
     */
    @TableField(exist = false)
    private BigDecimal warrantyRatio;

    /**
     * 合同质保付款日期
     */
    @TableField(exist = false)
    private Date warrantyDate;

    /**
     * 合同维保付款比例1
     */
    @TableField(exist = false)
    private BigDecimal maintainRatio1;

    /**
     * 合同维保付款日期1
     */
    @TableField(exist = false)
    private Date maintainDate1;

    /**
     * 合同维保付款比例2
     */
    @TableField(exist = false)
    private BigDecimal maintainRatio2;

    /**
     * 合同维保付款日期2
     */
    @TableField(exist = false)
    private Date maintainDate2;

    /**
     * 合同维保付款比例3
     */
    @TableField(exist = false)
    private BigDecimal maintainRatio3;

    /**
     * 合同维保付款日期3
     */
    @TableField(exist = false)
    private Date maintainDate3;

    /**
     * 维保进度款
     */
    @TableField(exist = false)
    private BigDecimal maintainProgressRatio;

    /**
     * 维保进度款付款日期
     */
    @TableField(exist = false)
    private Date maintainProgressDate;

    /**
     * 维保验收款
     */
    @TableField(exist = false)
    private BigDecimal maintainAcceptanceRatio;

    /**
     * 维保验收款付款日期
     */
    @TableField(exist = false)
    private Date maintainAcceptanceDate;
}