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
682d3166
Commit
682d3166
authored
Apr 30, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
7fde4806
d562c7bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+2
-2
StatusSnapshootThreadRunHelper.java
...om/byit/thread/helper/StatusSnapshootThreadRunHelper.java
+16
-3
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
682d3166
...
...
@@ -1161,7 +1161,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
isTrueValidation
(
FlowPropertyEnum
.
IS_INNER
.
getCode
().
equals
(
flow
.
getIsInner
()),
"内嵌工作流不允许删除!"
);
//判断是否在调度中
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
findOnScheduleByFlowId
(
flow
.
getFlowId
());
ValidationUtil
.
isTrueValidation
(
null
==
recordingList
||
recordingList
.
size
()
==
0
,
"工作流已在调度中不允许撤销调度!"
);
ValidationUtil
.
isTrueValidation
(
null
!=
recordingList
&&
recordingList
.
size
()
>
0
,
"工作流已在调度中不允许撤销调度!"
);
List
<
RunRecording
>
unStartRecordingList
=
runRecordingMapper
.
findUnStartByFlowId
(
flow
.
getFlowId
());
//删除对应的task记录
unStartRecordingList
.
forEach
(
runRecording
->
{
...
...
@@ -1232,7 +1232,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
isTrueValidation
(
FlowPropertyEnum
.
IS_INNER
.
getCode
().
equals
(
flow
.
getIsInner
()),
"内嵌工作流不允许撤销调度!"
);
//判断是否在调度中
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
findOnScheduleByFlowId
(
flow
.
getFlowId
());
ValidationUtil
.
isTrueValidation
(
null
==
recordingList
||
recordingList
.
size
()
==
0
,
"工作流已在调度中不允许撤销调度!"
);
ValidationUtil
.
isTrueValidation
(
null
!=
recordingList
&&
recordingList
.
size
()
>
0
,
"工作流已在调度中不允许撤销调度!"
);
List
<
RunRecording
>
unStartRecordingList
=
runRecordingMapper
.
findUnStartByFlowId
(
flow
.
getFlowId
());
//删除对应的task记录
unStartRecordingList
.
forEach
(
runRecording
->
{
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/StatusSnapshootThreadRunHelper.java
View file @
682d3166
...
...
@@ -6,6 +6,7 @@ import com.byit.mapper.*;
import
com.byit.model.*
;
import
com.byit.thread.BaseThreadRunHelper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -94,9 +95,12 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
FlowStatusSnapshoot
hourFlowStatusSnapshoot
=
new
FlowStatusSnapshoot
();
BeanUtils
.
copyProperties
(
flowStatusSnapshoot
,
hourFlowStatusSnapshoot
);
//判断运行状态
if
(
runRecording
.
getFlowStatus
().
equals
(
"1"
)
||
runRecording
.
getFlowStatus
().
equals
(
"2"
)
||
runRecording
.
getFlowStatus
().
equals
(
"3"
)){
if
(
StringUtils
.
isEmpty
(
runRecording
.
getFlowStatus
())){
//如果为空设置为未运行
hourFlowStatusSnapshoot
.
setFlowStatus
(
1
);
}
else
if
(
runRecording
.
getFlowStatus
().
equals
(
"1"
)
||
runRecording
.
getFlowStatus
().
equals
(
"2"
)
||
runRecording
.
getFlowStatus
().
equals
(
"3"
)){
hourFlowStatusSnapshoot
.
setFlowStatus
(
Integer
.
valueOf
(
runRecording
.
getFlowStatus
()));
}
else
{
}
else
if
(
runRecording
.
getFlowStatus
().
equals
(
"4"
))
{
switch
(
runRecording
.
getFlowRunResult
()){
case
"1"
:
case
"3"
:
hourFlowStatusSnapshoot
.
setFlowStatus
(
4
);
break
;
...
...
@@ -105,6 +109,9 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
case
"5"
:
hourFlowStatusSnapshoot
.
setFlowStatus
(
6
);
break
;
default
:
hourFlowStatusSnapshoot
.
setFlowStatus
(
5
);
break
;
}
}
else
{
//如果没在判断之内,设置为未运行
hourFlowStatusSnapshoot
.
setFlowStatus
(
1
);
}
//获取运行实例下各类状态的节点数目
StatisticData
nodeStatistic
=
jobTaskRunLogMapper
.
findStatisticDataByRunIdAndFlowId
(
runRecording
.
getRunId
(),
flow
.
getFlowId
());
...
...
@@ -112,7 +119,11 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
//存在节点运行日志
if
(
nodeStatistic
!=
null
){
int
sum
=
nodeStatistic
.
getFail
()
+
nodeStatistic
.
getSuccess
()
+
nodeStatistic
.
getRunIng
()
+
nodeStatistic
.
getKill
();
hourFlowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
()
-
sum
);
if
(
flow
.
getFlowNodeCount
()
>
sum
){
hourFlowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
()
-
sum
);
}
else
{
hourFlowStatusSnapshoot
.
setUnstartNode
(
0
);
}
hourFlowStatusSnapshoot
.
setRuningNode
(
nodeStatistic
.
getRunIng
());
hourFlowStatusSnapshoot
.
setSuccessNode
(
nodeStatistic
.
getSuccess
());
hourFlowStatusSnapshoot
.
setFailNode
(
nodeStatistic
.
getFail
());
...
...
@@ -133,6 +144,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
flowStatusSnapshootList
.
addAll
(
preHourFlowStatusSnapshootList
);
}
else
{
//如果上个小时也没有,就设置为未运行
flowStatusSnapshoot
.
setFlowStatus
(
1
);
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
flowStatusSnapshootList
.
add
(
flowStatusSnapshoot
);
}
...
...
@@ -140,6 +152,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
}
}
else
{
//如果不存在运行实例
flowStatusSnapshoot
.
setFlowStatus
(
1
);
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
flowStatusSnapshootList
.
add
(
flowStatusSnapshoot
);
}
...
...
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