package com.ruoyi.credit.domain;

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
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_service_contract
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
public class ServiceContract extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 合同ID */
    private Long contractId;

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

    /** 合同标题 */
    @Excel(name = "合同标题")
    @NotBlank(message = "合同标题不能为空")
    @Size(max = 200, message = "合同标题长度不能超过200个字符")
    private String title;

    /** 安保公司名称 */
    @Excel(name = "安保公司名称")
    @NotBlank(message = "安保公司名称不能为空")
    @Size(max = 200, message = "安保公司名称长度不能超过200个字符")
    private String securityCompany;

    /** 甲方单位名称 */
    @Excel(name = "甲方单位名称")
    @NotBlank(message = "甲方单位名称不能为空")
    @Size(max = 200, message = "甲方单位名称长度不能超过200个字符")
    private String clientCompany;

    /** 服务内容(加密) */
    @Excel(name = "服务内容")
    @EncryptedField(algorithm = "AES-256-GCM")
    private String serviceContent;

    /** 合同期限(月) */
    @Excel(name = "合同期限")
    private Integer contractTerm;

    /** 合同条款(加密) */
    @Excel(name = "合同条款")
    @EncryptedField(algorithm = "AES-256-GCM")
    private String contractTerms;

    /** 合同金额(加密) */
    @Excel(name = "合同金额")
    @EncryptedField(algorithm = "AES-256-GCM")
    private BigDecimal contractAmount;

    /** 服务开始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "服务开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "服务开始日期不能为空")
    private Date startDate;

    /** 服务结束日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "服务结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "服务结束日期不能为空")
    private Date endDate;

    /** 付款到期日 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "付款到期日", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "付款到期日不能为空")
    private Date paymentDueDate;

    /** 合同状态 */
    @Excel(name = "合同状态")
    private String contractStatus;

    /** 合同类型: ONLINE(线上创建) / OFFLINE(线下签署) */
    @Excel(name = "合同类型")
    @NotBlank(message = "合同类型不能为空")
    @Pattern(regexp = "^(ONLINE|OFFLINE)$", message = "合同类型只能是ONLINE或OFFLINE")
    private String contractType;

    /** 合同来源: PLATFORM_CREATED(平台创建) / UPLOADED(上传) */
    @Excel(name = "合同来源")
    private String contractSource;

    /** 关联的合同文件ID(线下合同) */
    @Excel(name = "关联文件ID")
    private Long attachmentId;

    /** 签署日期 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "签署日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date signDate;

    /** 从上传文件提取的信息摘要 */
    @Excel(name = "提取信息摘要")
    private String extractedInfo;

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

    /** 敏感数据哈希(用于完整性验证) */
    @Size(max = 255, message = "数据哈希长度不能超过255个字符")
    private String dataHash;

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

    /** 查询条件：是否有完整服务周期 */
    private Boolean hasServicePeriod;

    /** 查询条件：是否有员工贷款申请 */
    private Boolean hasEmployeeLoanApplication;

    /** 员工贷款总额 */
    private BigDecimal employeeLoanTotalAmount;

    /** 员工贷款申请数量 */
    private Integer employeeLoanCount;

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



    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 setTitle(String title) 
    {
        this.title = title;
    }

    public String getTitle() 
    {
        return title;
    }
    public void setSecurityCompany(String securityCompany) 
    {
        this.securityCompany = securityCompany;
    }

    public String getSecurityCompany() 
    {
        return securityCompany;
    }
    public void setClientCompany(String clientCompany) 
    {
        this.clientCompany = clientCompany;
    }

    public String getClientCompany() 
    {
        return clientCompany;
    }
    public void setServiceContent(String serviceContent) 
    {
        this.serviceContent = serviceContent;
    }

    public String getServiceContent() 
    {
        return serviceContent;
    }
    public void setContractTerm(Integer contractTerm) 
    {
        this.contractTerm = contractTerm;
    }

    public Integer getContractTerm() 
    {
        return contractTerm;
    }
    public void setContractTerms(String contractTerms) 
    {
        this.contractTerms = contractTerms;
    }

    public String getContractTerms() 
    {
        return contractTerms;
    }
    public void setContractAmount(BigDecimal contractAmount) 
    {
        this.contractAmount = contractAmount;
    }

    public BigDecimal getContractAmount() 
    {
        return contractAmount;
    }
    public void setStartDate(Date startDate) 
    {
        this.startDate = startDate;
    }

    public Date getStartDate() 
    {
        return startDate;
    }
    public void setEndDate(Date endDate) 
    {
        this.endDate = endDate;
    }

    public Date getEndDate() 
    {
        return endDate;
    }
    public void setPaymentDueDate(Date paymentDueDate) 
    {
        this.paymentDueDate = paymentDueDate;
    }

    public Date getPaymentDueDate() 
    {
        return paymentDueDate;
    }
    public void setContractStatus(String contractStatus) 
    {
        this.contractStatus = contractStatus;
    }

    public String getContractStatus() 
    {
        return contractStatus;
    }
    public void setContractType(String contractType) 
    {
        this.contractType = contractType;
    }

    public String getContractType() 
    {
        return contractType;
    }
    public void setContractSource(String contractSource) 
    {
        this.contractSource = contractSource;
    }

    public String getContractSource() 
    {
        return contractSource;
    }
    public void setAttachmentId(Long attachmentId) 
    {
        this.attachmentId = attachmentId;
    }

    public Long getAttachmentId() 
    {
        return attachmentId;
    }
    public void setSignDate(Date signDate) 
    {
        this.signDate = signDate;
    }

    public Date getSignDate() 
    {
        return signDate;
    }
    public void setExtractedInfo(String extractedInfo) 
    {
        this.extractedInfo = extractedInfo;
    }

    public String getExtractedInfo() 
    {
        return extractedInfo;
    }
    public void setBlockchainHash(String blockchainHash) 
    {
        this.blockchainHash = blockchainHash;
    }

    public String getBlockchainHash() 
    {
        return blockchainHash;
    }
    public void setDataHash(String dataHash) 
    {
        this.dataHash = dataHash;
    }

    public String getDataHash() 
    {
        return dataHash;
    }
    public void setEncryptionKeyId(String encryptionKeyId) 
    {
        this.encryptionKeyId = encryptionKeyId;
    }

    public String getEncryptionKeyId() 
    {
        return encryptionKeyId;
    }

    public void setHasServicePeriod(Boolean hasServicePeriod) 
    {
        this.hasServicePeriod = hasServicePeriod;
    }

    public Boolean getHasServicePeriod() 
    {
        return hasServicePeriod;
    }

    public void setHasEmployeeLoanApplication(Boolean hasEmployeeLoanApplication) 
    {
        this.hasEmployeeLoanApplication = hasEmployeeLoanApplication;
    }

    public Boolean getHasEmployeeLoanApplication() 
    {
        return hasEmployeeLoanApplication;
    }

    public void setEmployeeLoanTotalAmount(BigDecimal employeeLoanTotalAmount) 
    {
        this.employeeLoanTotalAmount = employeeLoanTotalAmount;
    }

    public BigDecimal getEmployeeLoanTotalAmount() 
    {
        return employeeLoanTotalAmount;
    }

    public void setEmployeeLoanCount(Integer employeeLoanCount) 
    {
        this.employeeLoanCount = employeeLoanCount;
    }

    public Integer getEmployeeLoanCount() 
    {
        return employeeLoanCount;
    }

    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("contractId", getContractId())
            .append("contractNumber", getContractNumber())
            .append("title", getTitle())
            .append("securityCompany", getSecurityCompany())
            .append("clientCompany", getClientCompany())
            .append("serviceContent", getServiceContent())
            .append("contractTerm", getContractTerm())
            .append("contractTerms", getContractTerms())
            .append("contractAmount", getContractAmount())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("paymentDueDate", getPaymentDueDate())
            .append("contractStatus", getContractStatus())
            .append("contractType", getContractType())
            .append("contractSource", getContractSource())
            .append("attachmentId", getAttachmentId())
            .append("signDate", getSignDate())
            .append("extractedInfo", getExtractedInfo())
            .append("blockchainHash", getBlockchainHash())
            .append("dataHash", getDataHash())
            .append("encryptionKeyId", getEncryptionKeyId())
            .append("deptId", getDeptId())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}