package com.ruoyi.credit.domain;

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

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.credit.annotation.EncryptedField;

/**
 * 数字债权凭证对象 dc_credit
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
public class DigitalCredit extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 债权ID */
    private Long creditId;

    /** 债权编号 */
    @Excel(name = "债权编号")
    @Size(max = 100, message = "债权编号长度不能超过100个字符")
    private String creditNumber;

    /** 关联合同ID */
    @Excel(name = "关联合同ID")
    @NotNull(message = "关联合同ID不能为空")
    private Long contractId;

    /** 合同编号 */
    @Excel(name = "合同编号")
    @Size(max = 100, message = "合同编号长度不能超过100个字符")
    private String contractNumber;

    /** 债权人ID(安保公司) */
    @Excel(name = "债权人ID")
    private Long creditorId;

    /** 债权人名称 */
    @Excel(name = "债权人名称")
    @Size(max = 100, message = "债权人名称长度不能超过100个字符")
    private String creditorName;

    /** 债务人ID(甲方单位) */
    @Excel(name = "债务人ID")
    private Long debtorId;

    /** 债务人名称 */
    @Excel(name = "债务人名称")
    @Size(max = 100, message = "债务人名称长度不能超过100个字符")
    private String debtorName;

    /** 债权金额(加密) */
    @Excel(name = "债权金额")
    @EncryptedField(algorithm = "AES-256-GCM")
    @NotNull(message = "债权金额不能为空")
    private BigDecimal creditAmount;

    /** 债权描述 */
    @Excel(name = "债权描述")
    @Size(max = 1000, message = "债权描述长度不能超过1000个字符")
    private String description;

    /** 发行日期 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "发行日期", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "发行日期不能为空")
    private Date issueDate;

    /** 到期日期 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "到期日期", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "到期日期不能为空")
    private Date maturityDate;

    /** 债权状态 */
    @Excel(name = "债权状态")
    @Size(max = 50, message = "债权状态长度不能超过50个字符")
    private String creditStatus;

    /** 区块链哈希 */
    @Excel(name = "区块链哈希")
    @Size(max = 255, message = "区块链哈希长度不能超过255个字符")
    private String blockchainHash;

    /** 数字签名(加密) */
    @EncryptedField(algorithm = "AES-256-GCM")
    private String digitalSignature;

    /** 加密密钥ID */
    @Size(max = 100, message = "加密密钥ID长度不能超过100个字符")
    private String encryptionKeyId;

    /** 部门ID */
    @Excel(name = "部门ID")
    private Long deptId;

    public void setCreditId(Long creditId) 
    {
        this.creditId = creditId;
    }

    public Long getCreditId() 
    {
        return creditId;
    }
    public void setCreditNumber(String creditNumber) 
    {
        this.creditNumber = creditNumber;
    }

    public String getCreditNumber() 
    {
        return creditNumber;
    }
    public void setContractId(Long contractId) 
    {
        this.contractId = contractId;
    }

    public Long getContractId() 
    {
        return contractId;
    }
    public void setContractNumber(String contractNumber) 
    {
        this.contractNumber = contractNumber;
    }

    public String getContractNumber() 
    {
        return contractNumber;
    }
    public void setCreditorId(Long creditorId) 
    {
        this.creditorId = creditorId;
    }

    public Long getCreditorId() 
    {
        return creditorId;
    }
    public void setCreditorName(String creditorName) 
    {
        this.creditorName = creditorName;
    }

    public String getCreditorName() 
    {
        return creditorName;
    }
    public void setDebtorId(Long debtorId) 
    {
        this.debtorId = debtorId;
    }

    public Long getDebtorId() 
    {
        return debtorId;
    }
    public void setDebtorName(String debtorName) 
    {
        this.debtorName = debtorName;
    }

    public String getDebtorName() 
    {
        return debtorName;
    }
    public void setCreditAmount(BigDecimal creditAmount) 
    {
        this.creditAmount = creditAmount;
    }

    public BigDecimal getCreditAmount() 
    {
        return creditAmount;
    }
    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }
    public void setIssueDate(Date issueDate) 
    {
        this.issueDate = issueDate;
    }

    public Date getIssueDate() 
    {
        return issueDate;
    }
    public void setMaturityDate(Date maturityDate) 
    {
        this.maturityDate = maturityDate;
    }

    public Date getMaturityDate() 
    {
        return maturityDate;
    }
    public void setCreditStatus(String creditStatus) 
    {
        this.creditStatus = creditStatus;
    }

    public String getCreditStatus() 
    {
        return creditStatus;
    }
    public void setBlockchainHash(String blockchainHash) 
    {
        this.blockchainHash = blockchainHash;
    }

    public String getBlockchainHash() 
    {
        return blockchainHash;
    }
    public void setDigitalSignature(String digitalSignature) 
    {
        this.digitalSignature = digitalSignature;
    }

    public String getDigitalSignature() 
    {
        return digitalSignature;
    }
    public void setEncryptionKeyId(String encryptionKeyId) 
    {
        this.encryptionKeyId = encryptionKeyId;
    }

    public String getEncryptionKeyId() 
    {
        return encryptionKeyId;
    }

    public void setDeptId(Long deptId) 
    {
        this.deptId = deptId;
    }

    public Long getDeptId() 
    {
        return deptId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("creditId", getCreditId())
            .append("creditNumber", getCreditNumber())
            .append("contractId", getContractId())
            .append("contractNumber", getContractNumber())
            .append("creditorId", getCreditorId())
            .append("creditorName", getCreditorName())
            .append("debtorId", getDebtorId())
            .append("debtorName", getDebtorName())
            .append("creditAmount", getCreditAmount())
            .append("description", getDescription())
            .append("issueDate", getIssueDate())
            .append("maturityDate", getMaturityDate())
            .append("creditStatus", getCreditStatus())
            .append("blockchainHash", getBlockchainHash())
            .append("digitalSignature", getDigitalSignature())
            .append("encryptionKeyId", getEncryptionKeyId())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("deptId", getDeptId())
            .toString();
    }
}