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
b8bfb368
Commit
b8bfb368
authored
May 13, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
8e8528d0
6076546f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
41 deletions
+9
-41
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+0
-0
RunRecordingAndJobTaskServiceImpl.java
...ce/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
+1
-0
StatusSnapshootThreadRunHelper.java
...om/byit/thread/helper/StatusSnapshootThreadRunHelper.java
+7
-41
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+1
-0
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
b8bfb368
This diff is collapsed.
Click to expand it.
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/mapservice/impl/RunRecordingAndJobTaskServiceImpl.java
View file @
b8bfb368
...
@@ -241,6 +241,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
...
@@ -241,6 +241,7 @@ public class RunRecordingAndJobTaskServiceImpl implements RunRecordingAndJobTask
target
.
setTriggerStatus
(
"1"
);
target
.
setTriggerStatus
(
"1"
);
target
.
setRunId
(
waitingRecord
.
getRunId
());
target
.
setRunId
(
waitingRecord
.
getRunId
());
BeanUtils
.
copyProperties
(
waitingTask
,
target
);
BeanUtils
.
copyProperties
(
waitingTask
,
target
);
target
.
setReRunId
(
runRecording
.
getReRunId
());
target
.
setId
(
null
);
target
.
setId
(
null
);
target
.
setTriggerTime
(
0L
);
target
.
setTriggerTime
(
0L
);
return
target
;
return
target
;
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/StatusSnapshootThreadRunHelper.java
View file @
b8bfb368
...
@@ -66,7 +66,10 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
...
@@ -66,7 +66,10 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
List
<
FlowStatusSnapshoot
>
flowStatusSnapshootList
=
new
ArrayList
<>();
List
<
FlowStatusSnapshoot
>
flowStatusSnapshootList
=
new
ArrayList
<>();
flowList
.
forEach
(
flow
->
{
flowList
.
forEach
(
flow
->
{
List
<
RunRecording
>
maxRunRecordingList
=
runRecordingMapper
.
findMaxByFlowId
(
flow
.
getFlowId
());
//获取今天凌晨的时间戳
Long
time
=
LocalDate
.
now
().
atStartOfDay
(
ZoneOffset
.
ofHours
(
8
)).
toInstant
().
toEpochMilli
();
//获取今天的运行实例
List
<
RunRecording
>
runRecordingList
=
runRecordingMapper
.
findByPreTime
(
new
Date
(
time
),
flow
.
getFlowId
());
FlowStatusSnapshoot
flowStatusSnapshoot
=
new
FlowStatusSnapshoot
();
FlowStatusSnapshoot
flowStatusSnapshoot
=
new
FlowStatusSnapshoot
();
flowStatusSnapshoot
.
setDay
(
date
);
flowStatusSnapshoot
.
setDay
(
date
);
flowStatusSnapshoot
.
setFlowId
(
flow
.
getFlowId
());
flowStatusSnapshoot
.
setFlowId
(
flow
.
getFlowId
());
...
@@ -77,45 +80,8 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
...
@@ -77,45 +80,8 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
//统计运行实例的数据
//统计运行实例的数据
//如果存在实例
//如果存在实例
if
(
null
!=
maxRunRecordingList
&&
maxRunRecordingList
.
size
()
>
0
){
if
(
null
!=
runRecordingList
&&
runRecordingList
.
size
()
>
0
){
//获取今天凌晨的时间戳
buildUnFinish
(
runRecordingList
,
flowStatusSnapshootList
,
flowStatusSnapshoot
,
flow
);
Long
time
=
LocalDate
.
now
().
atStartOfDay
(
ZoneOffset
.
ofHours
(
8
)).
toInstant
().
toEpochMilli
();
RunRecording
maxRunRecording
=
maxRunRecordingList
.
get
(
0
);
//从凌晨到现在是否有运行实例
if
(
time
.
longValue
()
>
maxRunRecording
.
getStartTime
().
getTime
()){
flowStatusSnapshoot
.
setFlowStatus
(
1
);
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
flowStatusSnapshootList
.
add
(
flowStatusSnapshoot
);
}
else
{
//从凌晨到现在存在工作流的运行实例
//获取上一个小时的时间戳
Long
preHourTime
=
hourDateTime
.
minusHours
(
1
).
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
();
//查询过去一个小时的和未完成的工作流实例
List
<
RunRecording
>
runRecordingList
=
runRecordingMapper
.
findByPreTime
(
new
Date
(
preHourTime
),
flow
.
getFlowId
());
//判断是否存在过去一个小时的和未完成的工作流实例
if
(
null
!=
runRecordingList
&&
runRecordingList
.
size
()
>
0
){
//处理未完成和过去一个小时的工作流实例
buildUnFinish
(
runRecordingList
,
flowStatusSnapshootList
,
flowStatusSnapshoot
,
flow
);
}
else
{
//如果不存在实例,获取上一个小时的运行快照保存
LocalDateTime
preHourLocalDateTime
=
localDateTime
.
minusHours
(
1
);
String
preHourDate
=
preHourLocalDateTime
.
format
(
DATE_FORMATTER
);
String
preHourHour
=
String
.
valueOf
(
preHourLocalDateTime
.
getHour
());
List
<
FlowStatusSnapshoot
>
preHourFlowStatusSnapshootList
=
flowStatusSnapshootMapper
.
findByDateAndHourAndFlowId
(
preHourDate
,
preHourHour
,
flow
.
getFlowId
());
if
(
null
!=
preHourFlowStatusSnapshootList
&&
preHourFlowStatusSnapshootList
.
size
()
>
0
){
preHourFlowStatusSnapshootList
.
forEach
(
preHourFlowStatusSnapshoot
->{
preHourFlowStatusSnapshoot
.
setDay
(
date
);
preHourFlowStatusSnapshoot
.
setHour
(
hour
);
preHourFlowStatusSnapshoot
.
setSnapshootTime
(
hourTime
);
flowStatusSnapshootList
.
add
(
preHourFlowStatusSnapshoot
);
});
}
else
{
//如果上个小时也没有,就设置为未运行
flowStatusSnapshoot
.
setFlowStatus
(
1
);
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
flowStatusSnapshootList
.
add
(
flowStatusSnapshoot
);
}
}
}
}
else
{
}
else
{
//如果不存在运行实例
//如果不存在运行实例
flowStatusSnapshoot
.
setFlowStatus
(
1
);
flowStatusSnapshoot
.
setFlowStatus
(
1
);
...
@@ -137,7 +103,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
...
@@ -137,7 +103,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
}
}
/**
/**
* 功能描述
处理过去一小时
和未完成的工作流的快照
* 功能描述
当天的
和未完成的工作流的快照
* @author gml
* @author gml
* @date 2020-05-08 10:20
* @date 2020-05-08 10:20
* @param runRecordingList
* @param runRecordingList
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
b8bfb368
...
@@ -234,6 +234,7 @@
...
@@ -234,6 +234,7 @@
where flow_id = #{flowId}
where flow_id = #{flowId}
and (
and (
start_time
>
= #{preHourDate}
start_time
>
= #{preHourDate}
or end_time
>
= #{preHourDate}
or flow_status != '4'
or flow_status != '4'
)
)
</select>
</select>
...
...
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