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
b50eb59a
Commit
b50eb59a
authored
May 27, 2020
by
guominglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作流添加校验是否存在
parent
4e00659f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
0 deletions
+55
-0
ApiFlowController.java
...h-admin/src/main/java/com/byit/api/ApiFlowController.java
+7
-0
ApiFlowService.java
...-admin/src/main/java/com/byit/service/ApiFlowService.java
+9
-0
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+19
-0
JobUtils.java
...xecutor-plugin/src/main/java/com/byit/utils/JobUtils.java
+20
-0
No files found.
byit-myth-admin/src/main/java/com/byit/api/ApiFlowController.java
View file @
b50eb59a
...
...
@@ -55,6 +55,13 @@ public class ApiFlowController {
return
ResponseResult
.
ok
(
"SUCCESS"
);
}
@PostMapping
(
"exist"
)
@ApiOperation
(
"判断工作流是否存在"
)
public
ResponseResult
exist
(
String
param
)
throws
ParseException
{
Boolean
result
=
apiFlowService
.
exist
(
param
);
return
ResponseResult
.
ok
(
result
);
}
@PostMapping
(
"repealSchedule"
)
@ApiOperation
(
"撤销工作流调度,只可以撤销总工作流,若为内嵌工作流不允许撤销"
)
public
ResponseResult
repealSchedule
(
String
param
)
throws
ParseException
{
...
...
byit-myth-admin/src/main/java/com/byit/service/ApiFlowService.java
View file @
b50eb59a
...
...
@@ -103,4 +103,13 @@ public interface ApiFlowService {
* @return
*/
Map
<
String
,
RunRecording
>
loadCurrentStatus
(
String
param
);
/**
* 功能描述 判断工作流是否存在
* @author gml
* @date 2020-05-27 10:12
* @param param
* @return java.lang.Boolean
*/
Boolean
exist
(
String
param
);
}
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
b50eb59a
...
...
@@ -1090,6 +1090,25 @@ public class ApiFlowServiceImpl implements ApiFlowService {
return
statusMap
;
}
@Override
public
Boolean
exist
(
String
param
)
{
ValidationUtil
.
dataNotBank
(
param
,
"请求参数不允许为空!"
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
param
);
//获取工作空间名称
String
workspaceName
=
jsonObject
.
getString
(
"workspaceName"
);
ValidationUtil
.
dataNotBank
(
workspaceName
,
"工作空间名称不允许为空!"
);
Workspace
workspace
=
workspaceMapper
.
getByName
(
workspaceName
);
ValidationUtil
.
dataNotNull
(
workspace
,
workspaceName
+
"工作空间不存在"
);
//获取工作流名称
String
flowName
=
jsonObject
.
getString
(
"flowName"
);
ValidationUtil
.
dataNotBank
(
flowName
,
"工作流名称不允许为空!"
);
Flow
flow
=
flowMapper
.
getByWorkSpaceAndName
(
workspace
.
getWorkspaceId
(),
flowName
);
if
(
null
==
flow
){
return
false
;
}
return
true
;
}
/**
* runState 补批机制 1 补批当前节点 2 补批当前节点及以下节点
* @param param
...
...
byit-myth-executor/myth-executor-plugin/src/main/java/com/byit/utils/JobUtils.java
View file @
b50eb59a
...
...
@@ -50,6 +50,10 @@ public class JobUtils {
*/
private
static
final
String
REQUEST_FLOW_START
=
"/api/flow/start"
;
/**
* 开始工作流
*/
private
static
final
String
REQUEST_FLOW_EXIST
=
"/api/flow/exist"
;
/**
* 暂停工作流
*/
private
static
final
String
REQUEST_FLOW_STOP
=
"/api/flow/stopSchedule"
;
...
...
@@ -235,6 +239,22 @@ public class JobUtils {
* @param workspaceName
* @return
*/
public
static
ResponseResult
existFlow
(
String
flowName
,
String
workspaceName
){
Map
<
String
,
String
>
map
=
new
HashMap
<>(
5
);
map
.
put
(
"flowName"
,
flowName
);
map
.
put
(
"workspaceName"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_EXIST
,
"param="
+
JSON
.
toJSONString
(
map
));
log
.
info
(
"--------------------校验工作流是否存在接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
/**
* 暂停工作流
* @param flowName
* @param workspaceName
* @return
*/
public
static
ResponseResult
stopFlow
(
String
flowName
,
String
workspaceName
){
Map
<
String
,
String
>
map
=
new
HashMap
<>(
5
);
map
.
put
(
"flowName"
,
flowName
);
...
...
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