Commit 64a0bba8 by huangfusuper

不是暂停的实例也能开始暂停

parent 6b7066b5
...@@ -1685,15 +1685,12 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1685,15 +1685,12 @@ public class ApiFlowServiceImpl implements ApiFlowService {
String flowName = stopFlowParam.getFlowName(); String flowName = stopFlowParam.getFlowName();
ValidationUtil.dataNotBank(flowName, "工作流名称不允许为空!"); ValidationUtil.dataNotBank(flowName, "工作流名称不允许为空!");
List<String> runIdList = Arrays.asList(runIds.split(",")); String[] runIdList = runIds.split(",");
for (String runId : runIdList) { for (String runId : runIdList) {
List<RunRecording> runRecordList = runRecordingMapper.findStopRunCordByRunId(runId); List<RunRecording> runRecordList = runRecordingMapper.findStopRunCordByRunId(runId,flowName);
ValidationUtil.isTrueValidation(CollectionUtil.isEmpty(runRecordList), "该工作流不是暂停状态!");
//ValidationUtil.isTrueValidation(CollectionUtil.isEmpty(runRecordList), "该工作流不是暂停状态!");
if (CollectionUtil.isEmpty(runRecordList)) {
log.warn("---------运行记录{},不存在暂停记录中!---", runId);
return;
}
RunRecording mainRunRecording = runRecordList.stream().filter(runRecording -> flowName.equals(runRecording.getFlowName())).findFirst().orElse(null); RunRecording mainRunRecording = runRecordList.stream().filter(runRecording -> flowName.equals(runRecording.getFlowName())).findFirst().orElse(null);
Integer stopCount; Integer stopCount;
if (mainRunRecording != null) { if (mainRunRecording != null) {
......
...@@ -198,7 +198,7 @@ public interface RunRecordingMapper { ...@@ -198,7 +198,7 @@ public interface RunRecordingMapper {
* @param runId * @param runId
* @return * @return
*/ */
List<RunRecording> findStopRunCordByRunId(String runId); List<RunRecording> findStopRunCordByRunId(@Param("runId") String runId, @Param("flowName")String flowName);
/** /**
* 根据runid和flowid杀死运行实例 * 根据runid和flowid杀死运行实例
......
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from run_recording from run_recording
where run_id = #{runId,jdbcType=VARCHAR} where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName}
and schedule_type != 4 and schedule_type != 4
</select> </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