Commit c0d36ed8 by guominglei

将暂停放宽到未运行的也可以暂停

parent 0f1e69bf
...@@ -1490,7 +1490,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -1490,7 +1490,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
ValidationUtil.dataNotNull(flow, flowName + "工作流不存在"); ValidationUtil.dataNotNull(flow, flowName + "工作流不存在");
ValidationUtil.isTrueValidation(FlowPropertyEnum.IS_INNER.getCode().equals(flow.getIsInner()), "内嵌工作流不允许停止调度!"); ValidationUtil.isTrueValidation(FlowPropertyEnum.IS_INNER.getCode().equals(flow.getIsInner()), "内嵌工作流不允许停止调度!");
//判断是否在调度中 //判断是否在调度中
List<RunRecording> recordingList = runRecordingMapper.findOnScheduleByFlowId(flow.getFlowId()); List<RunRecording> recordingList = runRecordingMapper.findUnFinishByFlowId(flow.getFlowId());
ValidationUtil.isTrueValidation(null == recordingList || recordingList.size() == 0 , flowName + "工作流没有正在运行的调度!"); ValidationUtil.isTrueValidation(null == recordingList || recordingList.size() == 0 , flowName + "工作流没有正在运行的调度!");
StringBuffer runids = new StringBuffer(); StringBuffer runids = new StringBuffer();
//暂停工作流调度 //暂停工作流调度
......
...@@ -209,6 +209,7 @@ ...@@ -209,6 +209,7 @@
from run_recording from run_recording
where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName,jdbcType=VARCHAR} and schedule_type != 4 where run_id = #{runId,jdbcType=VARCHAR} and flow_name = #{flowName,jdbcType=VARCHAR} and schedule_type != 4
</select> </select>
<select id="findUnFinishByFlowId" resultMap="BaseResultMap"> <select id="findUnFinishByFlowId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
...@@ -216,24 +217,26 @@ ...@@ -216,24 +217,26 @@
where flow_id = #{flowId} where flow_id = #{flowId}
and flow_status != '4' and schedule_type != 4 and flow_status != '4' and schedule_type != 4
</select> </select>
<select id="findStatusByStartAndEndTime" resultType="com.byit.dto.plugin.StatisticData" useCache="false" flushCache="true">
select sum(case when flow_status = '1' then 1 else 0 end ) unstart, <select id="findStatusByStartAndEndTime" resultType="com.byit.dto.plugin.StatisticData" useCache="false" flushCache="true">
sum(case when flow_status='2' then 1 else 0 end ) runIng, select sum(case when flow_status = '1' then 1 else 0 end ) unstart,
sum(case when flow_status='3' then 1 else 0 end ) stop, sum(case when flow_status='2' then 1 else 0 end ) runIng,
sum(case when flow_status='4' and (flow_run_result = '1' or flow_run_result = '3') then 1 else 0 end ) success, sum(case when flow_status='3' then 1 else 0 end ) stop,
sum(case when flow_status='4' and (flow_run_result = '2' or flow_run_result = '4') then 1 else 0 end ) fail, sum(case when flow_status='4' and (flow_run_result = '1' or flow_run_result = '3') then 1 else 0 end ) success,
sum(case when flow_run_result='5' then 1 else 0 end ) 'kill' sum(case when flow_status='4' and (flow_run_result = '2' or flow_run_result = '4') then 1 else 0 end ) fail,
from run_recording sum(case when flow_run_result='5' then 1 else 0 end ) 'kill'
where (end_time &lt;= #{endTime} or start_time &lt;= #{endTime}) from run_recording
and start_time &gt;= #{startTime} and schedule_type != 4 where (end_time &lt;= #{endTime} or start_time &lt;= #{endTime})
<if test="flowIdList != null"> and start_time &gt;= #{startTime} and schedule_type != 4
and flow_id in ( <if test="flowIdList != null">
<foreach collection="flowIdList" item="flowId" separator=","> and flow_id in (
#{flowId} <foreach collection="flowIdList" item="flowId" separator=",">
</foreach> #{flowId}
) </foreach>
</if> )
</select> </if>
</select>
<select id="findMaxByFlowId" resultMap="BaseResultMap"> <select id="findMaxByFlowId" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> select <include refid="Base_Column_List" />
from run_recording from run_recording
......
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