package com.chushang.inspection.project.po;

import com.baomidou.mybatisplus.annotation.*;
import com.chushang.common.dict.annotation.DictFormat;
import com.chushang.common.mybatis.annotation.Condition;
import com.chushang.common.mybatis.base.BaseEntity;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import lombok.*;

/**
  * @auther: zhao
  * @date: 2024/6/15 10:51
  */
/**
 * 项目合同表
 */
@Data
@EqualsAndHashCode(callSuper=true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "wrk_project_contract")
@Builder
public class WrkProjectContract extends BaseEntity {
    /**
     * 合同Id  合同主键id, 雪花自增
     */
    @TableId(value = "contract_id", type = IdType.ASSIGN_ID)
    @Condition(name = "contract_id", type = Condition.ConditionType.eq)
    private Long contractId;

    /**
     * 项目id  项目id, 1个项目id 对应多个合同id
     */
    @TableField(value = "project_id")
    @Condition(name = "project_id", type = Condition.ConditionType.eq)
    private Long projectId;

    /**
     * 备注字段充当上传合同的fid字段
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 项目合同 url
     */
    @TableField(value = "contract_url")
    private String contractUrl;

    /**
     * 合同有效期开始时间
     */
    @TableField(value = "contract_start_time")
    private LocalDateTime contractStartTime;

    /**
     * 合同有效期结束日期
     */
    @TableField(value = "contract_end_time")
    private LocalDateTime contractEndTime;

    /**
     * 合同金额 合同金额数, 后台存储采用decimal(20,5)
     */
    @TableField(value = "contract_amount")
    private BigDecimal contractAmount;
    /**
     * 项目已经 回款金额
     */
    @TableField(value = "payment_amount")
    private BigDecimal paymentAmount;

    /**
     * 审核状态 项目审核状态 待初审 待复审 初审驳回 复审驳回 初审通过=待复审 复审通过
     */
    @TableField(value = "audit_status")
    @Condition(name = "audit_status", type = Condition.ConditionType.eq)
    @DictFormat(dictType = "project_audit_status")
    private Integer auditStatus;

    /**
     * 项目有效状态 合同有效期内的项目为有效项目
     */
    @TableField(value = "project_effect")
    @DictFormat(dictType = "project_effect")
    private Integer projectEffect;

    /**
     * 回款状态 是否已经回款完成
     * 0 未完成
     * 1 已完成
     */
    @TableField(value = "payment_state")
    @DictFormat(dictType = "payment_state")
    private Integer paymentState;
    /**
     * 对应的部门id
     */
    @TableField("dept_id")
    private Long deptId;

    /**
     * 审核记录
     */
    @TableField(exist = false)
    private List<WrkAudit> audits;
}
