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;

/**
 * 合同对象 dc_contract
 * 
 * @author ruoyi
 * @date 2025-01-11
 */
public class Contract 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;

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

    /** 安保公司ID */
    @Excel(name = "安保公司ID")
    private Long securityCompanyId;

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

    /** 甲方单位ID */
    @Excel(name = "甲方单位ID")
    private Long clientCompanyId;

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

    /** 合同金额 */
    @Excel(name = "合同金额")
    @NotNull(message = "合同金额不能为空")
    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;

    /** 合同期限(月) */
    @Excel(name = "合同期限")
    @Size(max = 10, message = "合同期限长度不能超过10个字符")
    private String contractTerm;

    /** 合同条款 */
    @Excel(name = "合同条款")
    private String contractTerms;

    /** 服务类型 */
    @Excel(name = "服务类型")
    @Size(max = 50, message = "服务类型长度不能超过50个字符")
    private String serviceType;

    /** 服务内容 */
    @Excel(name = "服务内容")
    private String serviceContent;

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

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

    /** 合同内容 */
    @Excel(name = "合同内容")
    private String contractContent;

    /** 合同文件URL */
    @Excel(name = "合同文件URL")
    @Size(max = 500, message = "合同文件URL长度不能超过500个字符")
    private String fileUrl;

    /** 合同文件哈希值 */
    @Excel(name = "合同文件哈希值")
    @Size(max = 128, message = "合同文件哈希值长度不能超过128个字符")
    private String contractFileHash;

    /** 确认人ID */
    @Excel(name = "确认人ID")
    private Long confirmedBy;

    /** 确认时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "确认时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date confirmedTime;

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

    /** 部门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 setContractType(String contractType) 
    {
        this.contractType = contractType;
    }

    public String getContractType() 
    {
        return contractType;
    }

    public void setSecurityCompanyId(Long securityCompanyId) 
    {
        this.securityCompanyId = securityCompanyId;
    }

    public Long getSecurityCompanyId() 
    {
        return securityCompanyId;
    }

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

    public String getSecurityCompany() 
    {
        return securityCompany;
    }

    public void setClientCompanyId(Long clientCompanyId) 
    {
        this.clientCompanyId = clientCompanyId;
    }

    public Long getClientCompanyId() 
    {
        return clientCompanyId;
    }

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

    public String getClientCompany() 
    {
        return clientCompany;
    }

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

    public String getContractTerm() 
    {
        return contractTerm;
    }

    public void setContractTerms(String contractTerms) 
    {
        this.contractTerms = contractTerms;
    }

    public String getContractTerms() 
    {
        return contractTerms;
    }

    public void setServiceType(String serviceType) 
    {
        this.serviceType = serviceType;
    }

    public String getServiceType() 
    {
        return serviceType;
    }

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

    public String getServiceContent() 
    {
        return serviceContent;
    }

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

    public String getContractContent() 
    {
        return contractContent;
    }

    public void setFileUrl(String fileUrl) 
    {
        this.fileUrl = fileUrl;
    }

    public String getFileUrl() 
    {
        return fileUrl;
    }

    public void setContractFileHash(String contractFileHash) 
    {
        this.contractFileHash = contractFileHash;
    }

    public String getContractFileHash() 
    {
        return contractFileHash;
    }

    public void setConfirmedBy(Long confirmedBy) 
    {
        this.confirmedBy = confirmedBy;
    }

    public Long getConfirmedBy() 
    {
        return confirmedBy;
    }

    public void setConfirmedTime(Date confirmedTime) 
    {
        this.confirmedTime = confirmedTime;
    }

    public Date getConfirmedTime() 
    {
        return confirmedTime;
    }

    public void setBlockchainTxHash(String blockchainTxHash) 
    {
        this.blockchainTxHash = blockchainTxHash;
    }

    public String getBlockchainTxHash() 
    {
        return blockchainTxHash;
    }

    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("contractType", getContractType())
            .append("securityCompanyId", getSecurityCompanyId())
            .append("securityCompany", getSecurityCompany())
            .append("clientCompanyId", getClientCompanyId())
            .append("clientCompany", getClientCompany())
            .append("contractAmount", getContractAmount())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("contractTerm", getContractTerm())
            .append("contractTerms", getContractTerms())
            .append("serviceType", getServiceType())
            .append("serviceContent", getServiceContent())
            .append("paymentDueDate", getPaymentDueDate())
            .append("contractStatus", getContractStatus())
            .append("contractContent", getContractContent())
            .append("fileUrl", getFileUrl())
            .append("contractFileHash", getContractFileHash())
            .append("confirmedBy", getConfirmedBy())
            .append("confirmedTime", getConfirmedTime())
            .append("blockchainTxHash", getBlockchainTxHash())
            .append("deptId", getDeptId())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}