|
|
@ -22,9 +22,8 @@ import com.supervision.minio.service.MinioService;
|
|
|
|
import com.supervision.neo4j.service.Neo4jService;
|
|
|
|
import com.supervision.neo4j.service.Neo4jService;
|
|
|
|
import com.supervision.police.domain.*;
|
|
|
|
import com.supervision.police.domain.*;
|
|
|
|
import com.supervision.police.dto.NoteRecordDTO;
|
|
|
|
import com.supervision.police.dto.NoteRecordDTO;
|
|
|
|
|
|
|
|
import com.supervision.police.vo.NoteRecordReqVO;
|
|
|
|
import com.supervision.police.dto.NoteRecordDetailDTO;
|
|
|
|
import com.supervision.police.dto.NoteRecordDetailDTO;
|
|
|
|
import com.supervision.police.mapper.ModelAtomicResultMapper;
|
|
|
|
|
|
|
|
import com.supervision.police.mapper.NoteRecordMapper;
|
|
|
|
|
|
|
|
import com.supervision.police.mapper.NoteRecordSplitMapper;
|
|
|
|
import com.supervision.police.mapper.NoteRecordSplitMapper;
|
|
|
|
import com.supervision.police.service.*;
|
|
|
|
import com.supervision.police.service.*;
|
|
|
|
import com.supervision.utils.RecordRegexUtil;
|
|
|
|
import com.supervision.utils.RecordRegexUtil;
|
|
|
@ -47,7 +46,7 @@ import java.util.stream.Collectors;
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMapper, NoteRecordSplit> implements NoteRecordSplitService {
|
|
|
|
public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMapper, NoteRecordSplit> implements NoteRecordSplitService {
|
|
|
|
|
|
|
|
|
|
|
|
private final NoteRecordMapper noteRecordMapper;
|
|
|
|
private final NoteRecordService noteRecordService;
|
|
|
|
|
|
|
|
|
|
|
|
private final MinioService minioService;
|
|
|
|
private final MinioService minioService;
|
|
|
|
|
|
|
|
|
|
|
@ -56,7 +55,6 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private NoteRecordSplitService noteRecordSplitService;
|
|
|
|
private NoteRecordSplitService noteRecordSplitService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final CaseTaskRecordService caseTaskRecordService;
|
|
|
|
private final CaseTaskRecordService caseTaskRecordService;
|
|
|
|
|
|
|
|
|
|
|
|
private final TripleInfoService tripleInfoService;
|
|
|
|
private final TripleInfoService tripleInfoService;
|
|
|
@ -84,7 +82,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional(transactionManager = "dataSourceTransactionManager", rollbackFor = Exception.class)
|
|
|
|
@Transactional(transactionManager = "dataSourceTransactionManager", rollbackFor = Exception.class)
|
|
|
|
public String uploadRecords(NoteRecordDTO records) throws IOException {
|
|
|
|
public String uploadRecords(NoteRecordReqVO records) throws IOException {
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
ModelCase modelCase = modelCaseService.getById(records.getCaseId());
|
|
|
|
ModelCase modelCase = modelCaseService.getById(records.getCaseId());
|
|
|
|
if (StringUtils.isEmpty(modelCase.getCaseNo())){
|
|
|
|
if (StringUtils.isEmpty(modelCase.getCaseNo())){
|
|
|
@ -92,9 +90,9 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
NoteRecord record = records.toNoteRecord();
|
|
|
|
NoteRecord record = records.toNoteRecord();
|
|
|
|
if (StringUtils.isEmpty(records.getId())) {
|
|
|
|
if (StringUtils.isEmpty(records.getId())) {
|
|
|
|
i = noteRecordMapper.insert(record);
|
|
|
|
i = noteRecordService.getBaseMapper().insert(record);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
i = noteRecordMapper.updateById(record);
|
|
|
|
i = noteRecordService.getBaseMapper().updateById(record);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//所有对话类型
|
|
|
|
//所有对话类型
|
|
|
|
List<ModelRecordType> allTypeList = modelRecordTypeService.lambdaQuery().list();
|
|
|
|
List<ModelRecordType> allTypeList = modelRecordTypeService.lambdaQuery().list();
|
|
|
@ -218,26 +216,21 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> queryRecords(NoteRecord noteRecords, Integer page, Integer size) {
|
|
|
|
public Map<String, Object> queryRecords(NoteRecord noteRecords, Integer page, Integer size) {
|
|
|
|
LambdaQueryWrapper<NoteRecord> wrapper = Wrappers.lambdaQuery(NoteRecord.class)
|
|
|
|
|
|
|
|
.like(StringUtils.isNotEmpty(noteRecords.getName()), NoteRecord::getName, noteRecords.getName())
|
|
|
|
|
|
|
|
.eq(NoteRecord::getCaseId, noteRecords.getCaseId())
|
|
|
|
|
|
|
|
.eq(NoteRecord::getDataStatus, "1");
|
|
|
|
|
|
|
|
List<NoteRecord> list = noteRecordMapper.selectList(wrapper);
|
|
|
|
|
|
|
|
List<String> fileIdList = list.stream().map(NoteRecord::getFileIds).filter(StringUtils::isNotEmpty)
|
|
|
|
|
|
|
|
.flatMap(s -> Arrays.stream(s.split(","))).distinct().toList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<NoteRecordDTO> noteRecordDTOList = noteRecordService.selectNoteRecordDTOList(noteRecords);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询关联角色字典
|
|
|
|
Map<String, String> caseRoleDicMap = comDictionaryService.getDictionaryMap("case_role");
|
|
|
|
Map<String, String> caseRoleDicMap = comDictionaryService.getDictionaryMap("case_role");
|
|
|
|
Map<String, CasePerson> casePersonMap = casePersonService.list(new LambdaQueryWrapper<CasePerson>().eq(CasePerson::getCaseId, noteRecords.getCaseId()))
|
|
|
|
|
|
|
|
.stream().collect(Collectors.toMap(CasePerson::getId, v -> v));
|
|
|
|
// 查询关联文件数据
|
|
|
|
|
|
|
|
List<String> fileIdList = noteRecordDTOList.stream().map(NoteRecordDTO::getFileIds).filter(StringUtils::isNotEmpty)
|
|
|
|
|
|
|
|
.flatMap(s -> Arrays.stream(s.split(","))).distinct().toList();
|
|
|
|
Map<String, MinioFile> fileMap = minioService.listMinioFile(fileIdList).stream().collect(Collectors.toMap(MinioFile::getId, Function.identity()));
|
|
|
|
Map<String, MinioFile> fileMap = minioService.listMinioFile(fileIdList).stream().collect(Collectors.toMap(MinioFile::getId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
|
|
// LinkedHashMap 保障顺序
|
|
|
|
// LinkedHashMap 保障顺序
|
|
|
|
Map<String, List<NoteRecordDetailDTO>> nameMap = list.stream().filter(item -> StringUtils.isNotBlank(item.getName())).map(item -> {
|
|
|
|
Map<String, List<NoteRecordDetailDTO>> nameMap = noteRecordDTOList.stream().filter(item -> StringUtils.isNotBlank(item.getName())).map(item -> {
|
|
|
|
NoteRecordDetailDTO noteRecordDetailDTO = new NoteRecordDetailDTO(item, fileMap);
|
|
|
|
NoteRecordDetailDTO noteRecordDetailDTO = new NoteRecordDetailDTO(item, fileMap);
|
|
|
|
noteRecordDetailDTO.setRoleName(caseRoleDicMap.get(item.getRole()));
|
|
|
|
noteRecordDetailDTO.setRoleName(caseRoleDicMap.get(item.getRole()));
|
|
|
|
if (Objects.nonNull(casePersonMap.get(item.getCasePersonId()))){
|
|
|
|
|
|
|
|
noteRecordDetailDTO.setPersonIdCard(casePersonMap.get(item.getCasePersonId()).getIdCard());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return noteRecordDetailDTO;
|
|
|
|
return noteRecordDetailDTO;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect(Collectors.groupingBy(NoteRecordDetailDTO::getName, LinkedHashMap::new, Collectors.toList()));
|
|
|
|
.collect(Collectors.groupingBy(NoteRecordDetailDTO::getName, LinkedHashMap::new, Collectors.toList()));
|
|
|
@ -250,6 +243,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
NoteRecordDetailDTO noteRecordDetailDTO = new NoteRecordDetailDTO();
|
|
|
|
NoteRecordDetailDTO noteRecordDetailDTO = new NoteRecordDetailDTO();
|
|
|
|
noteRecordDetailDTO.setName(name);
|
|
|
|
noteRecordDetailDTO.setName(name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 从key中获取noteRecordDetailDTO需要的数据
|
|
|
|
List<NoteRecordDetailDTO> noteRecordDetailDTOS = nameMap.get(name);
|
|
|
|
List<NoteRecordDetailDTO> noteRecordDetailDTOS = nameMap.get(name);
|
|
|
|
NoteRecordDetailDTO first = CollUtil.getFirst(noteRecordDetailDTOS);
|
|
|
|
NoteRecordDetailDTO first = CollUtil.getFirst(noteRecordDetailDTOS);
|
|
|
|
if (Objects.nonNull(first)){
|
|
|
|
if (Objects.nonNull(first)){
|
|
|
@ -292,7 +286,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional(transactionManager = "dataSourceTransactionManager", rollbackFor = Exception.class, noRollbackFor = BusinessException.class)
|
|
|
|
@Transactional(transactionManager = "dataSourceTransactionManager", rollbackFor = Exception.class, noRollbackFor = BusinessException.class)
|
|
|
|
public void delRecords(String id) {
|
|
|
|
public void delRecords(String id) {
|
|
|
|
NoteRecord noteRecord = noteRecordMapper.selectById(id);
|
|
|
|
NoteRecord noteRecord = noteRecordService.getBaseMapper().selectById(id);
|
|
|
|
// 去掉逻辑删除,直接删除
|
|
|
|
// 去掉逻辑删除,直接删除
|
|
|
|
// noteRecord.setDataStatus(StringUtils.getUUID());
|
|
|
|
// noteRecord.setDataStatus(StringUtils.getUUID());
|
|
|
|
// noteRecordMapper.updateById(noteRecord);
|
|
|
|
// noteRecordMapper.updateById(noteRecord);
|
|
|
@ -312,7 +306,7 @@ public class NoteRecordSplitServiceImpl extends ServiceImpl<NoteRecordSplitMappe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 去掉逻辑删除,直接删除
|
|
|
|
// 去掉逻辑删除,直接删除
|
|
|
|
noteRecordMapper.deleteById(id);
|
|
|
|
noteRecordService.getBaseMapper().deleteById(id);
|
|
|
|
// 删除拆分的笔录
|
|
|
|
// 删除拆分的笔录
|
|
|
|
noteRecordSplitService.lambdaUpdate().eq(NoteRecordSplit::getNoteRecordId, id).remove();
|
|
|
|
noteRecordSplitService.lambdaUpdate().eq(NoteRecordSplit::getNoteRecordId, id).remove();
|
|
|
|
// task也删除掉
|
|
|
|
// task也删除掉
|
|
|
|