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
2f91a636
Commit
2f91a636
authored
May 28, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
00765861
c0d36ed8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
51 deletions
+113
-51
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
+24
-2
RunRecordingMapper.xml
...min-core/src/main/resources/mapper/RunRecordingMapper.xml
+3
-0
JobUtils.java
...xecutor-plugin/src/main/java/com/byit/utils/JobUtils.java
+70
-49
No files found.
byit-myth-admin/src/main/java/com/byit/api/ApiFlowController.java
View file @
2f91a636
...
...
@@ -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 @
2f91a636
...
...
@@ -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 @
2f91a636
...
...
@@ -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
...
...
@@ -1412,12 +1431,15 @@ public class ApiFlowServiceImpl implements ApiFlowService {
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
findOnScheduleByFlowId
(
flow
.
getFlowId
());
ValidationUtil
.
isTrueValidation
(
null
!=
recordingList
&&
recordingList
.
size
()
>
0
,
"工作流已在调度中不允许撤销调度!"
);
List
<
RunRecording
>
unStartRecordingList
=
runRecordingMapper
.
findUnStartByFlowId
(
flow
.
getFlowId
());
if
(
null
!=
unStartRecordingList
&&
unStartRecordingList
.
size
()
>
0
){
//删除对应的task记录
unStartRecordingList
.
forEach
(
runRecording
->
{
ValidationUtil
.
isTrueValidation
((
runRecording
.
getTriggerTime
()
-
System
.
currentTimeMillis
())
<
10000
,
"工作流已在调度中不允许撤销调度"
);
runRecordingMapper
.
deleteByRunId
(
runRecording
.
getRunId
());
jobTaskMapper
.
deleteByRunId
(
runRecording
.
getRunId
());
});
}
//撤销工作流调度
updateFlowStart
(
flow
,
false
);
...
...
@@ -1434,10 +1456,10 @@ public class ApiFlowServiceImpl implements ApiFlowService {
flow
.
setStartUp
(
FlowPropertyEnum
.
IS_START
.
getCode
());
//如果是周期调度修改下次执行时间
if
(
FlowPropertyEnum
.
SCHEDULE_MODE
.
getCode
().
equals
(
flow
.
getExecType
())){
flow
.
setTriggerNextTime
(
new
CronExpression
(
flow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
}
}
else
{
flow
.
setStartUp
(
FlowPropertyEnum
.
NO_START
.
getCode
());
flow
.
setTriggerNextTime
(
new
CronExpression
(
flow
.
getFlowCron
()).
getNextValidTimeAfter
(
new
Date
()).
getTime
());
}
flowMapper
.
updateByIdSelective
(
flow
);
List
<
Node
>
nodeList
=
nodeMapper
.
findVirtualByFlowId
(
flow
.
getFlowId
());
...
...
@@ -1468,7 +1490,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil
.
dataNotNull
(
flow
,
flowName
+
"工作流不存在"
);
ValidationUtil
.
isTrueValidation
(
FlowPropertyEnum
.
IS_INNER
.
getCode
().
equals
(
flow
.
getIsInner
()),
"内嵌工作流不允许停止调度!"
);
//判断是否在调度中
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
find
OnSchedule
ByFlowId
(
flow
.
getFlowId
());
List
<
RunRecording
>
recordingList
=
runRecordingMapper
.
find
UnFinish
ByFlowId
(
flow
.
getFlowId
());
ValidationUtil
.
isTrueValidation
(
null
==
recordingList
||
recordingList
.
size
()
==
0
,
flowName
+
"工作流没有正在运行的调度!"
);
StringBuffer
runids
=
new
StringBuffer
();
//暂停工作流调度
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/RunRecordingMapper.xml
View file @
2f91a636
...
...
@@ -209,6 +209,7 @@
from run_recording
where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName,jdbcType=VARCHAR} and schedule_type != 4
</select>
<select
id=
"findUnFinishByFlowId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
@@ -216,6 +217,7 @@
where flow_id = #{flowId}
and flow_status != '4' and schedule_type != 4
</select>
<select
id=
"findStatusByStartAndEndTime"
resultType=
"com.byit.dto.plugin.StatisticData"
useCache=
"false"
flushCache=
"true"
>
select sum(case when flow_status = '1' then 1 else 0 end ) unstart,
sum(case when flow_status='2' then 1 else 0 end ) runIng,
...
...
@@ -234,6 +236,7 @@
)
</if>
</select>
<select
id=
"findMaxByFlowId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from run_recording
...
...
byit-myth-executor/myth-executor-plugin/src/main/java/com/byit/utils/JobUtils.java
View file @
2f91a636
...
...
@@ -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"
;
...
...
@@ -191,10 +195,10 @@ public class JobUtils {
* @return 添加结果
*/
public
static
ResponseResult
addJob
(
PluginBeanJobInfo
pluginBeanJobInfo
){
log
.
info
(
"---------------开始添加一个任务,jobHandelName:{}---------------------"
,
pluginBeanJobInfo
.
getJobHandelName
());
log
.
debug
(
"---------------开始添加一个任务,jobHandelName:{}---------------------"
,
pluginBeanJobInfo
.
getJobHandelName
());
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_ADD_JOB_RESOURCES_SUFFIX
,
JSON
.
toJSONString
(
pluginBeanJobInfo
));
log
.
info
(
"--------------------添加任务完成,添加结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------添加任务完成,添加结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -204,17 +208,17 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
publish
(
PluginPackage
pluginPackage
){
log
.
info
(
"---------------开始发布工作流,flowName:{}---------------------"
,
pluginPackage
.
getFlow
().
getName
());
log
.
debug
(
"---------------开始发布工作流,flowName:{}---------------------"
,
pluginPackage
.
getFlow
().
getName
());
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_PUBLISH
,
"param="
+
JSON
.
toJSONString
(
pluginPackage
,
WriteClassName
));
//String addRequestResult = HttpUtil.post(requestUrl, JSON.toJSONString(pluginPackage, WriteClassName))
log
.
info
(
"--------------------添加任务完成,添加结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------添加任务完成,添加结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
/**
*
暂停
工作流
*
开始
工作流
* @param flowName
* @param workspaceName
* @return
...
...
@@ -225,7 +229,23 @@ public class JobUtils {
map
.
put
(
"workspaceName"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_START
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
log
.
info
(
"--------------------开始接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------开始接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
/**
* 校验工作流是否存在
* @param flowName
* @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
.
debug
(
"--------------------校验工作流是否存在接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -241,7 +261,7 @@ public class JobUtils {
map
.
put
(
"workspaceName"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_STOP
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
log
.
info
(
"--------------------暂停接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------暂停接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -257,7 +277,7 @@ public class JobUtils {
map
.
put
(
"workspaceName"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_DELETE
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
log
.
info
(
"--------------------删除接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------删除接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -273,7 +293,7 @@ public class JobUtils {
map
.
put
(
"workspaceName"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_REPEAL
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
log
.
info
(
"--------------------删除接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------删除接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
/**
...
...
@@ -282,9 +302,10 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
startSchedule
(
String
runIds
){
log
.
debug
(
"重新开始调度接口 runids:{}"
,
runIds
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_REREPEAL
,
"runIds="
+
runIds
);
log
.
info
(
"--------------------重新开始调度接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------重新开始调度接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -303,7 +324,7 @@ public class JobUtils {
map
.
put
(
"nodeName"
,
nodeName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_KILL_JOB
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
log
.
info
(
"--------------------杀死任务接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------杀死任务接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -319,7 +340,7 @@ public class JobUtils {
map
.
put
(
"workspaceName"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_KILL_FLOW
,
"param="
+
JSON
.
toJSONString
(
map
,
WriteClassName
));
log
.
info
(
"--------------------杀死工作流接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------杀死工作流接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -330,7 +351,7 @@ public class JobUtils {
public
static
ResponseResult
reRunJob
(
RunInfo
runInfo
){
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_RERUNJOB
,
"param="
+
JSON
.
toJSONString
(
runInfo
,
WriteClassName
));
log
.
info
(
"--------------------重跑节点接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------重跑节点接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -342,7 +363,7 @@ public class JobUtils {
public
static
ResponseResult
reRunFlow
(
RunInfo
runInfo
){
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_RERUNFLOW
,
"param="
+
JSON
.
toJSONString
(
runInfo
,
WriteClassName
));
log
.
info
(
"--------------------重跑节点接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------重跑节点接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -353,7 +374,7 @@ public class JobUtils {
public
static
ResponseResult
makeSuccess
(
RunInfo
runInfo
){
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_FLOW_MAKESUCCESS
,
"param="
+
JSON
.
toJSONString
(
runInfo
,
WriteClassName
));
log
.
info
(
"--------------------手动置为成功接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------手动置为成功接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -376,7 +397,7 @@ public class JobUtils {
param
.
put
(
"scheduleStatus"
,
scheduleStatus
);
param
.
put
(
"executeStatus"
,
executeStatus
);
String
response
=
createHttpRequest
(
REQUEST_LOADSCHEDULE
,
"param="
+
JSON
.
toJSONString
(
param
));
log
.
info
(
"--------------------获取运行实例接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取运行实例接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -392,7 +413,7 @@ public class JobUtils {
param
.
put
(
"runId"
,
runId
);
param
.
put
(
"flowName"
,
flowName
);
String
response
=
createHttpRequest
(
REQUEST_LOADSCHEDULELOG
,
"param="
+
JSON
.
toJSONString
(
param
));
log
.
info
(
"--------------------获取工作流运行实例的节点日志接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取工作流运行实例的节点日志接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -409,7 +430,7 @@ public class JobUtils {
param
.
put
(
"endTime"
,
endTime
);
param
.
put
(
"workspaceName"
,
workspaceName
);
String
response
=
createHttpRequest
(
REQUEST_LOADSTATISTICDATA
,
"param="
+
JSON
.
toJSONString
(
param
));
log
.
info
(
"--------------------获取运行的统计数据接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取运行的统计数据接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -428,7 +449,7 @@ public class JobUtils {
param
.
put
(
"workspaceName"
,
workspaceName
);
param
.
put
(
"flowName"
,
flowName
);
String
response
=
createHttpRequest
(
REQUEST_LOADNODESTATISTICDATA
,
"param="
+
JSON
.
toJSONString
(
param
));
log
.
info
(
"--------------------获取节点运行的统计数据接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取节点运行的统计数据接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -443,7 +464,7 @@ public class JobUtils {
param
.
put
(
"workspaceName"
,
workspaceName
);
param
.
put
(
"flowNames"
,
flowNames
);
String
response
=
createHttpRequest
(
REQUEST_LOADCURRENTSTATUS
,
"param="
+
JSON
.
toJSONString
(
param
));
log
.
info
(
"--------------------获取当前的工作流运行状态接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取当前的工作流运行状态接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -463,7 +484,7 @@ public class JobUtils {
param
.
put
(
"repairTimes"
,
repairTimes
);
String
response
=
createHttpRequest
(
REQUEST_REPAIRFLOW
,
"param="
+
JSON
.
toJSONString
(
param
));
log
.
info
(
"--------------------补批工作流接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------补批工作流接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -473,10 +494,10 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
addWorkspace
(
String
workspaceName
){
log
.
info
(
"---------------开始创建工作空间,workspaceName:{}---------------------"
,
workspaceName
);
log
.
debug
(
"---------------开始创建工作空间,workspaceName:{}---------------------"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_WORKSPACE_ADD
,
"workspaceName="
+
workspaceName
);
log
.
info
(
"--------------------创建工作空间接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------创建工作空间接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -486,10 +507,10 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
existWorkspace
(
String
workspaceName
){
log
.
info
(
"---------------判断工作空间是否存在,workspaceName:{}---------------------"
,
workspaceName
);
log
.
debug
(
"---------------判断工作空间是否存在,workspaceName:{}---------------------"
,
workspaceName
);
//发送请求 添加任务
String
response
=
createHttpRequest
(
REQUEST_WORKSPACE_EXIST
,
"workspaceName="
+
workspaceName
);
log
.
info
(
"--------------------判断工作空间是否存在接口调用成功,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------判断工作空间是否存在接口调用成功,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -498,17 +519,17 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
realExectNode
(
RunNode
runNode
){
log
.
info
(
"---------------立即运行节点---------------------"
);
log
.
debug
(
"---------------立即运行节点---------------------"
);
//立即运行节点
String
response
=
createHttpRequest
(
REQUEST_REAL_EXECT
,
"param="
+
JSON
.
toJSONString
(
runNode
));
log
.
info
(
"--------------------立即运行节点,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------立即运行节点,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
public
static
ResponseResult
runHistroy
(
String
nodeId
){
log
.
info
(
"-------------获取运行历史----------------------"
);
log
.
debug
(
"-------------获取运行历史----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_RUN_HISTORY
,
"nodeId="
+
nodeId
);
log
.
info
(
"--------------------获取运行历史,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取运行历史,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -520,9 +541,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult
*/
public
static
ResponseResult
addJavaTask
(
JavaTask
javaTask
){
log
.
info
(
"-------------添加任务----------------------"
);
log
.
debug
(
"-------------添加任务----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_ADD_JAVATASK
,
"param="
+
JSON
.
toJSONString
(
javaTask
,
WriteClassName
));
log
.
info
(
"--------------------添加任务,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------添加任务,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -534,9 +555,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult
*/
public
static
ResponseResult
updateJavaTask
(
JavaTask
javaTask
){
log
.
info
(
"-------------修改任务----------------------"
);
log
.
debug
(
"-------------修改任务----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_UPDATE_JAVATASK
,
"param="
+
JSON
.
toJSONString
(
javaTask
,
WriteClassName
));
log
.
info
(
"--------------------修改任务,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------修改任务,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -548,9 +569,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult
*/
public
static
ResponseResult
deleteJavaTask
(
String
jobName
){
log
.
info
(
"-------------删除任务----------------------"
);
log
.
debug
(
"-------------删除任务----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_DELETE_JAVATASK
,
"jobName="
+
jobName
);
log
.
info
(
"--------------------删除任务,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------删除任务,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -562,9 +583,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult
*/
public
static
ResponseResult
existJavaTask
(
String
jobName
){
log
.
info
(
"-------------判断是否存在任务----------------------"
);
log
.
debug
(
"-------------判断是否存在任务----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_EXIST_JAVATASK
,
"jobName="
+
jobName
);
log
.
info
(
"--------------------判断是否存在任务,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------判断是否存在任务,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -578,13 +599,13 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult
*/
public
static
ResponseResult
loadLogByJobName
(
String
jobName
,
Long
startTime
,
Long
endTime
){
log
.
info
(
"-------------根据jobName获取运行日志----------------------"
);
log
.
debug
(
"-------------根据jobName获取运行日志----------------------"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"jobName"
,
jobName
);
map
.
put
(
"startTime"
,
startTime
);
map
.
put
(
"endTime"
,
endTime
);
String
response
=
createHttpRequest
(
REQUEST_LOADLOG_JOBNAME
,
"param="
+
JSON
.
toJSONString
(
map
));
log
.
info
(
"--------------------根据jobName获取运行日志,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------根据jobName获取运行日志,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -598,13 +619,13 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult
*/
public
static
ResponseResult
loadLogByTaskName
(
String
taskName
,
Long
startTime
,
Long
endTime
){
log
.
info
(
"-------------根据taskName获取运行日志----------------------"
);
log
.
debug
(
"-------------根据taskName获取运行日志----------------------"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"taskName"
,
taskName
);
map
.
put
(
"startTime"
,
startTime
);
map
.
put
(
"endTime"
,
endTime
);
String
response
=
createHttpRequest
(
REQUEST_LOADLOG_TASKNAME
,
"param="
+
JSON
.
toJSONString
(
map
));
log
.
info
(
"--------------------根据taskName获取运行日志,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------根据taskName获取运行日志,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -614,9 +635,9 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
runJavaTask
(
String
jobName
){
log
.
info
(
"-------------立即运行quartz任务----------------------"
);
log
.
debug
(
"-------------立即运行quartz任务----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_RUN_JAVATASK
,
"jobName="
+
jobName
);
log
.
info
(
"--------------------立即运行quartz任务,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------立即运行quartz任务,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -626,9 +647,9 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
runTask
(
JavaTask
javaTask
){
log
.
info
(
"-------------立即运行quartz任务----------------------"
);
log
.
debug
(
"-------------立即运行quartz任务----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_RUN_TASK
,
"param="
+
JSON
.
toJSONString
(
javaTask
,
WriteClassName
));
log
.
info
(
"--------------------立即运行quartz任务,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------立即运行quartz任务,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -638,9 +659,9 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
loadCurrentStatusByJobName
(
String
jobNames
){
log
.
info
(
"-------------获取当前的运行状态----------------------"
);
log
.
debug
(
"-------------获取当前的运行状态----------------------"
);
String
response
=
createHttpRequest
(
REQUEST_LOADSTATUS_JAVATASK
,
"jobNames="
+
jobNames
);
log
.
info
(
"--------------------获取当前的运行状态,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取当前的运行状态,结果为:{}------------------------"
,
response
);
return
JSON
.
parseObject
(
response
,
ResponseResult
.
class
);
}
...
...
@@ -650,9 +671,9 @@ public class JobUtils {
* @return
*/
public
static
ResponseResult
killRunNode
(
Integer
logId
)
{
log
.
info
(
"-------------杀死当前运行的节点----------------------"
);
log
.
debug
(
"-------------杀死当前运行的节点----------------------"
);
String
response
=
createHttpRequest
(
KILL_NODE_RUN_ING
,
"logId="
+
logId
);
log
.
info
(
"--------------------获取当前的运行状态,结果为:{}------------------------"
,
response
);
log
.
debug
(
"--------------------获取当前的运行状态,结果为:{}------------------------"
,
response
);
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