Commit 03ae12a3 by huangfusuper

重跑增加操作人

parent e28c900e
...@@ -2,6 +2,7 @@ package com.byit.api; ...@@ -2,6 +2,7 @@ package com.byit.api;
import com.byit.dto.executor.KillDto; import com.byit.dto.executor.KillDto;
import com.byit.dto.plugin.CollectData; import com.byit.dto.plugin.CollectData;
import com.byit.dto.plugin.RunInfo;
import com.byit.dto.plugin.StopFlowParam; import com.byit.dto.plugin.StopFlowParam;
import com.byit.dto.recording.LoadScheduleCondition; import com.byit.dto.recording.LoadScheduleCondition;
import com.byit.dto.specials.RepairFlow; import com.byit.dto.specials.RepairFlow;
...@@ -122,9 +123,8 @@ public class ApiFlowController { ...@@ -122,9 +123,8 @@ public class ApiFlowController {
@PostMapping("reRunFlow") @PostMapping("reRunFlow")
@ApiOperation("重跑工作流") @ApiOperation("重跑工作流")
public ResponseResult reRunFlow(String param) { public void reRunFlow(@RequestBody RunInfo param) {
apiFlowService.reRunFlow(param); apiFlowService.reRunFlow(param);
return ResponseResult.ok("SUCCESS");
} }
@PostMapping("madeSuccess") @PostMapping("madeSuccess")
......
...@@ -2,6 +2,7 @@ package com.byit.service; ...@@ -2,6 +2,7 @@ package com.byit.service;
import com.byit.dto.plugin.CollectData; import com.byit.dto.plugin.CollectData;
import com.byit.dto.plugin.PluginFlow; import com.byit.dto.plugin.PluginFlow;
import com.byit.dto.plugin.RunInfo;
import com.byit.dto.plugin.StopFlowParam; import com.byit.dto.plugin.StopFlowParam;
import com.byit.dto.recording.LoadScheduleCondition; import com.byit.dto.recording.LoadScheduleCondition;
import com.byit.dto.specials.RepairFlow; import com.byit.dto.specials.RepairFlow;
...@@ -60,7 +61,7 @@ public interface ApiFlowService { ...@@ -60,7 +61,7 @@ public interface ApiFlowService {
* 重跑工作流 * 重跑工作流
* @param param * @param param
*/ */
void reRunFlow(String param); void reRunFlow(RunInfo param);
/** /**
* 加载运行记录 * 加载运行记录
......
...@@ -303,6 +303,7 @@ public class ApiFlowOperatingServiceImpl implements ApiFlowOperatingService { ...@@ -303,6 +303,7 @@ public class ApiFlowOperatingServiceImpl implements ApiFlowOperatingService {
if (order == null) { if (order == null) {
order = 0; order = 0;
} }
//传递过来的公共参数格式化
Map<String,String> publicMap = JSON.parseObject(publicParam, Map.class); Map<String,String> publicMap = JSON.parseObject(publicParam, Map.class);
if(CollectionUtil.isEmpty(publicMap)){ if(CollectionUtil.isEmpty(publicMap)){
publicMap = new HashMap<>(8); publicMap = new HashMap<>(8);
......
...@@ -641,9 +641,9 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -641,9 +641,9 @@ public class ApiFlowServiceImpl implements ApiFlowService {
@Override @Override
public void reRunFlow(String param) { public void reRunFlow(RunInfo runInfo) {
ValidationUtil.dataNotBank(param, "请求参数不允许为空!"); ValidationUtil.dataNotNull(runInfo, "请求参数不允许为空!");
RunInfo runInfo = JSON.parseObject(param, RunInfo.class);
//获取工作空间名称 //获取工作空间名称
ValidationUtil.dataNotBank(runInfo.getWorkspaceName(), "工作空间名称不允许为空!"); ValidationUtil.dataNotBank(runInfo.getWorkspaceName(), "工作空间名称不允许为空!");
//获取工作流名称 //获取工作流名称
...@@ -677,6 +677,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -677,6 +677,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
WaitingRecord waitingRecord = new WaitingRecord(); WaitingRecord waitingRecord = new WaitingRecord();
//生成新的实例 //生成新的实例
RunRecording newRunRecording = buildRunRecording(runRecording, triggerTime, reRunId, jobTaskRunLogList.size(), userName); RunRecording newRunRecording = buildRunRecording(runRecording, triggerTime, reRunId, jobTaskRunLogList.size(), userName);
newRunRecording.setOperator(runInfo.getOperator());
BeanUtils.copyProperties(newRunRecording, waitingRecord); BeanUtils.copyProperties(newRunRecording, waitingRecord);
Integer order = waitingRecordMapper.findOrderByFlowId(flow.getFlowId()); Integer order = waitingRecordMapper.findOrderByFlowId(flow.getFlowId());
if (order == null) { if (order == null) {
......
...@@ -35,4 +35,8 @@ public class RunInfo { ...@@ -35,4 +35,8 @@ public class RunInfo {
* 节点名称 重跑节点和手动置为成功时需要 * 节点名称 重跑节点和手动置为成功时需要
*/ */
private String nodeName; private String nodeName;
/**
* 操作人
*/
private String operator;
} }
...@@ -550,7 +550,7 @@ public class JobUtils { ...@@ -550,7 +550,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, JSON.toJSONString(runInfo, WriteClassName));
log.debug("--------------------重跑节点接口调用成功,结果为:{}------------------------", 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