Commit a7aa4ce1 by huangfusuper

开始工作流基于RunID开始,解决BUG,暂停工作流之后,再开始,内嵌节点还是暂停的BUG

parent 64a0bba8
......@@ -1687,23 +1687,25 @@ public class ApiFlowServiceImpl implements ApiFlowService {
String[] runIdList = runIds.split(",");
for (String runId : runIdList) {
List<RunRecording> runRecordList = runRecordingMapper.findStopRunCordByRunId(runId,flowName);
List<RunRecording> runRecordList = runRecordingMapper.findStopRunCordByRunId(runId);
ValidationUtil.isTrueValidation(CollectionUtil.isEmpty(runRecordList), "该工作流不是暂停状态!");
RunRecording mainRunRecording = runRecordList.stream().filter(runRecording -> flowName.equals(runRecording.getFlowName())).findFirst().orElse(null);
Integer stopCount;
if (mainRunRecording != null) {
stopCount = mainRunRecording.getStopCount();
stopCount = stopCount - 1;
if (stopCount > 0 && "1".equals(stopFlowParam.getAllStartFlow())) {
mainRunRecording.setStopCount(stopCount);
runRecordingMapper.updateRunRecordingById(mainRunRecording);
} else {
runRecordingMapper.startByRunIdAndFlowId(runId, mainRunRecording.getFlowId());
jobTaskMapper.startByRunIdAndFlowId(runId, mainRunRecording.getFlowId());
//RunRecording mainRunRecording = runRecordList.stream().filter(runRecording -> flowName.equals(runRecording.getFlowName())).findFirst().orElse(null);
runRecordList.forEach(mainRunRecording ->{
Integer stopCount;
if (mainRunRecording != null) {
stopCount = mainRunRecording.getStopCount();
stopCount = stopCount - 1;
if (stopCount > 0 && "1".equals(stopFlowParam.getAllStartFlow())) {
mainRunRecording.setStopCount(stopCount);
runRecordingMapper.updateRunRecordingById(mainRunRecording);
} else {
runRecordingMapper.startByRunIdAndFlowId(runId, mainRunRecording.getFlowId());
jobTaskMapper.startByRunIdAndFlowId(runId, mainRunRecording.getFlowId());
}
}
}
});
}
......
......@@ -198,7 +198,7 @@ public interface RunRecordingMapper {
* @param runId
* @return
*/
List<RunRecording> findStopRunCordByRunId(@Param("runId") String runId, @Param("flowName")String flowName);
List<RunRecording> findStopRunCordByRunId(@Param("runId") String runId);
/**
* 根据runid和flowid杀死运行实例
......
......@@ -207,7 +207,7 @@
select
<include refid="Base_Column_List" />
from run_recording
where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName}
where run_id = #{runId,jdbcType=VARCHAR} and flow_status = '3'
and schedule_type != 4
</select>
......
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