package com.ydtech.modules.protocol.entity.po; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ydtech.modules.protocol.utils.AssertionUtils; import com.ydtech.utils.StringUtils; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; /** * 协议信息表 * * @TableName ptl_agreement */ @TableName(value = "ptl_agreement") @Data public class PtlAgreement implements Serializable { /** * 主键/自增 */ @TableId(value = "id", type = IdType.AUTO) private String id; /** * 供应商类型 * 1 渠道 * 2 财险 * 3 寿险 */ @TableField(value = "companies_type") private String companiesType; /** * 协议类型 * 1 平台协议-平台结算 * 2 私有协议-自行结算 * 3 网销协议-自行结算 */ @TableField(value = "agreement_type") private String agreementType; /** * 协议代码 */ @TableField(value = "agreement_code") private String agreementCode; /** * 协议名称 */ @TableField(value = "agreement_name") private String agreementName; /** * 承保描述 */ @TableField(value = "underwriting_description") private String underwritingDescription; /** * 协议简称 */ @TableField(value = "agreement_abbreviation") private String agreementAbbreviation; /** * 合作公司 id */ @TableField(value = "partner_companies_id") private String partnerCompaniesId; /** * 保险公司id */ @TableField(value = "association_companies_id") private String associationCompaniesId; /** * 关联-保险公司 */ @TableField(value = "insurance_company") private String insuranceCompany; /** * 关联-保险公司id */ @TableField(value = "insurance_company_id") private String insuranceCompanyId; /** * 协议起期 */ @TableField(value = "start_date") private LocalDate startDate; /** * 协议止期 */ @TableField(value = "end_date") private LocalDate endDate; /** * 结算周期 */ @TableField(value = "money_time") private Integer moneyTime; /** * 保单匹配协议日期类型(保单日期类型) */ @TableField(value = "match_type") private String matchType; /** * 对接人 */ @TableField(value = "docking_person") private String dockingPerson; /** * 联系方式(对接人) */ @TableField(value = "docking_phone") private String dockingPhone; /** * 含增值税结算 */ @TableField(value = "with_tax") private String withTax; /** * 佣金发放方式 */ @TableField(value = "money_type") private String moneyType; /** * 有效状态 */ @TableField(value = "valid_status") private String validStatus; /** * 附件id */ @TableField(value = "file_id") private String fileId; /** * 审核内容 */ @TableField(value = "audit_content") private String auditContent; /** * 审核状态 0 申请审核 1 审核通过 2 审核不通过 */ @TableField(value = "audit_status") private Integer auditStatus; /** * 序号 */ @ApiModelProperty("serial_number") private Integer serialNumber; /** * 创建者 */ @TableField(value = "creator") private String creator; /** * 创建时间 */ @TableField(value = "create_time") private LocalDateTime createTime; /** * 修改人 */ @TableField(value = "modified_by") private String modifiedBy; /** * 修改时间 */ @TableField(value = "update_time") private LocalDateTime updateTime; /** * 审核类型 */ @TableField(value = "audit_type") private Integer auditType; @TableField(exist = false) private static final long serialVersionUID = 1L; public void generateTheProtocolCode() { AssertionUtils.isFail(StringUtils.isNullOrEmpty(this.getPartnerCompaniesId()), "请检查合作保险公司是否选择"); String string = LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE); this.agreementCode = this.getPartnerCompaniesId() + string; } }