Commit edb3b0a1 by guominglei

新加暂停指定实例接口

parent c0d36ed8
...@@ -85,11 +85,17 @@ public class ApiFlowController { ...@@ -85,11 +85,17 @@ public class ApiFlowController {
} }
@PostMapping("stopSchedule") @PostMapping("stopSchedule")
@ApiOperation("暂停本次调度") @ApiOperation("暂停工作流所有调度")
public ResponseResult stopSchedule(String param){ public ResponseResult stopSchedule(String param){
return ResponseResult.ok(apiFlowService.stopSchedule(param)); return ResponseResult.ok(apiFlowService.stopSchedule(param));
} }
@PostMapping("stopScheduleByRunId")
@ApiOperation("暂停指定的工作流调度")
public ResponseResult stopScheduleByRunId(String runId){
return ResponseResult.ok(apiFlowService.stopScheduleByRunId(runId));
}
@PostMapping("reStartSchedule") @PostMapping("reStartSchedule")
@ApiOperation("重新开始某次调度") @ApiOperation("重新开始某次调度")
public ResponseResult reStartSchedule(String runIds){ public ResponseResult reStartSchedule(String runIds){
...@@ -133,13 +139,6 @@ public class ApiFlowController { ...@@ -133,13 +139,6 @@ public class ApiFlowController {
return ResponseResult.ok(result); return ResponseResult.ok(result);
} }
public static void main(String[] args) {
int maxValue = Integer.MAX_VALUE;
System.out.println(maxValue+3);
//5184000000
//2147483647
}
/** /**
* *
* @param param * @param param
......
...@@ -112,4 +112,6 @@ public interface ApiFlowService { ...@@ -112,4 +112,6 @@ public interface ApiFlowService {
* @return java.lang.Boolean * @return java.lang.Boolean
*/ */
Boolean exist(String param); Boolean exist(String param);
Boolean stopScheduleByRunId(String runId);
} }
...@@ -1109,6 +1109,19 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1109,6 +1109,19 @@ public class ApiFlowServiceImpl implements ApiFlowService {
return true; return true;
} }
@Override
public Boolean stopScheduleByRunId(String runId) {
RunRecording recording = runRecordingMapper.findAllByRunID(runId);
ValidationUtil.dataNotNull(recording , "查无此运行实例!");
ValidationUtil.isTrueValidation("3".equals(recording.getFlowStatus()) || "4".equals(recording.getFlowStatus()) , "该运行实例没有在运行中!");
//暂停工作流调度
runRecordingMapper.stopByRunId(runId);
jobTaskMapper.stopByRunId(runId);
return true;
}
/** /**
* runState 补批机制 1 补批当前节点 2 补批当前节点及以下节点 * runState 补批机制 1 补批当前节点 2 补批当前节点及以下节点
* @param param * @param param
......
...@@ -148,7 +148,7 @@ public interface RunRecordingMapper { ...@@ -148,7 +148,7 @@ public interface RunRecordingMapper {
* @param runId * @param runId
* @return * @return
*/ */
int killUnFinshFlow(@Param("runId")String runId, @Param("flowId")Integer flowId); int killUnFinshFlow(@Param("runId")String runId);
/** /**
* 杀死工作流内的某个内嵌工作流 * 杀死工作流内的某个内嵌工作流
......
...@@ -630,9 +630,9 @@ ...@@ -630,9 +630,9 @@
and flow_status = '3' and flow_status = '3'
</update> </update>
<update id="killUnFinshFlow" parameterType="string"> <update id="killUnFinshFlow">
update run_recording set flow_status = '4',flow_run_result = '5' update run_recording set flow_status = '4',flow_run_result = '5'
where run_id = #{runId,jdbcType=VARCHAR} and flow_id = #{flowId,jdbcType=INTEGER} where run_id = #{runId,jdbcType=VARCHAR}
and flow_status != '4' and flow_status != '4'
</update> </update>
......
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