|
|
|
@ -26,10 +26,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static com.supervision.common.constant.NotePromptConstants.TYPE_GRAPH_REASONING;
|
|
|
|
|
import static com.supervision.common.constant.NotePromptConstants.TYPE_STRUCTURAL_REASONING;
|
|
|
|
@ -210,7 +208,35 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
|
|
|
|
|
@Override
|
|
|
|
|
public IPage<TaskInfoDTO> queryTaskList(TaskInfoReqVO taskInfo, Integer page, Integer size) {
|
|
|
|
|
taskInfo.checkSorted();
|
|
|
|
|
return super.getBaseMapper().queryTaskList(taskInfo, Page.of(page, size));
|
|
|
|
|
IPage<TaskInfoDTO> iPage = super.getBaseMapper().queryTaskList(taskInfo, Page.of(page, size));
|
|
|
|
|
|
|
|
|
|
if (iPage.getRecords().isEmpty()){
|
|
|
|
|
return iPage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> caseIds = iPage.getRecords().stream()
|
|
|
|
|
.filter(taskInfoDTO -> StrUtil.isEmpty(taskInfoDTO.getCaseName())
|
|
|
|
|
&& StrUtil.isNotEmpty(taskInfoDTO.getCaseId()))
|
|
|
|
|
.flatMap(taskInfoDTO -> Arrays.stream(taskInfoDTO.getCaseId().split(","))).distinct().toList();
|
|
|
|
|
|
|
|
|
|
Map<String, String> caseNameMap = CollUtil.isEmpty(caseIds) ? new HashMap<>() : modelCaseService.listByIds(caseIds).stream().collect(Collectors.toMap(ModelCase::getId, ModelCase::getCaseName));
|
|
|
|
|
return iPage.convert(taskInfoDTO -> {
|
|
|
|
|
if (StrUtil.isEmpty(taskInfoDTO.getCaseName()) && StrUtil.isNotEmpty(taskInfoDTO.getCaseId())){
|
|
|
|
|
String caseNames = Arrays.stream(taskInfoDTO.getCaseId().split(","))
|
|
|
|
|
.map(caseId -> caseNameMap.getOrDefault(caseId, "")).filter(StrUtil::isNotEmpty).distinct().collect(Collectors.joining(","));
|
|
|
|
|
taskInfoDTO.setCaseName(caseNames);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(taskInfoDTO.getCaseName()) && StrUtil.equals(taskInfoDTO.getTaskType(), "0")){
|
|
|
|
|
// 全部案件
|
|
|
|
|
taskInfoDTO.setCaseName("全部");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(taskInfoDTO.getPromptName())){
|
|
|
|
|
taskInfoDTO.setPromptName("全部");
|
|
|
|
|
}
|
|
|
|
|
return taskInfoDTO;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|