|
|
|
@ -21,6 +21,7 @@ import com.supervision.minio.service.MinioService;
|
|
|
|
|
import com.supervision.neo4j.service.Neo4jService;
|
|
|
|
|
import com.supervision.police.domain.*;
|
|
|
|
|
import com.supervision.police.dto.NoteRecordDTO;
|
|
|
|
|
import com.supervision.police.dto.NoteRecordFileDTO;
|
|
|
|
|
import com.supervision.police.vo.NoteRecordReqVO;
|
|
|
|
|
import com.supervision.police.dto.NoteRecordDetailDTO;
|
|
|
|
|
import com.supervision.police.mapper.NoteRecordSplitMapper;
|
|
|
|
@ -86,7 +87,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
public String uploadRecords(NoteRecordReqVO records) throws IOException {
|
|
|
|
|
int i;
|
|
|
|
|
ModelCase modelCase = modelCaseService.getById(records.getCaseId());
|
|
|
|
|
if (StringUtils.isEmpty(modelCase.getCaseNo())){
|
|
|
|
|
if (StringUtils.isEmpty(modelCase.getCaseNo())) {
|
|
|
|
|
throw new BusinessException("案件编号不能为空");
|
|
|
|
|
}
|
|
|
|
|
NoteRecord record = records.toNoteRecord();
|
|
|
|
@ -111,7 +112,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
}
|
|
|
|
|
String context = WordReadUtil.readWord(inputStream);
|
|
|
|
|
List<QARecordNodeDTO> qaList = RecordRegexUtil.recordRegex(context, record.getName());
|
|
|
|
|
log.info("拆分问答对:{}",qaList.size());
|
|
|
|
|
log.info("拆分问答对:{}", qaList.size());
|
|
|
|
|
List<NoteRecordSplit> splitList = new ArrayList<>();
|
|
|
|
|
for (QARecordNodeDTO qa : qaList) {
|
|
|
|
|
try {
|
|
|
|
@ -152,7 +153,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
* @param recordId
|
|
|
|
|
* @return 没有执行过, 返回true, 没有执行过, 返回false
|
|
|
|
|
*/
|
|
|
|
|
private boolean saveRecordProcessTask(String caseId, String recordId,Integer splitSize) {
|
|
|
|
|
private boolean saveRecordProcessTask(String caseId, String recordId, Integer splitSize) {
|
|
|
|
|
// 首先查询是否存在任务,如果不存在,就新建
|
|
|
|
|
Optional<CaseTaskRecord> caseTaskRecordOpt = caseTaskRecordService.lambdaQuery()
|
|
|
|
|
.eq(CaseTaskRecord::getCaseId, caseId).eq(CaseTaskRecord::getRecordId, recordId).oneOpt();
|
|
|
|
@ -172,7 +173,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
newCaseTaskRecord.setSubmitTime(LocalDateTime.now());
|
|
|
|
|
caseTaskRecordService.save(newCaseTaskRecord);
|
|
|
|
|
return false;
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
// 如果存在,则校验时间是否已经超过1天,如果超过了1天还没有执行完毕,就重新提交这个任务
|
|
|
|
|
CaseTaskRecord caseTaskRecord = caseTaskRecordOpt.get();
|
|
|
|
|
// 如果未执行,则提交执行
|
|
|
|
@ -241,7 +242,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
// 从key中获取noteRecordDetailDTO需要的数据
|
|
|
|
|
List<NoteRecordDetailDTO> noteRecordDetailDTOS = nameMap.get(name);
|
|
|
|
|
NoteRecordDetailDTO first = CollUtil.getFirst(noteRecordDetailDTOS);
|
|
|
|
|
if (Objects.nonNull(first)){
|
|
|
|
|
if (Objects.nonNull(first)) {
|
|
|
|
|
noteRecordDetailDTO.setPersonId(first.getPersonId());
|
|
|
|
|
noteRecordDetailDTO.setRole(first.getRole());
|
|
|
|
|
noteRecordDetailDTO.setRoleName(caseRoleDicMap.get(first.getRole()));
|
|
|
|
@ -251,6 +252,9 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
int fileCount = 0;
|
|
|
|
|
for (NoteRecordDetailDTO recordDetailDTO : noteRecordDetailDTOS) {
|
|
|
|
|
fileCount = fileCount + recordDetailDTO.getFileList().size();
|
|
|
|
|
// 获取文件的文件名称
|
|
|
|
|
Set<String> fileNameSet = recordDetailDTO.getFileList().stream().map(NoteRecordFileDTO::getFileName).collect(Collectors.toSet());
|
|
|
|
|
recordDetailDTO.setConfessionMaterial(CollUtil.join(fileNameSet, ";"));
|
|
|
|
|
CaseTaskRecord caseTaskRecord = taskRecordMap.get(recordDetailDTO.getId());
|
|
|
|
|
if (ObjectUtil.isNotEmpty(caseTaskRecord)) {
|
|
|
|
|
if (caseTaskRecord.getStatus() == 2) {
|
|
|
|
@ -271,7 +275,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
}
|
|
|
|
|
noteRecordDetailDTO.setChildren(noteRecordDetailDTOS);
|
|
|
|
|
// 统计所有children的文件数量
|
|
|
|
|
noteRecordDetailDTO.setConfessionMaterial(fileCount);
|
|
|
|
|
noteRecordDetailDTO.setConfessionMaterial(String.valueOf(fileCount));
|
|
|
|
|
res.add(noteRecordDetailDTO);
|
|
|
|
|
}
|
|
|
|
|
List<NoteRecordDetailDTO> pager = ListUtils.Pager(size, page, res);
|
|
|
|
|