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
6b3ed7aa
Commit
6b3ed7aa
authored
Oct 22, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂停BUG
parent
76f97ef7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
9 deletions
+45
-9
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+15
-8
JobTaskMapper.java
...min-core/src/main/java/com/byit/mapper/JobTaskMapper.java
+9
-1
RunRecordingMapper.java
...ore/src/main/java/com/byit/mapper/RunRecordingMapper.java
+8
-0
JobTaskMapper.xml
...th-admin-core/src/main/resources/mapper/JobTaskMapper.xml
+5
-0
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+6
-0
StopFlowParam.java
...core/src/main/java/com/byit/dto/plugin/StopFlowParam.java
+2
-0
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
6b3ed7aa
...
@@ -1536,6 +1536,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1536,6 +1536,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if
(
"3"
.
equals
(
runRecording
.
getFlowStatus
()))
{
if
(
"3"
.
equals
(
runRecording
.
getFlowStatus
()))
{
StopFlowParam
stopFlowParam
=
new
StopFlowParam
();
StopFlowParam
stopFlowParam
=
new
StopFlowParam
();
stopFlowParam
.
setRunIds
(
runRecording
.
getRunId
());
stopFlowParam
.
setRunIds
(
runRecording
.
getRunId
());
stopFlowParam
.
setFlowName
(
flowName
);
stopFlowParam
.
setAllStartFlow
(
"1"
);
stopFlowParam
.
setAllStartFlow
(
"1"
);
reStartSchedule
(
stopFlowParam
);
reStartSchedule
(
stopFlowParam
);
}
else
{
}
else
{
...
@@ -1672,7 +1673,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1672,7 +1673,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//暂停工作流调度
//暂停工作流调度
recordingList
.
forEach
(
runRecording
->
{
recordingList
.
forEach
(
runRecording
->
{
//runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId());
//runRecordingMapper.stopByRunIdAndFlowId(runRecording.getRunId(), runRecording.getFlowId());
runRecordingMapper
.
stopByRunId
(
runRecording
.
getRun
Id
());
runRecordingMapper
.
stopByRunId
AndFlowId
(
runRecording
.
getRunId
(),
runRecording
.
getFlow
Id
());
jobTaskMapper
.
stopByRunIdAndFlowId
(
runRecording
.
getRunId
(),
runRecording
.
getFlowId
());
jobTaskMapper
.
stopByRunIdAndFlowId
(
runRecording
.
getRunId
(),
runRecording
.
getFlowId
());
runids
.
append
(
runRecording
.
getRunId
()
+
","
);
runids
.
append
(
runRecording
.
getRunId
()
+
","
);
});
});
...
@@ -1685,13 +1686,19 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1685,13 +1686,19 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
dataNotNull
(
stopFlowParam
,
"执行参数不允许为空!"
);
ValidationUtil
.
dataNotNull
(
stopFlowParam
,
"执行参数不允许为空!"
);
String
runIds
=
stopFlowParam
.
getRunIds
();
String
runIds
=
stopFlowParam
.
getRunIds
();
ValidationUtil
.
dataNotBank
(
runIds
,
"运行id不允许为空!"
);
ValidationUtil
.
dataNotBank
(
runIds
,
"运行id不允许为空!"
);
String
flowName
=
stopFlowParam
.
getFlowName
();
ValidationUtil
.
dataNotBank
(
flowName
,
"工作流名称不允许为空!"
);
List
<
String
>
runIdList
=
Arrays
.
asList
(
runIds
.
split
(
","
));
List
<
String
>
runIdList
=
Arrays
.
asList
(
runIds
.
split
(
","
));
runIdList
.
forEach
(
runId
->
{
for
(
String
runId
:
runIdList
)
{
List
<
RunRecording
>
runRecordList
=
runRecordingMapper
.
findStopRunCordByRunId
(
runId
);
List
<
RunRecording
>
runRecordList
=
runRecordingMapper
.
findStopRunCordByRunId
(
runId
);
log
.
warn
(
"---------运行记录{},不存在暂停记录中!---"
,
runId
);
ValidationUtil
.
isTrueValidation
(
CollectionUtil
.
isEmpty
(
runRecordList
),
"该工作流不是暂停状态!"
);
//ValidationUtil.isTrueValidation(CollectionUtil.isEmpty(runRecordList), "该工作流不是暂停状态!");
RunRecording
mainRunRecording
=
runRecordList
.
stream
().
filter
(
runRecording
->
"1"
.
equals
(
runRecording
.
getIsInner
())).
findFirst
().
orElse
(
null
);
if
(
CollectionUtil
.
isEmpty
(
runRecordList
)){
log
.
warn
(
"---------运行记录{},不存在暂停记录中!---"
,
runId
);
return
;
}
RunRecording
mainRunRecording
=
runRecordList
.
stream
().
filter
(
runRecording
->
flowName
.
equals
(
runRecording
.
getFlowName
())).
findFirst
().
orElse
(
null
);
Integer
stopCount
=
0
;
Integer
stopCount
=
0
;
if
(
mainRunRecording
!=
null
)
{
if
(
mainRunRecording
!=
null
)
{
stopCount
=
mainRunRecording
.
getStopCount
();
stopCount
=
mainRunRecording
.
getStopCount
();
...
@@ -1701,11 +1708,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1701,11 +1708,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
mainRunRecording
.
setStopCount
(
stopCount
);
mainRunRecording
.
setStopCount
(
stopCount
);
runRecordingMapper
.
updateRunRecordingById
(
mainRunRecording
);
runRecordingMapper
.
updateRunRecordingById
(
mainRunRecording
);
}
else
{
}
else
{
runRecordingMapper
.
startByRunId
(
runId
);
runRecordingMapper
.
startByRunId
AndFlowId
(
runId
,
mainRunRecording
.
getFlowId
()
);
jobTaskMapper
.
startByRunId
(
runId
);
jobTaskMapper
.
startByRunId
AndFlowId
(
runId
,
mainRunRecording
.
getFlowId
()
);
}
}
}
);
}
}
}
}
}
byit-myth-core/myth-admin-core/src/main/java/com/byit/mapper/JobTaskMapper.java
View file @
6b3ed7aa
...
@@ -104,7 +104,15 @@ public interface JobTaskMapper {
...
@@ -104,7 +104,15 @@ public interface JobTaskMapper {
* @param runId
* @param runId
* @return
* @return
*/
*/
int
startByRunId
(
String
runId
);
int
startByRunId
(
@Param
(
"runId"
)
String
runId
);
/**
* 根据runid开始调度
* @param runId
* @param flowId
* @return
*/
int
startByRunIdAndFlowId
(
@Param
(
"runId"
)
String
runId
,
@Param
(
"flowId"
)
Integer
flowId
);
int
stopJobTask
(
@Param
(
"runId"
)
String
runId
,
@Param
(
"nodeIds"
)
List
<
Integer
>
nodeIds
);
int
stopJobTask
(
@Param
(
"runId"
)
String
runId
,
@Param
(
"nodeIds"
)
List
<
Integer
>
nodeIds
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/mapper/RunRecordingMapper.java
View file @
6b3ed7aa
...
@@ -163,6 +163,14 @@ public interface RunRecordingMapper {
...
@@ -163,6 +163,14 @@ public interface RunRecordingMapper {
int
startByRunId
(
String
runId
);
int
startByRunId
(
String
runId
);
/**
/**
* 开始实例 基于runid和工作流名称
* @param runId
* @param flowId
* @return
*/
int
startByRunIdAndFlowId
(
@Param
(
"runId"
)
String
runId
,
@Param
(
"flowId"
)
Integer
flowId
);
/**
* 根据runid查找停止的运行记录
* 根据runid查找停止的运行记录
* @param runId
* @param runId
* @return
* @return
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskMapper.xml
View file @
6b3ed7aa
...
@@ -473,6 +473,11 @@
...
@@ -473,6 +473,11 @@
where run_id = #{runId,jdbcType=VARCHAR}
where run_id = #{runId,jdbcType=VARCHAR}
</update>
</update>
<update
id=
"startByRunIdAndFlowId"
parameterType=
"string"
>
update job_task set trigger_status = '1'
where run_id = #{runId,jdbcType=VARCHAR} and flow_id = #{flowId,jdbcType=INTEGER}
</update>
<!--多个删除-->
<!--多个删除-->
<delete
id=
"deleteInId"
parameterType=
"com.byit.model.JobTaskSchedule"
>
<delete
id=
"deleteInId"
parameterType=
"com.byit.model.JobTaskSchedule"
>
delete from job_task
delete from job_task
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
6b3ed7aa
...
@@ -695,6 +695,12 @@
...
@@ -695,6 +695,12 @@
and flow_status = '3'
and flow_status = '3'
</update>
</update>
<update
id=
"startByRunIdAndFlowId"
>
update run_recording set flow_status = '2', stop_count = 0
where run_id = #{runId,jdbcType=VARCHAR}
and flow_status = '3' and flow_id = #{flowId,jdbcType=INTEGER}
</update>
<update
id=
"killUnFinshFlow"
>
<update
id=
"killUnFinshFlow"
>
update run_recording set flow_status = '4',flow_run_result = '5'
update run_recording set flow_status = '4',flow_run_result = '5'
where run_id = #{runId,jdbcType=VARCHAR}
where run_id = #{runId,jdbcType=VARCHAR}
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/plugin/StopFlowParam.java
View file @
6b3ed7aa
...
@@ -9,6 +9,8 @@ import lombok.Data;
...
@@ -9,6 +9,8 @@ import lombok.Data;
*/
*/
@Data
@Data
public
class
StopFlowParam
{
public
class
StopFlowParam
{
private
String
flowName
;
private
String
runIds
;
private
String
runIds
;
private
String
allStartFlow
=
"0"
;
private
String
allStartFlow
=
"0"
;
...
...
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