You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fu-hsi-service/src/main/java/com/supervision/police/dto/CaseEvidenceDetailDTO.java

92 lines
3.0 KiB
Java

package com.supervision.police.dto;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.supervision.police.domain.CaseEvidence;
import com.supervision.police.domain.FileEvidenceProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
10 months ago
@Schema(description = "案件证据类型描述")
private String evidenceTypeDesc;
@Schema(description = "证据提供人")
private String provider;
@Schema(description = "甲方")
private String partyA;
@Schema(description = "乙方")
private String partyB;
@Schema(description = "案件证据文件信息列表")
private List<EvidenceFileDTO> fileList;
@Schema(description = "最近时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime updateTime;
@Schema(description = "案件证据属性")
private Map<String,String> property= new HashMap<>();
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();
10 months ago
this.provider = caseEvidence.getProvider();
this.partyA = caseEvidence.getPartyA();
this.partyB = caseEvidence.getPartyB();
}
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){
for (FileEvidenceProperty fileEvidenceProperty : fileEvidenceProperties) {
property.put(fileEvidenceProperty.getPropertyName(),fileEvidenceProperty.getPropertyValue());
}
}
}