1、查询算例树接口中返回任务的拓展属性
This commit is contained in:
@@ -35,6 +35,7 @@ import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.data.SimulationTaskResultCurveResp;
|
||||
import com.sdm.common.entity.resp.flowable.ProcessInstanceDetailResponse;
|
||||
import com.sdm.common.entity.resp.flowable.ProcessInstanceResp;
|
||||
import com.sdm.common.entity.resp.project.TaskNodeExtraPo;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.capability.SimulationFlowFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.capability.SimulationReportFeignClientImpl;
|
||||
@@ -221,7 +222,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
return currentNodeDepth;
|
||||
}
|
||||
|
||||
private void generateTaskTree(ProjectNodePo projectNodePo, List<ProjectNodePo> taskTreeNodeList, List<TaskNodePo> taskTreeTaskList, List<TaskNodeTag> taskTreeTagMap, String firstNodeTag, String lastNodeTag, Map<String, String> taskTreeNodeTypeTagMap, List<RunNodePo> taskTreeRunList) {
|
||||
private void generateTaskTree(ProjectNodePo projectNodePo, List<ProjectNodePo> taskTreeNodeList, List<TaskNodePo> taskTreeTaskList, List<TaskNodeTag> taskTreeTagMap, String firstNodeTag, String lastNodeTag, Map<String, String> taskTreeNodeTypeTagMap, List<RunNodePo> taskTreeRunList,Map<String,List<TaskNodeExtraPo>> taskExtraMap) {
|
||||
String currentNodeType = projectNodePo.getNodeType();
|
||||
String currentTag = taskTreeNodeTypeTagMap.get(currentNodeType);
|
||||
TaskNodeTag nextNodeTag = getNextNodeTag(currentTag, taskTreeTagMap);
|
||||
@@ -379,7 +380,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
if (CollectionUtils.isNotEmpty(sameTypeNodeList)) {
|
||||
// 递归
|
||||
for (ProjectNodePo nodePo : sameTypeNodeList) {
|
||||
generateTaskTree(nodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList);
|
||||
generateTaskTree(nodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList,taskExtraMap);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(sameTypeNodeList)) {
|
||||
children.addAll(sameTypeNodeList);
|
||||
@@ -395,7 +396,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
if (CollectionUtils.isNotEmpty(childrenTypeNodeList)) {
|
||||
// 递归
|
||||
for (ProjectNodePo nodePo : childrenTypeNodeList) {
|
||||
generateTaskTree(nodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList);
|
||||
generateTaskTree(nodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList,taskExtraMap);
|
||||
}
|
||||
children.addAll(childrenTypeNodeList);
|
||||
}
|
||||
@@ -419,7 +420,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
if (CollectionUtils.isNotEmpty(otherChildrenNodeList)) {
|
||||
// 递归
|
||||
for (ProjectNodePo nodePo : otherChildrenNodeList) {
|
||||
generateTaskTree(nodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList);
|
||||
generateTaskTree(nodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList,taskExtraMap);
|
||||
}
|
||||
children.addAll(otherChildrenNodeList);
|
||||
}
|
||||
@@ -431,6 +432,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
task.setNodeCode(task.getTaskCode());
|
||||
task.setSection(task.getSectionName());
|
||||
task.setGroup(task.getGroupName());
|
||||
task.setExtras(taskExtraMap.get(task.getUuid()));
|
||||
});
|
||||
children.addAll(currentNodeAssociatedTaskList);
|
||||
}
|
||||
@@ -576,12 +578,16 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
}
|
||||
List<RunNodePo> taskTreeRunList = new ArrayList<>();
|
||||
List<TaskNodePo> taskTreeTaskList = mapper.getTaskListByTag(taskTreeReq);
|
||||
Map<String,List<TaskNodeExtraPo>> taskExtraMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(taskTreeTaskList)) {
|
||||
taskTreeTaskList.forEach(task -> task.setNodeType(NodeTypeEnum.TASK.getValue()));
|
||||
taskTreeRunList = mapper.getRunListByNodeIdList(taskTreeTaskList.stream().map(TaskNodePo::getUuid).toList());
|
||||
if (CollectionUtils.isNotEmpty(taskTreeRunList)) {
|
||||
taskTreeRunList.forEach(run -> run.setNodeType(NodeTypeEnum.RUN.getValue()));
|
||||
}
|
||||
taskExtraMap = Optional.ofNullable(taskMapper.getTaskExtraList(
|
||||
taskTreeTaskList.stream().map(TaskNodePo::getUuid).toList()
|
||||
)).orElse(Collections.emptyList()).stream().collect(Collectors.groupingBy(TaskNodeExtraPo::getTaskId));
|
||||
}
|
||||
List<TaskNodeTag> taskTreeTagMap = req.getTagMap();
|
||||
String firstNodeTag = taskTreeTagMap.get(0).getValue();
|
||||
@@ -604,7 +610,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
|
||||
String realFirstTaskNodeType = taskTreeTagNodeTypeMap.get(realFirstTaskNodeTag.getValue());
|
||||
List<ProjectNodePo> realTopProjectNodeList = taskTreeNodeList.stream().filter(node -> node.getNodeType().equals(realFirstTaskNodeType)).toList();
|
||||
for (ProjectNodePo projectNodePo : realTopProjectNodeList) {
|
||||
generateTaskTree(projectNodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList);
|
||||
generateTaskTree(projectNodePo, taskTreeNodeList, taskTreeTaskList, taskTreeTagMap, firstNodeTag, lastNodeTag, taskTreeNodeTypeTagMap, taskTreeRunList,taskExtraMap);
|
||||
}
|
||||
// 对工位进行排序,-M工位顺序排第一个
|
||||
if (lyricFlag == 1) {
|
||||
|
||||
Reference in New Issue
Block a user