Commit 8331bd3c by guominglei

过滤重跑节点

parent f0934360
......@@ -510,8 +510,10 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if (!"1".equals(runInfo.getRunState())) {//如果不是只重跑当前节点
//查询依赖本节点的节点,并添加到集合中
List<Integer> subNodeIdList = nodeDependencyMapper.findSubNodeList(node.getNodeId());
Set<Integer> nodeIdSet = new HashSet<>();
nodeIdSet.add(node.getNodeId());
if (subNodeIdList != null && subNodeIdList.size() > 0){
addDependNode(runInfo.getRunId(), triggerTime, waitingTaskList, subNodeIdList, userName);
addDependNode(runInfo.getRunId(), triggerTime, waitingTaskList, subNodeIdList, userName, nodeIdSet);
}
}
......@@ -619,7 +621,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
}
private void addDependNode(String runId, Long triggerTime, List<WaitingTask> waitingTaskList, List<Integer> subNodeIdList, String userName) {
private void addDependNode(String runId, Long triggerTime, List<WaitingTask> waitingTaskList, List<Integer> subNodeIdList, String userName, Set<Integer> nodeIdSet) {
subNodeIdList.forEach(childNodeId -> {
JobTaskRunLog jobTaskRunLog = jobTaskRunLogMapper.findByRunIdAndNodeId(runId, childNodeId);
WaitingTask waitingTask = new WaitingTask();
......@@ -635,11 +637,13 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if (dependNodeIdList != null && dependNodeIdList.size() > 0){
waitingTask.setNodeDepend(Joiner.on(",").join(dependNodeIdList));
}
if (nodeIdSet.add(childNodeId)){
waitingTaskList.add(waitingTask);
}
//查询依赖于当前节点的下级节点
List<Integer> childNodeIdList = nodeDependencyMapper.findSubNodeList(childNodeId);
if (childNodeIdList != null && childNodeIdList.size() > 0){
addDependNode(runId, triggerTime, waitingTaskList, childNodeIdList, userName);
addDependNode(runId, triggerTime, waitingTaskList, childNodeIdList, userName, nodeIdSet);
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment