package com.ruoyi.credit.domain;

import java.math.BigDecimal;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

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

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 合同信息提取对象 dc_contract_extraction
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
public class ContractExtraction extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 提取ID */
    private Long extractionId;

    /** 关联文件ID */
    @Excel(name = "关联文件ID")
    @NotNull(message = "关联文件ID不能为空")
    private Long fileId;

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

    /** 提取方法: OCR/PDF_PARSE/MANUAL */
    @Excel(name = "提取方法")
    @NotBlank(message = "提取方法不能为空")
    @Pattern(regexp = "^(OCR|PDF_PARSE|MANUAL)$", message = "提取方法只能是OCR、PDF_PARSE或MANUAL")
    private String extractionMethod;

    /** 提取的文本内容 */
    @Excel(name = "提取的文本内容")
    private String extractedText;

    /** 关键信息JSON格式 */
    @Excel(name = "关键信息")
    private String keyInformation;

    /** 置信度分数(0-100) */
    @Excel(name = "置信度分数")
    @DecimalMin(value = "0.00", message = "置信度分数不能小于0")
    @DecimalMax(value = "100.00", message = "置信度分数不能大于100")
    private BigDecimal confidenceScore;

    /** 提取状态 */
    @Excel(name = "提取状态")
    @NotBlank(message = "提取状态不能为空")
    @Pattern(regexp = "^(PROCESSING|SUCCESS|FAILED|PARTIAL)$", message = "提取状态只能是PROCESSING、SUCCESS、FAILED或PARTIAL")
    private String extractionStatus;

    /** 错误信息 */
    @Excel(name = "错误信息")
    private String errorMessage;

    /** 处理时间(毫秒) */
    @Excel(name = "处理时间")
    @Min(value = 0, message = "处理时间不能小于0")
    private Integer processingTime;

    public void setExtractionId(Long extractionId) 
    {
        this.extractionId = extractionId;
    }

    public Long getExtractionId() 
    {
        return extractionId;
    }
    public void setFileId(Long fileId) 
    {
        this.fileId = fileId;
    }

    public Long getFileId() 
    {
        return fileId;
    }
    public void setContractId(Long contractId) 
    {
        this.contractId = contractId;
    }

    public Long getContractId() 
    {
        return contractId;
    }
    public void setExtractionMethod(String extractionMethod) 
    {
        this.extractionMethod = extractionMethod;
    }

    public String getExtractionMethod() 
    {
        return extractionMethod;
    }
    public void setExtractedText(String extractedText) 
    {
        this.extractedText = extractedText;
    }

    public String getExtractedText() 
    {
        return extractedText;
    }
    public void setKeyInformation(String keyInformation) 
    {
        this.keyInformation = keyInformation;
    }

    public String getKeyInformation() 
    {
        return keyInformation;
    }
    public void setConfidenceScore(BigDecimal confidenceScore) 
    {
        this.confidenceScore = confidenceScore;
    }

    public BigDecimal getConfidenceScore() 
    {
        return confidenceScore;
    }
    public void setExtractionStatus(String extractionStatus) 
    {
        this.extractionStatus = extractionStatus;
    }

    public String getExtractionStatus() 
    {
        return extractionStatus;
    }
    public void setErrorMessage(String errorMessage) 
    {
        this.errorMessage = errorMessage;
    }

    public String getErrorMessage() 
    {
        return errorMessage;
    }
    public void setProcessingTime(Integer processingTime) 
    {
        this.processingTime = processingTime;
    }

    public Integer getProcessingTime() 
    {
        return processingTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("extractionId", getExtractionId())
            .append("fileId", getFileId())
            .append("contractId", getContractId())
            .append("extractionMethod", getExtractionMethod())
            .append("extractedText", getExtractedText())
            .append("keyInformation", getKeyInformation())
            .append("confidenceScore", getConfidenceScore())
            .append("extractionStatus", getExtractionStatus())
            .append("errorMessage", getErrorMessage())
            .append("processingTime", getProcessingTime())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}