Commit 2f91a636 by huangfusuper

Merge remote-tracking branch 'origin/developer' into developer

parents 00765861 c0d36ed8
...@@ -55,6 +55,13 @@ public class ApiFlowController { ...@@ -55,6 +55,13 @@ public class ApiFlowController {
return ResponseResult.ok("SUCCESS"); 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") @PostMapping("repealSchedule")
@ApiOperation("撤销工作流调度,只可以撤销总工作流,若为内嵌工作流不允许撤销") @ApiOperation("撤销工作流调度,只可以撤销总工作流,若为内嵌工作流不允许撤销")
public ResponseResult repealSchedule(String param) throws ParseException { public ResponseResult repealSchedule(String param) throws ParseException {
......
...@@ -103,4 +103,13 @@ public interface ApiFlowService { ...@@ -103,4 +103,13 @@ public interface ApiFlowService {
* @return * @return
*/ */
Map<String, RunRecording> loadCurrentStatus(String param); Map<String, RunRecording> loadCurrentStatus(String param);
/**
* 功能描述 判断工作流是否存在
* @author gml
* @date 2020-05-27 10:12
* @param param
* @return java.lang.Boolean
*/
Boolean exist(String param);
} }
...@@ -1090,6 +1090,25 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1090,6 +1090,25 @@ public class ApiFlowServiceImpl implements ApiFlowService {
return statusMap; 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 补批当前节点及以下节点 * runState 补批机制 1 补批当前节点 2 补批当前节点及以下节点
* @param param * @param param
...@@ -1412,12 +1431,15 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1412,12 +1431,15 @@ public class ApiFlowServiceImpl implements ApiFlowService {
List<RunRecording> recordingList = runRecordingMapper.findOnScheduleByFlowId(flow.getFlowId()); List<RunRecording> recordingList = runRecordingMapper.findOnScheduleByFlowId(flow.getFlowId());
ValidationUtil.isTrueValidation(null != recordingList && recordingList.size() > 0 , "工作流已在调度中不允许撤销调度!"); ValidationUtil.isTrueValidation(null != recordingList && recordingList.size() > 0 , "工作流已在调度中不允许撤销调度!");
List<RunRecording> unStartRecordingList = runRecordingMapper.findUnStartByFlowId(flow.getFlowId()); List<RunRecording> unStartRecordingList = runRecordingMapper.findUnStartByFlowId(flow.getFlowId());
//删除对应的task记录 if (null != unStartRecordingList && unStartRecordingList.size() > 0){
unStartRecordingList.forEach(runRecording -> { //删除对应的task记录
ValidationUtil.isTrueValidation((runRecording.getTriggerTime() - System.currentTimeMillis()) < 10000 , "工作流已在调度中不允许撤销调度"); unStartRecordingList.forEach(runRecording -> {
runRecordingMapper.deleteByRunId(runRecording.getRunId()); ValidationUtil.isTrueValidation((runRecording.getTriggerTime() - System.currentTimeMillis()) < 10000 , "工作流已在调度中不允许撤销调度");
jobTaskMapper.deleteByRunId(runRecording.getRunId()); runRecordingMapper.deleteByRunId(runRecording.getRunId());
}); jobTaskMapper.deleteByRunId(runRecording.getRunId());
});
}
//撤销工作流调度 //撤销工作流调度
updateFlowStart(flow, false); updateFlowStart(flow, false);
...@@ -1434,10 +1456,10 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1434,10 +1456,10 @@ public class ApiFlowServiceImpl implements ApiFlowService {
flow.setStartUp(FlowPropertyEnum.IS_START.getCode()); flow.setStartUp(FlowPropertyEnum.IS_START.getCode());
//如果是周期调度修改下次执行时间 //如果是周期调度修改下次执行时间
if (FlowPropertyEnum.SCHEDULE_MODE.getCode().equals(flow.getExecType())){ if (FlowPropertyEnum.SCHEDULE_MODE.getCode().equals(flow.getExecType())){
flow.setTriggerNextTime(new CronExpression(flow.getFlowCron()).getNextValidTimeAfter(new Date()).getTime());
} }
}else { }else {
flow.setStartUp(FlowPropertyEnum.NO_START.getCode()); flow.setStartUp(FlowPropertyEnum.NO_START.getCode());
flow.setTriggerNextTime(new CronExpression(flow.getFlowCron()).getNextValidTimeAfter(new Date()).getTime());
} }
flowMapper.updateByIdSelective(flow); flowMapper.updateByIdSelective(flow);
List<Node> nodeList = nodeMapper.findVirtualByFlowId(flow.getFlowId()); List<Node> nodeList = nodeMapper.findVirtualByFlowId(flow.getFlowId());
...@@ -1468,7 +1490,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1468,7 +1490,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil.dataNotNull(flow, flowName + "工作流不存在"); ValidationUtil.dataNotNull(flow, flowName + "工作流不存在");
ValidationUtil.isTrueValidation(FlowPropertyEnum.IS_INNER.getCode().equals(flow.getIsInner()), "内嵌工作流不允许停止调度!"); ValidationUtil.isTrueValidation(FlowPropertyEnum.IS_INNER.getCode().equals(flow.getIsInner()), "内嵌工作流不允许停止调度!");
//判断是否在调度中 //判断是否在调度中
List<RunRecording> recordingList = runRecordingMapper.findOnScheduleByFlowId(flow.getFlowId()); List<RunRecording> recordingList = runRecordingMapper.findUnFinishByFlowId(flow.getFlowId());
ValidationUtil.isTrueValidation(null == recordingList || recordingList.size() == 0 , flowName + "工作流没有正在运行的调度!"); ValidationUtil.isTrueValidation(null == recordingList || recordingList.size() == 0 , flowName + "工作流没有正在运行的调度!");
StringBuffer runids = new StringBuffer(); StringBuffer runids = new StringBuffer();
//暂停工作流调度 //暂停工作流调度
......
...@@ -209,6 +209,7 @@ ...@@ -209,6 +209,7 @@
from run_recording from run_recording
where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName,jdbcType=VARCHAR} and schedule_type != 4 where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName,jdbcType=VARCHAR} and schedule_type != 4
</select> </select>
<select id="findUnFinishByFlowId" resultMap="BaseResultMap"> <select id="findUnFinishByFlowId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
...@@ -216,24 +217,26 @@ ...@@ -216,24 +217,26 @@
where flow_id = #{flowId} where flow_id = #{flowId}
and flow_status != '4' and schedule_type != 4 and flow_status != '4' and schedule_type != 4
</select> </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, <select id="findStatusByStartAndEndTime" resultType="com.byit.dto.plugin.StatisticData" useCache="false" flushCache="true">
sum(case when flow_status='2' then 1 else 0 end ) runIng, select sum(case when flow_status = '1' then 1 else 0 end ) unstart,
sum(case when flow_status='3' then 1 else 0 end ) stop, sum(case when flow_status='2' then 1 else 0 end ) runIng,
sum(case when flow_status='4' and (flow_run_result = '1' or flow_run_result = '3') then 1 else 0 end ) success, sum(case when flow_status='3' then 1 else 0 end ) stop,
sum(case when flow_status='4' and (flow_run_result = '2' or flow_run_result = '4') then 1 else 0 end ) fail, sum(case when flow_status='4' and (flow_run_result = '1' or flow_run_result = '3') then 1 else 0 end ) success,
sum(case when flow_run_result='5' then 1 else 0 end ) 'kill' sum(case when flow_status='4' and (flow_run_result = '2' or flow_run_result = '4') then 1 else 0 end ) fail,
from run_recording sum(case when flow_run_result='5' then 1 else 0 end ) 'kill'
where (end_time &lt;= #{endTime} or start_time &lt;= #{endTime}) from run_recording
and start_time &gt;= #{startTime} and schedule_type != 4 where (end_time &lt;= #{endTime} or start_time &lt;= #{endTime})
<if test="flowIdList != null"> and start_time &gt;= #{startTime} and schedule_type != 4
and flow_id in ( <if test="flowIdList != null">
<foreach collection="flowIdList" item="flowId" separator=","> and flow_id in (
#{flowId} <foreach collection="flowIdList" item="flowId" separator=",">
</foreach> #{flowId}
) </foreach>
</if> )
</select> </if>
</select>
<select id="findMaxByFlowId" resultMap="BaseResultMap"> <select id="findMaxByFlowId" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> select <include refid="Base_Column_List" />
from run_recording from run_recording
......
...@@ -50,6 +50,10 @@ public class JobUtils { ...@@ -50,6 +50,10 @@ public class JobUtils {
*/ */
private static final String REQUEST_FLOW_START = "/api/flow/start"; 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"; private static final String REQUEST_FLOW_STOP = "/api/flow/stopSchedule";
...@@ -191,10 +195,10 @@ public class JobUtils { ...@@ -191,10 +195,10 @@ public class JobUtils {
* @return 添加结果 * @return 添加结果
*/ */
public static ResponseResult addJob(PluginBeanJobInfo pluginBeanJobInfo){ 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)); String response = createHttpRequest(REQUEST_ADD_JOB_RESOURCES_SUFFIX, JSON.toJSONString(pluginBeanJobInfo));
log.info("--------------------添加任务完成,添加结果为:{}------------------------", response); log.debug("--------------------添加任务完成,添加结果为:{}------------------------", response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -204,17 +208,17 @@ public class JobUtils { ...@@ -204,17 +208,17 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult publish(PluginPackage pluginPackage){ 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 response = createHttpRequest(REQUEST_FLOW_PUBLISH, "param=" + JSON.toJSONString(pluginPackage, WriteClassName));
//String addRequestResult = HttpUtil.post(requestUrl, 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); return JSON.parseObject(response, ResponseResult.class);
} }
/** /**
* 暂停工作流 * 开始工作流
* @param flowName * @param flowName
* @param workspaceName * @param workspaceName
* @return * @return
...@@ -225,7 +229,23 @@ public class JobUtils { ...@@ -225,7 +229,23 @@ public class JobUtils {
map.put("workspaceName",workspaceName); map.put("workspaceName",workspaceName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_START, "param="+JSON.toJSONString(map,WriteClassName)); 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); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -241,7 +261,7 @@ public class JobUtils { ...@@ -241,7 +261,7 @@ public class JobUtils {
map.put("workspaceName",workspaceName); map.put("workspaceName",workspaceName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_STOP,"param="+JSON.toJSONString(map,WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_STOP,"param="+JSON.toJSONString(map,WriteClassName));
log.info("--------------------暂停接口调用成功,结果为:{}------------------------",response); log.debug("--------------------暂停接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -257,7 +277,7 @@ public class JobUtils { ...@@ -257,7 +277,7 @@ public class JobUtils {
map.put("workspaceName",workspaceName); map.put("workspaceName",workspaceName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_DELETE,"param="+JSON.toJSONString(map,WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_DELETE,"param="+JSON.toJSONString(map,WriteClassName));
log.info("--------------------删除接口调用成功,结果为:{}------------------------", response); log.debug("--------------------删除接口调用成功,结果为:{}------------------------", response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -273,7 +293,7 @@ public class JobUtils { ...@@ -273,7 +293,7 @@ public class JobUtils {
map.put("workspaceName",workspaceName); map.put("workspaceName",workspaceName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_REPEAL,"param="+JSON.toJSONString(map,WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_REPEAL,"param="+JSON.toJSONString(map,WriteClassName));
log.info("--------------------删除接口调用成功,结果为:{}------------------------",response); log.debug("--------------------删除接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
/** /**
...@@ -282,9 +302,10 @@ public class JobUtils { ...@@ -282,9 +302,10 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult startSchedule(String runIds){ public static ResponseResult startSchedule(String runIds){
log.debug("重新开始调度接口 runids:{}",runIds);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_REREPEAL, "runIds=" + runIds); String response = createHttpRequest(REQUEST_FLOW_REREPEAL, "runIds=" + runIds);
log.info("--------------------重新开始调度接口调用成功,结果为:{}------------------------", response); log.debug("--------------------重新开始调度接口调用成功,结果为:{}------------------------", response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -303,7 +324,7 @@ public class JobUtils { ...@@ -303,7 +324,7 @@ public class JobUtils {
map.put("nodeName", nodeName); map.put("nodeName", nodeName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_KILL_JOB,"param="+JSON.toJSONString(map,WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_KILL_JOB,"param="+JSON.toJSONString(map,WriteClassName));
log.info("--------------------杀死任务接口调用成功,结果为:{}------------------------",response); log.debug("--------------------杀死任务接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -319,7 +340,7 @@ public class JobUtils { ...@@ -319,7 +340,7 @@ public class JobUtils {
map.put("workspaceName", workspaceName); map.put("workspaceName", workspaceName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_KILL_FLOW, "param="+JSON.toJSONString(map,WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_KILL_FLOW, "param="+JSON.toJSONString(map,WriteClassName));
log.info("--------------------杀死工作流接口调用成功,结果为:{}------------------------",response); log.debug("--------------------杀死工作流接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -330,7 +351,7 @@ public class JobUtils { ...@@ -330,7 +351,7 @@ public class JobUtils {
public static ResponseResult reRunJob(RunInfo runInfo){ public static ResponseResult reRunJob(RunInfo runInfo){
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_RERUNJOB,"param="+JSON.toJSONString(runInfo, WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_RERUNJOB,"param="+JSON.toJSONString(runInfo, WriteClassName));
log.info("--------------------重跑节点接口调用成功,结果为:{}------------------------",response); log.debug("--------------------重跑节点接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -342,7 +363,7 @@ public class JobUtils { ...@@ -342,7 +363,7 @@ public class JobUtils {
public static ResponseResult reRunFlow(RunInfo runInfo){ public static ResponseResult reRunFlow(RunInfo runInfo){
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_RERUNFLOW,"param="+JSON.toJSONString(runInfo, WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_RERUNFLOW,"param="+JSON.toJSONString(runInfo, WriteClassName));
log.info("--------------------重跑节点接口调用成功,结果为:{}------------------------",response); log.debug("--------------------重跑节点接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -353,7 +374,7 @@ public class JobUtils { ...@@ -353,7 +374,7 @@ public class JobUtils {
public static ResponseResult makeSuccess(RunInfo runInfo){ public static ResponseResult makeSuccess(RunInfo runInfo){
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_MAKESUCCESS,"param="+JSON.toJSONString(runInfo, WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_MAKESUCCESS,"param="+JSON.toJSONString(runInfo, WriteClassName));
log.info("--------------------手动置为成功接口调用成功,结果为:{}------------------------",response); log.debug("--------------------手动置为成功接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -376,7 +397,7 @@ public class JobUtils { ...@@ -376,7 +397,7 @@ public class JobUtils {
param.put("scheduleStatus", scheduleStatus); param.put("scheduleStatus", scheduleStatus);
param.put("executeStatus", executeStatus); param.put("executeStatus", executeStatus);
String response = createHttpRequest(REQUEST_LOADSCHEDULE, "param=" + JSON.toJSONString(param)); String response = createHttpRequest(REQUEST_LOADSCHEDULE, "param=" + JSON.toJSONString(param));
log.info("--------------------获取运行实例接口调用成功,结果为:{}------------------------",response); log.debug("--------------------获取运行实例接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -392,7 +413,7 @@ public class JobUtils { ...@@ -392,7 +413,7 @@ public class JobUtils {
param.put("runId", runId); param.put("runId", runId);
param.put("flowName", flowName); param.put("flowName", flowName);
String response = createHttpRequest(REQUEST_LOADSCHEDULELOG, "param=" + JSON.toJSONString(param)); String response = createHttpRequest(REQUEST_LOADSCHEDULELOG, "param=" + JSON.toJSONString(param));
log.info("--------------------获取工作流运行实例的节点日志接口调用成功,结果为:{}------------------------",response); log.debug("--------------------获取工作流运行实例的节点日志接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -409,7 +430,7 @@ public class JobUtils { ...@@ -409,7 +430,7 @@ public class JobUtils {
param.put("endTime", endTime); param.put("endTime", endTime);
param.put("workspaceName", workspaceName); param.put("workspaceName", workspaceName);
String response = createHttpRequest(REQUEST_LOADSTATISTICDATA, "param=" + JSON.toJSONString(param)); String response = createHttpRequest(REQUEST_LOADSTATISTICDATA, "param=" + JSON.toJSONString(param));
log.info("--------------------获取运行的统计数据接口调用成功,结果为:{}------------------------",response); log.debug("--------------------获取运行的统计数据接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -428,7 +449,7 @@ public class JobUtils { ...@@ -428,7 +449,7 @@ public class JobUtils {
param.put("workspaceName", workspaceName); param.put("workspaceName", workspaceName);
param.put("flowName", flowName); param.put("flowName", flowName);
String response = createHttpRequest(REQUEST_LOADNODESTATISTICDATA, "param=" + JSON.toJSONString(param)); String response = createHttpRequest(REQUEST_LOADNODESTATISTICDATA, "param=" + JSON.toJSONString(param));
log.info("--------------------获取节点运行的统计数据接口调用成功,结果为:{}------------------------",response); log.debug("--------------------获取节点运行的统计数据接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -443,7 +464,7 @@ public class JobUtils { ...@@ -443,7 +464,7 @@ public class JobUtils {
param.put("workspaceName", workspaceName); param.put("workspaceName", workspaceName);
param.put("flowNames", flowNames); param.put("flowNames", flowNames);
String response = createHttpRequest(REQUEST_LOADCURRENTSTATUS, "param=" + JSON.toJSONString(param)); String response = createHttpRequest(REQUEST_LOADCURRENTSTATUS, "param=" + JSON.toJSONString(param));
log.info("--------------------获取当前的工作流运行状态接口调用成功,结果为:{}------------------------",response); log.debug("--------------------获取当前的工作流运行状态接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -463,7 +484,7 @@ public class JobUtils { ...@@ -463,7 +484,7 @@ public class JobUtils {
param.put("repairTimes", repairTimes); param.put("repairTimes", repairTimes);
String response = createHttpRequest(REQUEST_REPAIRFLOW, "param=" + JSON.toJSONString(param)); String response = createHttpRequest(REQUEST_REPAIRFLOW, "param=" + JSON.toJSONString(param));
log.info("--------------------补批工作流接口调用成功,结果为:{}------------------------",response); log.debug("--------------------补批工作流接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -473,10 +494,10 @@ public class JobUtils { ...@@ -473,10 +494,10 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult addWorkspace(String workspaceName){ public static ResponseResult addWorkspace(String workspaceName){
log.info("---------------开始创建工作空间,workspaceName:{}---------------------", workspaceName); log.debug("---------------开始创建工作空间,workspaceName:{}---------------------", workspaceName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_WORKSPACE_ADD, "workspaceName="+ workspaceName); String response = createHttpRequest(REQUEST_WORKSPACE_ADD, "workspaceName="+ workspaceName);
log.info("--------------------创建工作空间接口调用成功,结果为:{}------------------------",response); log.debug("--------------------创建工作空间接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -486,10 +507,10 @@ public class JobUtils { ...@@ -486,10 +507,10 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult existWorkspace(String workspaceName){ public static ResponseResult existWorkspace(String workspaceName){
log.info("---------------判断工作空间是否存在,workspaceName:{}---------------------", workspaceName); log.debug("---------------判断工作空间是否存在,workspaceName:{}---------------------", workspaceName);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_WORKSPACE_EXIST, "workspaceName="+ workspaceName); String response = createHttpRequest(REQUEST_WORKSPACE_EXIST, "workspaceName="+ workspaceName);
log.info("--------------------判断工作空间是否存在接口调用成功,结果为:{}------------------------",response); log.debug("--------------------判断工作空间是否存在接口调用成功,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -498,17 +519,17 @@ public class JobUtils { ...@@ -498,17 +519,17 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult realExectNode(RunNode runNode){ public static ResponseResult realExectNode(RunNode runNode){
log.info("---------------立即运行节点---------------------"); log.debug("---------------立即运行节点---------------------");
//立即运行节点 //立即运行节点
String response = createHttpRequest(REQUEST_REAL_EXECT, "param=" + JSON.toJSONString(runNode)); String response = createHttpRequest(REQUEST_REAL_EXECT, "param=" + JSON.toJSONString(runNode));
log.info("--------------------立即运行节点,结果为:{}------------------------",response); log.debug("--------------------立即运行节点,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
public static ResponseResult runHistroy(String nodeId){ public static ResponseResult runHistroy(String nodeId){
log.info("-------------获取运行历史----------------------"); log.debug("-------------获取运行历史----------------------");
String response = createHttpRequest(REQUEST_RUN_HISTORY, "nodeId=" + nodeId); String response = createHttpRequest(REQUEST_RUN_HISTORY, "nodeId=" + nodeId);
log.info("--------------------获取运行历史,结果为:{}------------------------",response); log.debug("--------------------获取运行历史,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -520,9 +541,9 @@ public class JobUtils { ...@@ -520,9 +541,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult * @return com.byit.dto.web.ResponseResult
*/ */
public static ResponseResult addJavaTask(JavaTask javaTask){ public static ResponseResult addJavaTask(JavaTask javaTask){
log.info("-------------添加任务----------------------"); log.debug("-------------添加任务----------------------");
String response = createHttpRequest(REQUEST_ADD_JAVATASK, "param=" + JSON.toJSONString(javaTask, WriteClassName)); String response = createHttpRequest(REQUEST_ADD_JAVATASK, "param=" + JSON.toJSONString(javaTask, WriteClassName));
log.info("--------------------添加任务,结果为:{}------------------------",response); log.debug("--------------------添加任务,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -534,9 +555,9 @@ public class JobUtils { ...@@ -534,9 +555,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult * @return com.byit.dto.web.ResponseResult
*/ */
public static ResponseResult updateJavaTask(JavaTask javaTask){ public static ResponseResult updateJavaTask(JavaTask javaTask){
log.info("-------------修改任务----------------------"); log.debug("-------------修改任务----------------------");
String response = createHttpRequest(REQUEST_UPDATE_JAVATASK, "param=" + JSON.toJSONString(javaTask, WriteClassName)); String response = createHttpRequest(REQUEST_UPDATE_JAVATASK, "param=" + JSON.toJSONString(javaTask, WriteClassName));
log.info("--------------------修改任务,结果为:{}------------------------",response); log.debug("--------------------修改任务,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -548,9 +569,9 @@ public class JobUtils { ...@@ -548,9 +569,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult * @return com.byit.dto.web.ResponseResult
*/ */
public static ResponseResult deleteJavaTask(String jobName){ public static ResponseResult deleteJavaTask(String jobName){
log.info("-------------删除任务----------------------"); log.debug("-------------删除任务----------------------");
String response = createHttpRequest(REQUEST_DELETE_JAVATASK, "jobName=" + jobName); String response = createHttpRequest(REQUEST_DELETE_JAVATASK, "jobName=" + jobName);
log.info("--------------------删除任务,结果为:{}------------------------",response); log.debug("--------------------删除任务,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -562,9 +583,9 @@ public class JobUtils { ...@@ -562,9 +583,9 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult * @return com.byit.dto.web.ResponseResult
*/ */
public static ResponseResult existJavaTask(String jobName){ public static ResponseResult existJavaTask(String jobName){
log.info("-------------判断是否存在任务----------------------"); log.debug("-------------判断是否存在任务----------------------");
String response = createHttpRequest(REQUEST_EXIST_JAVATASK, "jobName=" + jobName); String response = createHttpRequest(REQUEST_EXIST_JAVATASK, "jobName=" + jobName);
log.info("--------------------判断是否存在任务,结果为:{}------------------------",response); log.debug("--------------------判断是否存在任务,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -578,13 +599,13 @@ public class JobUtils { ...@@ -578,13 +599,13 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult * @return com.byit.dto.web.ResponseResult
*/ */
public static ResponseResult loadLogByJobName(String jobName, Long startTime, Long endTime){ public static ResponseResult loadLogByJobName(String jobName, Long startTime, Long endTime){
log.info("-------------根据jobName获取运行日志----------------------"); log.debug("-------------根据jobName获取运行日志----------------------");
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("jobName", jobName); map.put("jobName", jobName);
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
String response = createHttpRequest(REQUEST_LOADLOG_JOBNAME, "param=" + JSON.toJSONString(map)); String response = createHttpRequest(REQUEST_LOADLOG_JOBNAME, "param=" + JSON.toJSONString(map));
log.info("--------------------根据jobName获取运行日志,结果为:{}------------------------",response); log.debug("--------------------根据jobName获取运行日志,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -598,13 +619,13 @@ public class JobUtils { ...@@ -598,13 +619,13 @@ public class JobUtils {
* @return com.byit.dto.web.ResponseResult * @return com.byit.dto.web.ResponseResult
*/ */
public static ResponseResult loadLogByTaskName(String taskName, Long startTime, Long endTime){ public static ResponseResult loadLogByTaskName(String taskName, Long startTime, Long endTime){
log.info("-------------根据taskName获取运行日志----------------------"); log.debug("-------------根据taskName获取运行日志----------------------");
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("taskName", taskName); map.put("taskName", taskName);
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
String response = createHttpRequest(REQUEST_LOADLOG_TASKNAME, "param=" + JSON.toJSONString(map)); String response = createHttpRequest(REQUEST_LOADLOG_TASKNAME, "param=" + JSON.toJSONString(map));
log.info("--------------------根据taskName获取运行日志,结果为:{}------------------------",response); log.debug("--------------------根据taskName获取运行日志,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -614,9 +635,9 @@ public class JobUtils { ...@@ -614,9 +635,9 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult runJavaTask(String jobName){ public static ResponseResult runJavaTask(String jobName){
log.info("-------------立即运行quartz任务----------------------"); log.debug("-------------立即运行quartz任务----------------------");
String response = createHttpRequest(REQUEST_RUN_JAVATASK, "jobName=" + jobName); String response = createHttpRequest(REQUEST_RUN_JAVATASK, "jobName=" + jobName);
log.info("--------------------立即运行quartz任务,结果为:{}------------------------",response); log.debug("--------------------立即运行quartz任务,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -626,9 +647,9 @@ public class JobUtils { ...@@ -626,9 +647,9 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult runTask(JavaTask javaTask){ public static ResponseResult runTask(JavaTask javaTask){
log.info("-------------立即运行quartz任务----------------------"); log.debug("-------------立即运行quartz任务----------------------");
String response = createHttpRequest(REQUEST_RUN_TASK, "param=" + JSON.toJSONString(javaTask,WriteClassName)); 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); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -638,9 +659,9 @@ public class JobUtils { ...@@ -638,9 +659,9 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult loadCurrentStatusByJobName(String jobNames){ public static ResponseResult loadCurrentStatusByJobName(String jobNames){
log.info("-------------获取当前的运行状态----------------------"); log.debug("-------------获取当前的运行状态----------------------");
String response = createHttpRequest(REQUEST_LOADSTATUS_JAVATASK, "jobNames=" + jobNames); String response = createHttpRequest(REQUEST_LOADSTATUS_JAVATASK, "jobNames=" + jobNames);
log.info("--------------------获取当前的运行状态,结果为:{}------------------------",response); log.debug("--------------------获取当前的运行状态,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
...@@ -650,9 +671,9 @@ public class JobUtils { ...@@ -650,9 +671,9 @@ public class JobUtils {
* @return * @return
*/ */
public static ResponseResult killRunNode(Integer logId) { public static ResponseResult killRunNode(Integer logId) {
log.info("-------------杀死当前运行的节点----------------------"); log.debug("-------------杀死当前运行的节点----------------------");
String response = createHttpRequest(KILL_NODE_RUN_ING, "logId=" + logId); String response = createHttpRequest(KILL_NODE_RUN_ING, "logId=" + logId);
log.info("--------------------获取当前的运行状态,结果为:{}------------------------",response); log.debug("--------------------获取当前的运行状态,结果为:{}------------------------",response);
return JSON.parseObject(response, ResponseResult.class); return JSON.parseObject(response, ResponseResult.class);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment