Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
bf8f12ff
Commit
bf8f12ff
authored
Jun 02, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
776a915e
6fbd5c6f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+27
-9
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
bf8f12ff
...
...
@@ -503,11 +503,6 @@ public class ApiFlowServiceImpl implements ApiFlowService {
waitingTask
.
setScheduleType
(
ScheduleTypeEnum
.
REPEAT
.
getCode
());
waitingTask
.
setOperator
(
userName
);
//查询当前节点的依赖节点
// if (dependNodeList != null && dependNodeList.size() > 0){
// waitingTask.setNodeDepend(Joiner.on(",").join(dependNodeList));
// }
List
<
WaitingTask
>
waitingTaskList
=
new
ArrayList
<>();
waitingTaskList
.
add
(
waitingTask
);
...
...
@@ -517,9 +512,26 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//查询依赖本节点的节点,并添加到集合中
List
<
Integer
>
subNodeIdList
=
nodeDependencyMapper
.
findSubNodeList
(
node
.
getNodeId
());
Set
<
Integer
>
nodeIdSet
=
new
HashSet
<>();
Set
<
Integer
>
runNodeIdSet
=
new
HashSet
<>();
runNodeIdSet
.
add
(
node
.
getNodeId
());
nodeIdSet
.
add
(
node
.
getNodeId
());
//获取全部的需要重跑的节点
if
(
subNodeIdList
!=
null
&&
subNodeIdList
.
size
()
>
0
){
Queue
<
Integer
>
queue
=
new
LinkedList
<>();
subNodeIdList
.
forEach
(
nodeId
->
{
queue
.
offer
(
nodeId
);
runNodeIdSet
.
add
(
nodeId
);
});
while
(!
queue
.
isEmpty
()){
subNodeIdList
=
nodeDependencyMapper
.
findSubNodeList
(
queue
.
poll
());
if
(
subNodeIdList
!=
null
&&
subNodeIdList
.
size
()
>
0
){
addDependNode
(
runInfo
.
getRunId
(),
triggerTime
,
waitingTaskList
,
subNodeIdList
,
userName
,
nodeIdSet
);
subNodeIdList
.
forEach
(
nodeId
->{
queue
.
offer
(
nodeId
);
runNodeIdSet
.
add
(
nodeId
);
});
}
}
addDependNode
(
runInfo
.
getRunId
(),
triggerTime
,
waitingTaskList
,
subNodeIdList
,
userName
,
nodeIdSet
,
runNodeIdSet
);
}
}
...
...
@@ -627,7 +639,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
}
}
private
void
addDependNode
(
String
runId
,
Long
triggerTime
,
List
<
WaitingTask
>
waitingTaskList
,
List
<
Integer
>
subNodeIdList
,
String
userName
,
Set
<
Integer
>
nodeIdSet
)
{
private
void
addDependNode
(
String
runId
,
Long
triggerTime
,
List
<
WaitingTask
>
waitingTaskList
,
List
<
Integer
>
subNodeIdList
,
String
userName
,
Set
<
Integer
>
nodeIdSet
,
Set
<
Integer
>
runNodeIdSet
)
{
subNodeIdList
.
forEach
(
childNodeId
->
{
JobTaskRunLog
jobTaskRunLog
=
jobTaskRunLogMapper
.
findByRunIdAndNodeId
(
runId
,
childNodeId
);
WaitingTask
waitingTask
=
new
WaitingTask
();
...
...
@@ -641,7 +653,13 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//查询当前节点的依赖节点
List
<
Integer
>
dependNodeIdList
=
nodeDependencyMapper
.
findDependIdByNodeId
(
jobTaskRunLog
.
getNodeId
());
if
(
dependNodeIdList
!=
null
&&
dependNodeIdList
.
size
()
>
0
){
waitingTask
.
setNodeDepend
(
Joiner
.
on
(
","
).
join
(
dependNodeIdList
));
List
<
Integer
>
realDependNodeIdList
=
new
ArrayList
<>();
for
(
Integer
dependNodeId
:
dependNodeIdList
)
{
if
(!
runNodeIdSet
.
add
(
dependNodeId
)){
realDependNodeIdList
.
add
(
dependNodeId
);
}
}
waitingTask
.
setNodeDepend
(
Joiner
.
on
(
","
).
join
(
realDependNodeIdList
));
}
if
(
nodeIdSet
.
add
(
childNodeId
)){
waitingTaskList
.
add
(
waitingTask
);
...
...
@@ -649,7 +667,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//查询依赖于当前节点的下级节点
List
<
Integer
>
childNodeIdList
=
nodeDependencyMapper
.
findSubNodeList
(
childNodeId
);
if
(
childNodeIdList
!=
null
&&
childNodeIdList
.
size
()
>
0
){
addDependNode
(
runId
,
triggerTime
,
waitingTaskList
,
childNodeIdList
,
userName
,
nodeIdSet
);
addDependNode
(
runId
,
triggerTime
,
waitingTaskList
,
childNodeIdList
,
userName
,
nodeIdSet
,
runNodeIdSet
);
}
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment