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
b297e9c6
Commit
b297e9c6
authored
Oct 12, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加暂停计数
parent
b19ac36a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
10 deletions
+36
-10
ApiFlowController.java
...h-admin/src/main/java/com/byit/api/ApiFlowController.java
+4
-2
ApiFlowService.java
...-admin/src/main/java/com/byit/service/ApiFlowService.java
+3
-1
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+8
-3
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+1
-1
StopFlowParam.java
...core/src/main/java/com/byit/dto/plugin/StopFlowParam.java
+17
-0
JobUtils.java
...xecutor-plugin/src/main/java/com/byit/utils/JobUtils.java
+3
-3
No files found.
byit-myth-admin/src/main/java/com/byit/api/ApiFlowController.java
View file @
b297e9c6
...
@@ -2,6 +2,7 @@ package com.byit.api;
...
@@ -2,6 +2,7 @@ package com.byit.api;
import
com.byit.dto.executor.KillDto
;
import
com.byit.dto.executor.KillDto
;
import
com.byit.dto.plugin.CollectData
;
import
com.byit.dto.plugin.CollectData
;
import
com.byit.dto.plugin.StopFlowParam
;
import
com.byit.dto.web.ResponseResult
;
import
com.byit.dto.web.ResponseResult
;
import
com.byit.model.RunRecording
;
import
com.byit.model.RunRecording
;
import
com.byit.model.vo.RunRecordingVo
;
import
com.byit.model.vo.RunRecordingVo
;
...
@@ -10,6 +11,7 @@ import com.byit.service.FlowService;
...
@@ -10,6 +11,7 @@ import com.byit.service.FlowService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -105,8 +107,8 @@ public class ApiFlowController {
...
@@ -105,8 +107,8 @@ public class ApiFlowController {
@PostMapping
(
"reStartSchedule"
)
@PostMapping
(
"reStartSchedule"
)
@ApiOperation
(
"重新开始某次调度"
)
@ApiOperation
(
"重新开始某次调度"
)
public
ResponseResult
reStartSchedule
(
String
runIds
)
{
public
ResponseResult
reStartSchedule
(
@RequestBody
StopFlowParam
stopFlowParam
)
{
apiFlowService
.
reStartSchedule
(
runIds
);
apiFlowService
.
reStartSchedule
(
stopFlowParam
);
return
ResponseResult
.
ok
(
"SUCCESS"
);
return
ResponseResult
.
ok
(
"SUCCESS"
);
}
}
...
...
byit-myth-admin/src/main/java/com/byit/service/ApiFlowService.java
View file @
b297e9c6
...
@@ -2,6 +2,7 @@ package com.byit.service;
...
@@ -2,6 +2,7 @@ package com.byit.service;
import
com.byit.dto.plugin.CollectData
;
import
com.byit.dto.plugin.CollectData
;
import
com.byit.dto.plugin.PluginFlow
;
import
com.byit.dto.plugin.PluginFlow
;
import
com.byit.dto.plugin.StopFlowParam
;
import
com.byit.model.RunRecording
;
import
com.byit.model.RunRecording
;
import
com.byit.model.vo.RunRecordingVo
;
import
com.byit.model.vo.RunRecordingVo
;
...
@@ -28,7 +29,8 @@ public interface ApiFlowService {
...
@@ -28,7 +29,8 @@ public interface ApiFlowService {
String
stopSchedule
(
String
param
);
String
stopSchedule
(
String
param
);
void
reStartSchedule
(
String
runIds
);
void
reStartSchedule
(
StopFlowParam
stopFlowParam
);
void
publishFlow
(
String
param
)
throws
Exception
;
void
publishFlow
(
String
param
)
throws
Exception
;
...
...
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
b297e9c6
...
@@ -1525,7 +1525,10 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1525,7 +1525,10 @@ public class ApiFlowServiceImpl implements ApiFlowService {
RunRecording
runRecording
=
runRecordingMapper
.
runIngRunRecording
(
flowName
,
byName
.
getWorkspaceId
());
RunRecording
runRecording
=
runRecordingMapper
.
runIngRunRecording
(
flowName
,
byName
.
getWorkspaceId
());
ValidationUtil
.
isTrueValidation
(
runRecording
==
null
,
"没有正在运行中的实例!"
);
ValidationUtil
.
isTrueValidation
(
runRecording
==
null
,
"没有正在运行中的实例!"
);
if
(
"3"
.
equals
(
runRecording
.
getFlowStatus
()))
{
if
(
"3"
.
equals
(
runRecording
.
getFlowStatus
()))
{
reStartSchedule
(
runRecording
.
getRunId
());
StopFlowParam
stopFlowParam
=
new
StopFlowParam
();
stopFlowParam
.
setRunIds
(
runRecording
.
getRunId
());
stopFlowParam
.
setAllStartFlow
(
"1"
);
reStartSchedule
(
stopFlowParam
);
}
else
{
}
else
{
log
.
warn
(
"{},不是出于暂停状态"
,
runRecording
);
log
.
warn
(
"{},不是出于暂停状态"
,
runRecording
);
}
}
...
@@ -1668,7 +1671,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1668,7 +1671,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
reStartSchedule
(
String
runIds
)
{
public
void
reStartSchedule
(
StopFlowParam
stopFlowParam
)
{
ValidationUtil
.
dataNotNull
(
stopFlowParam
,
"执行参数不允许为空!"
);
String
runIds
=
stopFlowParam
.
getRunIds
();
ValidationUtil
.
dataNotBank
(
runIds
,
"运行id不允许为空!"
);
ValidationUtil
.
dataNotBank
(
runIds
,
"运行id不允许为空!"
);
List
<
String
>
runIdList
=
Arrays
.
asList
(
runIds
.
split
(
","
));
List
<
String
>
runIdList
=
Arrays
.
asList
(
runIds
.
split
(
","
));
...
@@ -1681,7 +1686,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -1681,7 +1686,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
if
(
mainRunRecording
!=
null
)
{
if
(
mainRunRecording
!=
null
)
{
stopCount
=
mainRunRecording
.
getStopCount
();
stopCount
=
mainRunRecording
.
getStopCount
();
}
}
if
(
stopCount
!=
null
&&
stopCount
>
0
){
if
(
stopCount
!=
null
&&
stopCount
>
0
&&
"1"
.
equals
(
stopFlowParam
.
getAllStartFlow
())
){
mainRunRecording
.
setStopCount
(--
stopCount
);
mainRunRecording
.
setStopCount
(--
stopCount
);
runRecordingMapper
.
updateRunRecordingById
(
mainRunRecording
);
runRecordingMapper
.
updateRunRecordingById
(
mainRunRecording
);
}
else
{
}
else
{
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
b297e9c6
...
@@ -670,7 +670,7 @@
...
@@ -670,7 +670,7 @@
</update>
</update>
<update
id=
"startByRunId"
parameterType=
"string"
>
<update
id=
"startByRunId"
parameterType=
"string"
>
update run_recording set flow_status = '2'
update run_recording set flow_status = '2'
, stop_count = 0
where run_id = #{runId,jdbcType=VARCHAR}
where run_id = #{runId,jdbcType=VARCHAR}
and flow_status = '3'
and flow_status = '3'
</update>
</update>
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/dto/plugin/StopFlowParam.java
0 → 100644
View file @
b297e9c6
package
com
.
byit
.
dto
.
plugin
;
import
lombok.Data
;
/**
* 暂停工作流参数
*
* @author huangfu
*/
@Data
public
class
StopFlowParam
{
private
String
runIds
;
private
String
allStartFlow
=
"0"
;
private
String
allStartFlowExplanation
=
"0:全部释放;1:单个释放"
;
}
byit-myth-executor/myth-executor-plugin/src/main/java/com/byit/utils/JobUtils.java
View file @
b297e9c6
...
@@ -389,10 +389,10 @@ public class JobUtils {
...
@@ -389,10 +389,10 @@ public class JobUtils {
* @param runIds
* @param runIds
* @return
* @return
*/
*/
public
static
ResponseResult
startSchedule
(
St
ring
runIds
)
{
public
static
ResponseResult
startSchedule
(
St
opFlowParam
stopFlowParam
)
{
log
.
debug
(
"重新开始调度接口
runids:{}"
,
runIds
);
log
.
debug
(
"重新开始调度接口
stopFlowParam:{}"
,
stopFlowParam
);
//发送请求 添加任务
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_REREPEAL
,
"runIds="
+
runIds
);
String
response
=
createHttpRequest
(
REQUEST_FLOW_REREPEAL
,
JSON
.
toJSONString
(
stopFlowParam
,
WriteClassName
)
);
log
.
debug
(
"--------------------重新开始调度接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------重新开始调度接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
}
...
...
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