Commit 4e00659f by guominglei

重新开始调度修改runid为空问题

parent 40921380
...@@ -85,8 +85,8 @@ public class ApiFlowController { ...@@ -85,8 +85,8 @@ public class ApiFlowController {
@PostMapping("reStartSchedule") @PostMapping("reStartSchedule")
@ApiOperation("重新开始某次调度") @ApiOperation("重新开始某次调度")
public ResponseResult reStartSchedule(String param){ public ResponseResult reStartSchedule(String runIds){
apiFlowService.reStartSchedule(param); apiFlowService.reStartSchedule(runIds);
return ResponseResult.ok("SUCCESS"); return ResponseResult.ok("SUCCESS");
} }
......
...@@ -1484,13 +1484,11 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1484,13 +1484,11 @@ public class ApiFlowServiceImpl implements ApiFlowService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void reStartSchedule(String runIds) { public void reStartSchedule(String runIds) {
ValidationUtil.dataNotBank(runIds, "运行id不允许为空!"); ValidationUtil.dataNotBank(runIds, "运行id不允许为空!");
JSONObject jsonObject = JSON.parseObject(runIds);
String runIdStr = jsonObject.getString("runId");
List<String> runIdList = Arrays.asList(runIdStr.split(",")); List<String> runIdList = Arrays.asList(runIds.split(","));
runIdList.forEach(runId -> { runIdList.forEach(runId -> {
List<RunRecording> runRecordList = runRecordingMapper.findStopRunCordByRunId(runId); List<RunRecording> runRecordList = runRecordingMapper.findStopRunCordByRunId(runId);
ValidationUtil.dataNotNull(runRecordList, "运行记录" + runId + "不存在暂停中运行记录!"); ValidationUtil.isTrueValidation(null == runRecordList || runRecordList.size() == 0, "运行记录" + runId + "不存在暂停中运行记录!");
runRecordingMapper.startByRunId(runId); runRecordingMapper.startByRunId(runId);
jobTaskMapper.startByRunId(runId); jobTaskMapper.startByRunId(runId);
}); });
......
...@@ -278,14 +278,12 @@ public class JobUtils { ...@@ -278,14 +278,12 @@ public class JobUtils {
} }
/** /**
* 重新开始某次调度 * 重新开始某次调度
* @param runId * @param runIds
* @return * @return
*/ */
public static ResponseResult startSchedule(String runId){ public static ResponseResult startSchedule(String runIds){
Map<String,Object> map = new HashMap<>(5);
map.put("runId", runId);
//发送请求 添加任务 //发送请求 添加任务
String response = createHttpRequest(REQUEST_FLOW_REREPEAL, "param="+JSON.toJSONString(map,WriteClassName)); String response = createHttpRequest(REQUEST_FLOW_REREPEAL, "runIds=" + runIds);
log.info("--------------------重新开始调度接口调用成功,结果为:{}------------------------", response); log.info("--------------------重新开始调度接口调用成功,结果为:{}------------------------", 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