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
2e82ed53
Commit
2e82ed53
authored
May 21, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决空指针异常
parent
d9524b48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
28 deletions
+28
-28
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+21
-21
JobSnapshotThreadRunHelper.java
...va/com/byit/thread/helper/JobSnapshotThreadRunHelper.java
+7
-7
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
2e82ed53
...
...
@@ -789,17 +789,17 @@ public class ApiFlowServiceImpl implements ApiFlowService {
Map
<
String
,
Long
>
statusMap
=
betweenRunRecording
.
stream
().
collect
(
Collectors
.
groupingBy
(
RunRecording:
:
getFlowStatus
,
Collectors
.
counting
()));
//成功的
long
successCount
=
resultMap
.
get
(
"1"
);
long
reSuccessCount
=
resultMap
.
get
(
"3"
);
long
successCount
=
resultMap
.
get
(
"1"
)
==
null
?
0
:
resultMap
.
get
(
"1"
)
;
long
reSuccessCount
=
resultMap
.
get
(
"3"
)
==
null
?
0
:
resultMap
.
get
(
"3"
)
;
long
successTotal
=
successCount
+
reSuccessCount
;
//失败的
long
errorCount
=
resultMap
.
get
(
"2"
);
long
reErrorCount
=
resultMap
.
get
(
"4"
);
long
killCount
=
resultMap
.
get
(
"5"
);
long
errorCount
=
resultMap
.
get
(
"2"
)
==
null
?
0
:
resultMap
.
get
(
"2"
)
;
long
reErrorCount
=
resultMap
.
get
(
"4"
)
==
null
?
0
:
resultMap
.
get
(
"4"
)
;
long
killCount
=
resultMap
.
get
(
"5"
)
==
null
?
0
:
resultMap
.
get
(
"5"
)
;
long
errorTotal
=
errorCount
+
reErrorCount
+
killCount
;
//运行中的
long
runingFlow
=
statusMap
.
get
(
"2"
);
long
stopFlow
=
statusMap
.
get
(
"3"
);
long
runingFlow
=
statusMap
.
get
(
"2"
)
==
null
?
0
:
statusMap
.
get
(
"2"
)
;
long
stopFlow
=
statusMap
.
get
(
"3"
)
==
null
?
0
:
statusMap
.
get
(
"3"
)
;
long
runTotal
=
runingFlow
+
stopFlow
;
...
...
@@ -807,7 +807,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//统计固定时间内所有flow表的数据 查询所有待运行的工作流
List
<
Flow
>
allFlow
=
flowMapper
.
findAllByThisDayFlow
(
statisticsConditionDto
);
//统计视力表啊的数据
long
notStartFlowCount
=
statusMap
.
get
(
"1"
);
long
notStartFlowCount
=
statusMap
.
get
(
"1"
)
==
null
?
0
:
statusMap
.
get
(
"1"
)
;
//统计等待表哦数据
List
<
WaitingRecord
>
allByCondition
=
waitingRecordMapper
.
findAllByCondition
(
statisticsConditionDto
);
int
waitFlowCount
=
0
;
...
...
@@ -844,16 +844,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StatisticData
figFlowStatisticData
=
new
StatisticData
();
Map
<
Integer
,
Long
>
integerLongMap
=
flowStatusSnapshoots
.
stream
().
collect
(
Collectors
.
groupingBy
(
FlowStatusSnapshoot:
:
getFlowStatus
,
Collectors
.
counting
()));
//未运行的
long
waitFigFlowCount
=
integerLongMap
.
get
(
"1"
);
long
waitFigFlowCount
=
integerLongMap
.
get
(
"1"
)
==
null
?
0
:
integerLongMap
.
get
(
"1"
)
;
//运行中的 暂停的
long
runFigFlowCount
=
integerLongMap
.
get
(
"2"
);
long
stopFigFlowCount
=
integerLongMap
.
get
(
"3"
);
long
runFigFlowCount
=
integerLongMap
.
get
(
"2"
)
==
null
?
0
:
integerLongMap
.
get
(
"2"
)
;
long
stopFigFlowCount
=
integerLongMap
.
get
(
"3"
)
==
null
?
0
:
integerLongMap
.
get
(
"3"
)
;
long
figRunTotal
=
runFigFlowCount
+
stopFigFlowCount
;
//成功的
long
successFigFlowCount
=
integerLongMap
.
get
(
"4"
);
long
successFigFlowCount
=
integerLongMap
.
get
(
"4"
)
==
null
?
0
:
integerLongMap
.
get
(
"4"
)
;
//失败的
long
errorFigFlowCount
=
integerLongMap
.
get
(
"5"
);
long
killFigFlowCount
=
integerLongMap
.
get
(
"6"
);
long
errorFigFlowCount
=
integerLongMap
.
get
(
"5"
)
==
null
?
0
:
integerLongMap
.
get
(
"5"
)
;
long
killFigFlowCount
=
integerLongMap
.
get
(
"6"
)
==
null
?
0
:
integerLongMap
.
get
(
"6"
)
;
long
figErrorTotal
=
errorFigFlowCount
+
killFigFlowCount
;
figFlowStatisticData
.
setUnstart
((
int
)
waitFigFlowCount
);
figFlowStatisticData
.
setFail
((
int
)
figErrorTotal
);
...
...
@@ -909,16 +909,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StatisticData
statisticData
=
new
StatisticData
();
Map
<
String
,
Long
>
stringLongMap
=
logWithBLOBs
.
stream
().
collect
(
Collectors
.
groupingBy
(
JobTaskRunLogWithBLOBs:
:
getRunCode
,
Collectors
.
counting
()));
//成功的
long
successCount
=
stringLongMap
.
get
(
"1"
);
long
reSuccessCount
=
stringLongMap
.
get
(
"3"
);
long
successCount
=
stringLongMap
.
get
(
"1"
)
==
null
?
0
:
stringLongMap
.
get
(
"1"
)
;
long
reSuccessCount
=
stringLongMap
.
get
(
"3"
)
==
null
?
0
:
stringLongMap
.
get
(
"3"
)
;
long
successTotal
=
successCount
+
reSuccessCount
;
//执行中的
long
runIngCount
=
stringLongMap
.
get
(
"0"
);
long
runIngCount
=
stringLongMap
.
get
(
"0"
)
==
null
?
0
:
stringLongMap
.
get
(
"0"
)
;
//失败的
long
errorCount
=
stringLongMap
.
get
(
"2"
);
long
reErorCount
=
stringLongMap
.
get
(
"4"
);
long
killCount
=
stringLongMap
.
get
(
"5"
);
long
upErrorCount
=
stringLongMap
.
get
(
"6"
);
long
errorCount
=
stringLongMap
.
get
(
"2"
)
==
null
?
0
:
stringLongMap
.
get
(
"2"
)
;
long
reErorCount
=
stringLongMap
.
get
(
"4"
)
==
null
?
0
:
stringLongMap
.
get
(
"4"
)
;
long
killCount
=
stringLongMap
.
get
(
"5"
)
==
null
?
0
:
stringLongMap
.
get
(
"5"
)
;
long
upErrorCount
=
stringLongMap
.
get
(
"6"
)
==
null
?
0
:
stringLongMap
.
get
(
"6"
)
;
long
errorTotal
=
errorCount
+
reErorCount
+
upErrorCount
+
killCount
;
//待运行的
long
waitTotal
=
total
-
(
successTotal
+
runIngCount
+
errorTotal
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/JobSnapshotThreadRunHelper.java
View file @
2e82ed53
...
...
@@ -269,21 +269,21 @@ public class JobSnapshotThreadRunHelper extends BaseThreadRunHelper {
List
<
JobTaskRunLogWithBLOBs
>
jobTaskRunLogWithBLOBs
=
logService
.
findJobTaskRunLogWithBLOBsByFlowIdAndRunId
(
runRecording
.
getFlowId
(),
runRecording
.
getRunId
());
Map
<
String
,
Long
>
longMap
=
jobTaskRunLogWithBLOBs
.
stream
().
collect
(
Collectors
.
groupingBy
(
JobTaskRunLogWithBLOBs:
:
getRunCode
,
Collectors
.
counting
()));
//成功的统计
long
successCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_SUCCESS
.
getCode
());
long
reSuccessCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RE_RUN_SUCCESS
.
getCode
());
long
successCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_SUCCESS
.
getCode
())
==
null
?
0
:
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_SUCCESS
.
getCode
())
;
long
reSuccessCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RE_RUN_SUCCESS
.
getCode
())
==
null
?
0
:
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RE_RUN_SUCCESS
.
getCode
())
;
long
successTotilCount
=
successCount
+
reSuccessCount
;
flowStatusSnapshoot
.
setSuccessNode
((
int
)
successTotilCount
);
//失败的统计
long
erroeCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_FAILURE
.
getCode
());
long
reErroeCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RE_RUN_FAILURE
.
getCode
());
long
upNodeErroeCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
PARENT_NODE_FAILED
.
getCode
());
long
erroeCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_FAILURE
.
getCode
())
==
null
?
0
:
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_FAILURE
.
getCode
())
;
long
reErroeCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RE_RUN_FAILURE
.
getCode
())
==
null
?
0
:
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RE_RUN_FAILURE
.
getCode
())
;
long
upNodeErroeCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
PARENT_NODE_FAILED
.
getCode
())
==
null
?
0
:
longMap
.
get
(
NodeRunStatusPropertyEnum
.
PARENT_NODE_FAILED
.
getCode
())
;
long
errorTotilCount
=
erroeCount
+
reErroeCount
+
upNodeErroeCount
;
flowStatusSnapshoot
.
setFailNode
((
int
)
errorTotilCount
);
//kill的统计
long
killCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
KILL
.
getCode
());
long
killCount
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
KILL
.
getCode
())
==
null
?
0
:
longMap
.
get
(
NodeRunStatusPropertyEnum
.
KILL
.
getCode
())
;
flowStatusSnapshoot
.
setKillNode
((
int
)
killCount
);
//运行中的统计
long
runIng
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_ING
.
getCode
());
long
runIng
=
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_ING
.
getCode
())
==
null
?
0
:
longMap
.
get
(
NodeRunStatusPropertyEnum
.
RUN_ING
.
getCode
())
;
flowStatusSnapshoot
.
setRuningNode
((
int
)
runIng
);
//未运行的统计
Integer
totalNodeCount
=
runRecording
.
getFlowNodeCount
();
...
...
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