|
|
package com.supervision.police.dto;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
import com.supervision.police.domain.CaseEvidence;
|
|
|
import com.supervision.police.domain.FileEvidenceProperty;
|
|
|
import com.supervision.police.handler.NotePromptExtractAttributesTypeHandler;
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
import lombok.Data;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
@Data
|
|
|
public class CaseEvidenceDetailDTO {
|
|
|
|
|
|
@Schema(description = "案件证据id")
|
|
|
private String id;
|
|
|
|
|
|
@Schema(description = "案件证据名称")
|
|
|
private String evidenceName;
|
|
|
|
|
|
@Schema(description = "案件证据类型")
|
|
|
private String evidenceType;
|
|
|
|
|
|
@Schema(description = "案件证据文件类型 1:文档 2:图片")
|
|
|
private String contentType;
|
|
|
|
|
|
@Schema(description = "案件证据类型描述")
|
|
|
private String evidenceTypeDesc;
|
|
|
|
|
|
@Schema(description = "案件证据文件格式 文件夹 .jpg ....")
|
|
|
private String evidenceFormat;
|
|
|
|
|
|
@Schema(description = "证据提供人")
|
|
|
private String provider;
|
|
|
|
|
|
@Schema(description = "甲方")
|
|
|
private String partyA;
|
|
|
|
|
|
@Schema(description = "乙方")
|
|
|
private String partyB;
|
|
|
|
|
|
@Schema(description = "案件证据目录id")
|
|
|
private String directoryId;
|
|
|
|
|
|
@Schema(description = "案件证据标题")
|
|
|
private String title;
|
|
|
|
|
|
private String caseId;
|
|
|
|
|
|
@Schema(description = "案件证据文件信息列表")
|
|
|
private List<EvidenceFileDTO> fileList;
|
|
|
|
|
|
@Schema(description = "最近时间")
|
|
|
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
|
private LocalDateTime updateTime;
|
|
|
|
|
|
@Schema(description = "案件证据属性")
|
|
|
@TableField(typeHandler = NotePromptExtractAttributesTypeHandler.class)
|
|
|
private List<NotePromptExtractAttributesDto> property;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 数据更新状态 -1:无需更新 0:删除 1:新增
|
|
|
*/
|
|
|
private String updateStatus = "-1";
|
|
|
|
|
|
/**
|
|
|
* 0:待处理:待识别、待提取
|
|
|
* 1: 处理中:识别中、提取中
|
|
|
* 2: 处理完毕:已提取
|
|
|
* 3: 处理失败:识别失败、提取失败
|
|
|
* 4: 已核实
|
|
|
*/
|
|
|
private String processStatus;
|
|
|
|
|
|
public CaseEvidenceDetailDTO() {
|
|
|
}
|
|
|
|
|
|
public CaseEvidenceDetailDTO(CaseEvidence caseEvidence, List<EvidenceFileDTO> fileList) {
|
|
|
if (Objects.nonNull(caseEvidence)){
|
|
|
this.id = caseEvidence.getId();
|
|
|
this.evidenceName = caseEvidence.getEvidenceName();
|
|
|
this.evidenceType = caseEvidence.getEvidenceType();
|
|
|
this.updateTime = caseEvidence.getUpdateTime();
|
|
|
this.provider = caseEvidence.getProvider();
|
|
|
this.partyA = caseEvidence.getPartyA();
|
|
|
this.partyB = caseEvidence.getPartyB();
|
|
|
this.processStatus = caseEvidence.getProcessStatus();
|
|
|
}
|
|
|
this.fileList = fileList;
|
|
|
}
|
|
|
|
|
|
public void setContentTypeValue(List<RecordFileDTO> recordFileDTOS){
|
|
|
if (CollUtil.isEmpty(this.fileList)){
|
|
|
this.contentType = "1";
|
|
|
return;
|
|
|
}
|
|
|
for (EvidenceFileDTO evidenceFileDTO : fileList) {
|
|
|
for (RecordFileDTO recordFileDTO : recordFileDTOS) {
|
|
|
if (recordFileDTO.getFileId().equals(evidenceFileDTO.getFileId()) && StrUtil.isNotEmpty(recordFileDTO.getOcrId())){
|
|
|
this.contentType = "2";
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
this.contentType = "1";
|
|
|
}
|
|
|
|
|
|
public void setPropertyValue(List<FileEvidenceProperty> fileEvidenceProperties){
|
|
|
}
|
|
|
|
|
|
public CaseEvidence toCaseEvidence(){
|
|
|
|
|
|
CaseEvidence caseEvidence = new CaseEvidence();
|
|
|
caseEvidence.setId(this.id);
|
|
|
caseEvidence.setCaseId(this.caseId);
|
|
|
caseEvidence.setEvidenceName(this.evidenceName);
|
|
|
caseEvidence.setEvidenceType(this.evidenceType);
|
|
|
caseEvidence.setDirectoryId(this.directoryId);
|
|
|
caseEvidence.setProvider(this.provider);
|
|
|
caseEvidence.setPartyA(this.partyA);
|
|
|
caseEvidence.setPartyB(this.partyB);
|
|
|
caseEvidence.setProperty(this.property);
|
|
|
return caseEvidence;
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置文件格式 如果目录等级为1、2,则目录格式未文件。 如果目录等级为3,则文件格式为文件夹
|
|
|
* @param directory
|
|
|
*/
|
|
|
public void setEvidenceFormatValue(EvidenceDirectoryDTO directory,boolean ifFile){
|
|
|
|
|
|
if (ifFile){
|
|
|
this.evidenceFormat = CollUtil.getFirst(this.fileList).getFileType();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (null == directory){
|
|
|
return;
|
|
|
}
|
|
|
if (1 == directory.getLevel() || 2 == directory.getLevel()){
|
|
|
if (CollUtil.isNotEmpty(this.fileList)){
|
|
|
this.evidenceFormat = CollUtil.getFirst(this.fileList).getFileType();
|
|
|
}else {
|
|
|
this.evidenceFormat = "文件夹";
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if (3 == directory.getLevel() && CollUtil.isNotEmpty(this.fileList)){
|
|
|
this.evidenceFormat = "文件夹";
|
|
|
}
|
|
|
}
|
|
|
}
|