1、数据查询任务时,处理节点uuid重复的情况

This commit is contained in:
2026-02-28 09:43:14 +08:00
parent 97b37473d8
commit f8eccea633

View File

@@ -1803,7 +1803,12 @@ public class TaskServiceImpl implements ITaskService {
return SdmResponse.success(jsonObject);
}
List<ProjectNodePo> allNodeList = projectMapper.getNodeListByNodeIdList(allNodeIdList);
Map<String, ProjectNodePo> nodeMap = allNodeList.stream().collect(Collectors.toMap(ProjectNodePo::getUuid,Function.identity()));
Map<String, ProjectNodePo> nodeMap = allNodeList.stream()
.collect(Collectors.toMap(
ProjectNodePo::getUuid, // key取uuid
Function.identity(), // value取对象本身
(existing, replacement) -> existing // 重复时保留已存在的(第一个)元素
));
// 设置仿真负责人
List<String> taskIdList = taskVoList.stream().map(SpdmAnalysisTaskVo::getUuid).toList();
List<TaskNodeMemberPo> taskNodeMemberPoList = projectMapper.queryTaskNodeMembersByNodeIdList(taskIdList);