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
b19ac36a
Commit
b19ac36a
authored
Oct 12, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加暂停计数
parent
b16b345a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
5 deletions
+37
-5
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+14
-2
RunRecording.java
...admin-core/src/main/java/com/byit/model/RunRecording.java
+7
-0
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+16
-3
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
b19ac36a
...
@@ -1222,8 +1222,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1222,8 +1222,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
findByRunID
(
runId
);
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
findByRunID
(
runId
);
ValidationUtil
.
dataNotNull
(
recordingList
,
"查无此运行实例!"
);
ValidationUtil
.
dataNotNull
(
recordingList
,
"查无此运行实例!"
);
AtomicReference
<
Boolean
>
result
=
new
AtomicReference
<>(
true
);
AtomicReference
<
Boolean
>
result
=
new
AtomicReference
<>(
true
);
//"3".equals(runRecording.getFlowStatus()) ||
recordingList
.
forEach
(
runRecording
->
{
recordingList
.
forEach
(
runRecording
->
{
if
((
"
3"
.
equals
(
runRecording
.
getFlowStatus
())
||
"
4"
.
equals
(
runRecording
.
getFlowStatus
()))
//如果不是正在运行
if
((
"4"
.
equals
(
runRecording
.
getFlowStatus
()))
//如果不是正在运行
&&
FlowPropertyEnum
.
ISNOT_INNER
.
getCode
().
equals
(
runRecording
.
getIsInner
()))
{
//并且不是内嵌工作流
&&
FlowPropertyEnum
.
ISNOT_INNER
.
getCode
().
equals
(
runRecording
.
getIsInner
()))
{
//并且不是内嵌工作流
result
.
set
(
false
);
result
.
set
(
false
);
}
}
...
@@ -1674,9 +1675,20 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1674,9 +1675,20 @@ public class ApiFlowServiceImpl implements ApiFlowService {
runIdList
.
forEach
(
runId
->
{
runIdList
.
forEach
(
runId
->
{
List
<
RunRecording
>
runRecordList
=
runRecordingMapper
.
findStopRunCordByRunId
(
runId
);
List
<
RunRecording
>
runRecordList
=
runRecordingMapper
.
findStopRunCordByRunId
(
runId
);
log
.
warn
(
"---------运行记录{},不存在暂停记录中!---"
,
runId
);
log
.
warn
(
"---------运行记录{},不存在暂停记录中!---"
,
runId
);
ValidationUtil
.
isTrueValidation
(
null
==
runRecordList
||
runRecordList
.
size
()
==
0
,
"该工作流不是暂停状态!"
);
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
runRecordList
),
"该工作流不是暂停状态!"
);
RunRecording
mainRunRecording
=
runRecordList
.
stream
().
filter
(
runRecording
->
"1"
.
equals
(
runRecording
.
getIsInner
())).
findFirst
().
orElse
(
null
);
Integer
stopCount
=
0
;
if
(
mainRunRecording
!=
null
)
{
stopCount
=
mainRunRecording
.
getStopCount
();
}
if
(
stopCount
!=
null
&&
stopCount
>
0
){
mainRunRecording
.
setStopCount
(--
stopCount
);
runRecordingMapper
.
updateRunRecordingById
(
mainRunRecording
);
}
else
{
runRecordingMapper
.
startByRunId
(
runId
);
runRecordingMapper
.
startByRunId
(
runId
);
jobTaskMapper
.
startByRunId
(
runId
);
jobTaskMapper
.
startByRunId
(
runId
);
}
});
});
}
}
}
}
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/RunRecording.java
View file @
b19ac36a
...
@@ -166,6 +166,12 @@ public class RunRecording implements Serializable {
...
@@ -166,6 +166,12 @@ public class RunRecording implements Serializable {
private
String
repeatTime
;
private
String
repeatTime
;
/**
/**
* 暂停计数
*/
@ApiModelProperty
(
"暂停计数"
)
private
Integer
stopCount
;
/**
*/
*/
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
b19ac36a
...
@@ -27,12 +27,13 @@
...
@@ -27,12 +27,13 @@
<result
column=
"re_run_id"
jdbcType=
"VARCHAR"
property=
"reRunId"
/>
<result
column=
"re_run_id"
jdbcType=
"VARCHAR"
property=
"reRunId"
/>
<result
column=
"workspace_id"
jdbcType=
"INTEGER"
property=
"workspaceId"
/>
<result
column=
"workspace_id"
jdbcType=
"INTEGER"
property=
"workspaceId"
/>
<result
column=
"repeat_time"
jdbcType=
"VARCHAR"
property=
"repeatTime"
/>
<result
column=
"repeat_time"
jdbcType=
"VARCHAR"
property=
"repeatTime"
/>
<result
column=
"stop_count"
jdbcType=
"INTEGER"
property=
"stopCount"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
recording_id, run_id, alarm_email, dispatch_ip, flow_name, flow_run_result, flow_status,
recording_id, run_id, alarm_email, dispatch_ip, flow_name, flow_run_result, flow_status,
flow_timeout, flow_version_name, alarml_action, priority, trigger_time, principal,
flow_timeout, flow_version_name, alarml_action, priority, trigger_time, principal,
flow_id, start_time, end_time, is_alarm,is_inner,fail_fast, flow_node_count, schedule_type, operator, re_run_id
flow_id, start_time, end_time, is_alarm,is_inner,fail_fast, flow_node_count, schedule_type, operator, re_run_id
,workspace_id, repeat_time
,workspace_id, repeat_time
, stop_count
</sql>
</sql>
<select
id=
"findThisDayRunRecording"
resultMap=
"BaseResultMap"
parameterType=
"com.byit.dto.StatisticsConditionDto"
>
<select
id=
"findThisDayRunRecording"
resultMap=
"BaseResultMap"
parameterType=
"com.byit.dto.StatisticsConditionDto"
>
...
@@ -413,6 +414,9 @@
...
@@ -413,6 +414,9 @@
<if
test=
"repeatTime != null"
>
<if
test=
"repeatTime != null"
>
repeat_time,
repeat_time,
</if>
</if>
<if
test=
"stopCount != null"
>
stop_count,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"recordingId != null"
>
<if
test=
"recordingId != null"
>
...
@@ -490,6 +494,9 @@
...
@@ -490,6 +494,9 @@
<if
test=
"repeatTime != null"
>
<if
test=
"repeatTime != null"
>
#{repeatTime,jdbcType=VARCHAR},
#{repeatTime,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"stopCount != null"
>
#{stopCount,jdbcType=VARCHAR},
</if>
</trim>
</trim>
</insert>
</insert>
<update
id=
"updateRunRecordingById"
parameterType=
"com.byit.model.RunRecording"
>
<update
id=
"updateRunRecordingById"
parameterType=
"com.byit.model.RunRecording"
>
...
@@ -567,6 +574,9 @@
...
@@ -567,6 +574,9 @@
<if
test=
"repeatTime != null"
>
<if
test=
"repeatTime != null"
>
repeat_time = #{repeatTime,jdbcType=VARCHAR},
repeat_time = #{repeatTime,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"stopCount != null"
>
stop_count = #{stopCount,jdbcType=VARCHAR},
</if>
</set>
</set>
where recording_id = #{recordingId,jdbcType=INTEGER}
where recording_id = #{recordingId,jdbcType=INTEGER}
</update>
</update>
...
@@ -646,14 +656,17 @@
...
@@ -646,14 +656,17 @@
<if
test=
"repeatTime != null"
>
<if
test=
"repeatTime != null"
>
repeat_time = #{repeatTime,jdbcType=VARCHAR},
repeat_time = #{repeatTime,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"stopCount != null"
>
stop_count = #{stopCount,jdbcType=VARCHAR},
</if>
</set>
</set>
where flow_id = #{flowId,jdbcType=INTEGER} and run_id = #{runId,jdbcType=VARCHAR}
where flow_id = #{flowId,jdbcType=INTEGER} and run_id = #{runId,jdbcType=VARCHAR}
</update>
</update>
<update
id=
"stopByRunId"
parameterType=
"string"
>
<update
id=
"stopByRunId"
parameterType=
"string"
>
update run_recording set flow_status = '3'
update run_recording set flow_status = '3'
, stop_count = (stop_count+1)
where run_id = #{runId,jdbcType=VARCHAR}
where run_id = #{runId,jdbcType=VARCHAR}
and flow_status
in ('1', '2')
and flow_status
!= '4'
</update>
</update>
<update
id=
"startByRunId"
parameterType=
"string"
>
<update
id=
"startByRunId"
parameterType=
"string"
>
...
...
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