1、仿真执行中,只显示有任务的工位

This commit is contained in:
2026-03-05 15:10:12 +08:00
parent cd1fbd188a
commit e285c1ce6a
2 changed files with 19 additions and 0 deletions

View File

@@ -615,6 +615,9 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
} }
List<NodeAllBase> workspaceNodeList = children.stream().filter(node -> NodeTypeEnum.WORKSPACE.getValue().equals(node.getNodeType())).collect(Collectors.toList()); List<NodeAllBase> workspaceNodeList = children.stream().filter(node -> NodeTypeEnum.WORKSPACE.getValue().equals(node.getNodeType())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workspaceNodeList)) { if (CollectionUtils.isEmpty(workspaceNodeList)) {
for (NodeAllBase child : children) {
sortWorkspaceNode((ProjectNodePo) child);
}
return; return;
} }
// 对工位进行排序,-M工位顺序排第一个 // 对工位进行排序,-M工位顺序排第一个

View File

@@ -615,8 +615,24 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
} }
List<NodeAllBase> workspaceNodeList = children.stream().filter(node -> NodeTypeEnum.WORKSPACE.getValue().equals(node.getNodeType())).collect(Collectors.toList()); List<NodeAllBase> workspaceNodeList = children.stream().filter(node -> NodeTypeEnum.WORKSPACE.getValue().equals(node.getNodeType())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workspaceNodeList)) { if (CollectionUtils.isEmpty(workspaceNodeList)) {
for (NodeAllBase child : children) {
sortWorkspaceNode((ProjectNodePo) child);
}
return; return;
} }
// 只显示有任务的工位
Iterator<NodeAllBase> workspaceNodeListIterator = workspaceNodeList.iterator();
while (workspaceNodeListIterator.hasNext()) {
List<NodeAllBase> childrenNodeList = workspaceNodeListIterator.next().getChildren();
if (CollectionUtils.isEmpty(childrenNodeList)) {
workspaceNodeListIterator.remove();
continue;
}
List<NodeAllBase> taskNodeList = childrenNodeList.stream().filter(node -> NodeTypeEnum.TASK.getValue().equals(node.getNodeType())).toList();
if (CollectionUtils.isEmpty(taskNodeList)) {
workspaceNodeListIterator.remove();
}
}
// 对工位进行排序,-M工位顺序排第一个 // 对工位进行排序,-M工位顺序排第一个
workspaceNodeList = workspaceNodeList.stream().sorted(Comparator.comparing(NodeAllBase::getNodeCode)).collect(Collectors.toList()); workspaceNodeList = workspaceNodeList.stream().sorted(Comparator.comparing(NodeAllBase::getNodeCode)).collect(Collectors.toList());
NodeAllBase specialWorkspaceNode = workspaceNodeList.stream().filter(workspaceNode -> workspaceNode.getNodeCode().contains("-M")).findFirst().orElse(null); NodeAllBase specialWorkspaceNode = workspaceNodeList.stream().filter(workspaceNode -> workspaceNode.getNodeCode().contains("-M")).findFirst().orElse(null);