mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-12-27 18:46:00 +08:00
fix 修复 获取可驳回节点重复问题(感谢 搬砖的小庄)
This commit is contained in:
@@ -527,20 +527,22 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
|||||||
}
|
}
|
||||||
//获取可驳回的前置节点
|
//获取可驳回的前置节点
|
||||||
List<Node> nodes = nodeService.previousNodeList(task.getDefinitionId(), nowNodeCode);
|
List<Node> nodes = nodeService.previousNodeList(task.getDefinitionId(), nowNodeCode);
|
||||||
List<HisTask> taskList = hisTaskService.getByInsId(task.getInstanceId());
|
List<HisTask> hisTaskList = hisTaskService.getByInsId(task.getInstanceId());
|
||||||
|
|
||||||
Map<String, Node> nodeMap = StreamUtils.toIdentityMap(nodes, Node::getNodeCode);
|
Map<String, Node> nodeMap = StreamUtils.toIdentityMap(nodes, Node::getNodeCode);
|
||||||
|
Set<String> added = new HashSet<>();
|
||||||
List<Node> backNodeList = new ArrayList<>();
|
List<Node> backNodeList = new ArrayList<>();
|
||||||
for (HisTask hisTask : taskList) {
|
for (HisTask hisTask : hisTaskList) {
|
||||||
Node nodeValue = nodeMap.get(hisTask.getNodeCode());
|
Node nodeValue = nodeMap.get(hisTask.getNodeCode());
|
||||||
if (nodeValue != null) {
|
if (nodeValue != null
|
||||||
|
&& NodeType.BETWEEN.getKey().equals(nodeValue.getNodeType())
|
||||||
|
&& added.add(nodeValue.getNodeCode())) {
|
||||||
backNodeList.add(nodeValue);
|
backNodeList.add(nodeValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(backNodeList)) {
|
if (CollUtil.isNotEmpty(backNodeList)) {
|
||||||
List<Node> prefixOrSuffixNodes = StreamUtils.filter(backNodeList, e -> NodeType.BETWEEN.getKey().equals(e.getNodeType()));
|
Collections.reverse(backNodeList);
|
||||||
Collections.reverse(prefixOrSuffixNodes);
|
return backNodeList;
|
||||||
return prefixOrSuffixNodes;
|
|
||||||
}
|
}
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user