1. 修复bug
parent
77800c8f54
commit
485744c598
@ -0,0 +1,90 @@
|
||||
package com.supervision.police.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.supervision.minio.domain.MinioFile;
|
||||
import com.supervision.police.domain.NoteRecord;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
public class NoteRecordDetailDTO {
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private String caseId;
|
||||
|
||||
/**
|
||||
* 笔录名称
|
||||
*/
|
||||
private String recordName;
|
||||
|
||||
/**
|
||||
* 笔录文件信息
|
||||
*/
|
||||
private List<NoteRecordFileDTO> fileList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* 供述材料
|
||||
*/
|
||||
private Integer confessionMaterial;
|
||||
|
||||
/**
|
||||
* 询问人
|
||||
*/
|
||||
private String lawAsker;
|
||||
|
||||
/**
|
||||
* 供述开始时间
|
||||
*/
|
||||
private String confessionStartTime;
|
||||
|
||||
/**
|
||||
* 供述结束时间
|
||||
*/
|
||||
private String confessionEndTime;
|
||||
|
||||
private List<NoteRecordDetailDTO> children = new ArrayList<>();
|
||||
|
||||
public NoteRecordDetailDTO() {
|
||||
}
|
||||
|
||||
public NoteRecordDetailDTO(NoteRecord noteRecord, Map<String, MinioFile> fileMap) {
|
||||
if (Objects.isNull(noteRecord)){
|
||||
return;
|
||||
}
|
||||
this.id = noteRecord.getId();
|
||||
this.caseId = noteRecord.getCaseId();
|
||||
this.recordName = noteRecord.getRecordName();
|
||||
this.name = noteRecord.getName();
|
||||
this.role = noteRecord.getRole();
|
||||
this.confessionMaterial = noteRecord.getConfessionMaterial();
|
||||
this.lawAsker = noteRecord.getLawAsker();
|
||||
this.confessionStartTime = noteRecord.getConfessionStartTime();
|
||||
this.confessionEndTime = noteRecord.getConfessionEndTime();
|
||||
if (StrUtil.isNotEmpty(noteRecord.getFileIds())){
|
||||
this.fileList = Arrays.stream(noteRecord.getFileIds().split(",")).map(fileId->{
|
||||
MinioFile minioFile = fileMap.get(fileId);
|
||||
if (Objects.isNull(minioFile)){
|
||||
return null;
|
||||
}
|
||||
return new NoteRecordFileDTO(this.id,minioFile);
|
||||
}).filter(Objects::nonNull).toList();
|
||||
}else {
|
||||
this.fileList = new ArrayList<>(1);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.supervision.police.dto;
|
||||
|
||||
import com.supervision.minio.domain.MinioFile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
public class NoteRecordFileDTO {
|
||||
|
||||
@Schema(description = "笔录id")
|
||||
private String noteRecordId;
|
||||
|
||||
@Schema(description = "文件id集合")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "文件类型")
|
||||
private String fileType;
|
||||
|
||||
public NoteRecordFileDTO() {
|
||||
}
|
||||
|
||||
public NoteRecordFileDTO(String noteRecordId,MinioFile minioFile) {
|
||||
this.noteRecordId = noteRecordId;
|
||||
if (Objects.isNull(minioFile)){
|
||||
return;
|
||||
}
|
||||
this.fileId = minioFile.getId();
|
||||
this.fileName = minioFile.getFilename();
|
||||
this.fileType = minioFile.getFileType();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue