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
e540db31
Commit
e540db31
authored
Aug 20, 2020
by
guominglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂停工作流修改
parent
c4948aea
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+11
-6
RunRecordingMapper.java
...ore/src/main/java/com/byit/mapper/RunRecordingMapper.java
+7
-0
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+8
-0
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
e540db31
...
@@ -3,7 +3,6 @@ package com.byit.service.impl;
...
@@ -3,7 +3,6 @@ package com.byit.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.lang.ConsistentHash
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.byit.dto.StatisticsConditionDto
;
import
com.byit.dto.StatisticsConditionDto
;
...
@@ -26,7 +25,6 @@ import com.byit.util.IDGenerationStrategy;
...
@@ -26,7 +25,6 @@ import com.byit.util.IDGenerationStrategy;
import
com.byit.util.lock.RedissLockUtil
;
import
com.byit.util.lock.RedissLockUtil
;
import
com.byit.utils.ValidationUtil
;
import
com.byit.utils.ValidationUtil
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -38,7 +36,7 @@ import javax.annotation.Resource;
...
@@ -38,7 +36,7 @@ import javax.annotation.Resource;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.
ConcurrentHashMap
;
import
java.util.concurrent.
atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
serializer
.
SerializerFeature
.
WriteClassName
;
import
static
com
.
alibaba
.
fastjson
.
serializer
.
SerializerFeature
.
WriteClassName
;
...
@@ -1173,9 +1171,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1173,9 +1171,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
@Override
@Override
public
Boolean
stopScheduleByRunId
(
String
runId
)
{
public
Boolean
stopScheduleByRunId
(
String
runId
)
{
RunRecording
recording
=
runRecordingMapper
.
findAllByRunID
(
runId
);
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
findByRunID
(
runId
);
ValidationUtil
.
dataNotNull
(
recording
,
"查无此运行实例!"
);
ValidationUtil
.
dataNotNull
(
recordingList
,
"查无此运行实例!"
);
ValidationUtil
.
isTrueValidation
(
"3"
.
equals
(
recording
.
getFlowStatus
())
||
"4"
.
equals
(
recording
.
getFlowStatus
())
,
"该运行实例没有在运行中!"
);
AtomicReference
<
Boolean
>
result
=
new
AtomicReference
<>(
true
);
recordingList
.
forEach
(
runRecording
->
{
if
((
"3"
.
equals
(
runRecording
.
getFlowStatus
())
||
"4"
.
equals
(
runRecording
.
getFlowStatus
()))
//如果不是正在运行
&&
FlowPropertyEnum
.
ISNOT_INNER
.
getCode
().
equals
(
runRecording
.
getIsInner
())){
//并且不是内嵌工作流
result
.
set
(
false
);
}
});
ValidationUtil
.
isTrueValidation
(!
result
.
get
(),
"该运行实例没有在运行中!"
);
//暂停工作流调度
//暂停工作流调度
runRecordingMapper
.
stopByRunId
(
runId
);
runRecordingMapper
.
stopByRunId
(
runId
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/mapper/RunRecordingMapper.java
View file @
e540db31
...
@@ -54,6 +54,13 @@ public interface RunRecordingMapper {
...
@@ -54,6 +54,13 @@ public interface RunRecordingMapper {
* @return
* @return
*/
*/
RunRecording
findAllByRunID
(
String
runId
);
RunRecording
findAllByRunID
(
String
runId
);
/**
*根据运行标识查询对应的运行实例
* @param runId
* @return
*/
List
<
RunRecording
>
findByRunID
(
String
runId
);
/**
/**
* 查询运行中的运行实例
* 查询运行中的运行实例
* @return
* @return
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
e540db31
...
@@ -105,6 +105,14 @@
...
@@ -105,6 +105,14 @@
from run_recording
from run_recording
where run_id=#{runId,jdbcType=VARCHAR} and schedule_type != 4
where run_id=#{runId,jdbcType=VARCHAR} and schedule_type != 4
</select>
</select>
<select
id=
"findByRunID"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from run_recording
where run_id=#{runId,jdbcType=VARCHAR} and schedule_type != 4
</select>
<!--查询运行中的-->
<!--查询运行中的-->
<select
id=
"findRunningRunRecording"
resultMap=
"BaseResultMap"
>
<select
id=
"findRunningRunRecording"
resultMap=
"BaseResultMap"
>
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