package com.by4cloud.platformx.business.entity;
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.by4cloud.platformx.common.data.mybatis.BaseModel;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
import jakarta.persistence.Column;
|
import jakarta.persistence.Entity;
|
import jakarta.persistence.Table;
|
import jakarta.persistence.Transient;
|
import lombok.Data;
|
import lombok.EqualsAndHashCode;
|
import lombok.ToString;
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
/**
|
* 合同收款计划/履约节点实体类
|
* 统一管理合同的收款阶段、履约节点、收款比例及履约时间节点
|
*
|
* @author xfei
|
* @date 2024-01-15
|
*/
|
@Data
|
@Entity
|
@Table(name = "contract_payment_schedule")
|
@ToString(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
public class ContractPaymentSchedule extends BaseModel<ContractPaymentSchedule> {
|
|
// ==================== 关联信息 ====================
|
|
@Schema(description = "关联合同ID")
|
@Column(columnDefinition = "bigint not null comment '关联合同ID'")
|
private Long contractId;
|
|
@Schema(description = "合同名称")
|
@Column(columnDefinition = "VARCHAR(64) comment '合同名称'")
|
private String contractName;
|
|
@Schema(description = "关联标的物ID(可选,如果为空则适用于合同整体)")
|
@Column(columnDefinition = "bigint comment '关联标的物ID'")
|
private Long subjectMatterId;
|
|
@Schema(description = "标的物名称")
|
@Column(columnDefinition = "VARCHAR(64) comment '标的物名称'")
|
private String subjectMatterName;
|
|
// ==================== 收款阶段/履约节点基本信息 ====================
|
|
// @Schema(description = "收款阶段/节点编码(如:STAGE_001)")
|
// @Column(columnDefinition = "VARCHAR(64) comment '收款阶段/节点编码'")
|
// private String stageCode;
|
|
@Schema(description = "收款阶段名称(显性要素,如:合同签订预付、发货前付款、货到签收付款、调试完成付款、质保金)")
|
@Column(columnDefinition = "VARCHAR(100) not null comment '收款阶段名称'")
|
private String stageName;
|
|
// @Schema(description = "节点类型(0-标准预定义节点 1-自定义节点)")
|
// @Column(columnDefinition = "tinyint(1) default 0 comment '节点类型'")
|
// private Integer nodeType;
|
|
// @Schema(description = "履约节点编码(与收款阶段关联的履约节点,如:SIGN、PRE_DELIVERY、DELIVERY_RECEIPT、COMMISSIONING、WARRANTY)")
|
// @Column(columnDefinition = "VARCHAR(50) comment '履约节点编码'")
|
// private String fulfillmentNodeCode;
|
|
// @Schema(description = "履约节点名称")
|
// @Column(columnDefinition = "VARCHAR(100) comment '履约节点名称'")
|
// private String fulfillmentNodeName;
|
|
// ==================== 收款比例/金额 ====================
|
|
@Schema(description = "收款比例(%,如30表示30%)(显性要素)")
|
@Column(columnDefinition = "double comment '收款比例(%)'")
|
private Double paymentRatio;
|
|
@Schema(description = "计划收款金额(根据合同总金额*比例自动计算)")
|
@Column(columnDefinition = "double comment '计划收款金额'")
|
private Double plannedAmount;
|
|
@Schema(description = "实际收款金额")
|
@Column(columnDefinition = "double default 0.00 comment '实际收款金额'")
|
private Double actualAmount;
|
|
// ==================== 时序控制 ====================
|
|
@Schema(description = "阶段顺序(第几期)")
|
@Column(columnDefinition = "int not null comment '阶段顺序'")
|
private Integer stageOrder;
|
|
@Schema(description = "计划收款日期(基于合同签订日期+约定天数计算)")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
@Column(columnDefinition = "VARCHAR(64) comment '计划收款日期'")
|
private String plannedPaymentDate;
|
|
@Schema(description = "收款阶段生效日期(隐性要素 - 履约时间起点,即该节点实际达成的日期)")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
@Column(columnDefinition = "VARCHAR(64) comment '收款阶段生效日期(履约节点实际达成日期)'")
|
private String effectiveDate;
|
|
@Schema(description = "约定天数(合同签订后X天内付款/货到后X天内付款等)")
|
@Column(columnDefinition = "int default 0 comment '约定天数'")
|
private Integer agreedDays;
|
|
@Schema(description = "天数计算基准(0-合同签订日 1-上一节点生效日 2-货到日 3-验收日)")
|
@Column(columnDefinition = "tinyint(1) default 0 comment '天数计算基准'")
|
private Integer calculationBasis;
|
|
// ==================== 状态控制 ====================
|
|
@Schema(description = "履约节点状态(0-未开始 1-进行中 2-已达成 3-已逾期)")
|
@Column(columnDefinition = "tinyint(1) default 0 comment '履约节点状态'")
|
private Integer fulfillmentStatus;
|
|
@Schema(description = "收款状态(0-未收款 1-部分收款 2-已收款 3-逾期)")
|
@Column(columnDefinition = "tinyint(1) default 0 comment '收款状态'")
|
private Integer paymentStatus;
|
|
// @Schema(description = "是否自动触发(0-手动录入节点时间 1-系统自动获取节点时间)")
|
// @Column(columnDefinition = "tinyint(1) default 0 comment '是否自动触发'")
|
// private Integer isAutoTrigger;
|
|
// ==================== 关联单据(用于系统自动获取节点时间) ====================
|
|
// @Schema(description = "关联单据类型(0-无 1-调试单 2-验收单 3-发货单 4-签收单)")
|
// @Column(columnDefinition = "tinyint(2) comment '关联单据类型'")
|
// private Integer relatedDocType;
|
//
|
// @Schema(description = "关联单据ID(如调试单ID、验收单ID等)")
|
// @Column(columnDefinition = "bigint comment '关联单据ID'")
|
// private Long relatedDocId;
|
//
|
// @Schema(description = "关联单据编号")
|
// @Column(columnDefinition = "VARCHAR(64) comment '关联单据编号'")
|
// private String relatedDocNo;
|
|
// ==================== 发票关联 ====================
|
|
// @Schema(description = "关联发票ID")
|
// @Column(columnDefinition = "bigint comment '关联发票ID'")
|
// private Long invoiceId;
|
//
|
// @Schema(description = "是否已开票(0-未开票 1-已开票)")
|
// @Column(columnDefinition = "tinyint(1) default 0 comment '是否已开票'")
|
// private Integer isInvoiced;
|
|
// ==================== 业务扩展 ====================
|
|
@Schema(description = "备注")
|
@Column(columnDefinition = "VARCHAR(500) comment '备注'")
|
private String remark;
|
|
// @Schema(description = "排序号")
|
// @Column(columnDefinition = "int default 0 comment '排序号'")
|
// private Integer sortOrder;
|
|
// ==================== 临时字段(用于查询展示) ====================
|
|
|
|
// @Transient
|
// @TableField(exist = false)
|
// @Schema(description = "逾期天数(临时字段)")
|
// private Long overdueDays;
|
}
|