Commit 3d8e7fa5 by huangfusuper

修正查询工作流状态SQLBUG

parent 7d4f7a68
...@@ -64,26 +64,27 @@ public class ApiFlowStatusServiceImpl implements ApiFlowStatusService { ...@@ -64,26 +64,27 @@ public class ApiFlowStatusServiceImpl implements ApiFlowStatusService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
flowStatusCoreDto.setFlowEntityCoreDtos(flowEntityCoreDtos); flowStatusCoreDto.setFlowEntityCoreDtos(flowEntityCoreDtos);
//查询对应条件的实例 //查询对应条件的实例
List<RunRecording> byFlowNameAndTypeAndWId = runRecordingMapper.findByFlowNameAndTypeAndWId(flowStatusCoreDto);
if(CollectionUtil.isNotEmpty(byFlowNameAndTypeAndWId)) { if(flowStatusCoreDto != null) {
//筛选当天数据 List<RunRecording> byFlowNameAndTypeAndWId = runRecordingMapper.findByFlowNameAndTypeAndWId(flowStatusCoreDto);
List<RunRecording> collect = byFlowNameAndTypeAndWId.stream().filter(byFlowName -> byFlowName.getTriggerTime() > DateUtil.getThisDayStartDate().getTime() && byFlowName.getTriggerTime() <= DateUtil.getThisDayEndDate().getTime()).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(collect)) { if(CollectionUtil.isNotEmpty(byFlowNameAndTypeAndWId)) {
collect.forEach(byFlowNameAndType ->{ //筛选当天数据
JobStatusResultDto jobStatusResultDto = new JobStatusResultDto(); List<RunRecording> collect = byFlowNameAndTypeAndWId.stream().filter(byFlowName -> byFlowName.getTriggerTime() > DateUtil.getThisDayStartDate().getTime() && byFlowName.getTriggerTime() <= DateUtil.getThisDayEndDate().getTime()).collect(Collectors.toList());
jobStatusResultDto.setFindDateTime(System.currentTimeMillis()); if(CollectionUtil.isNotEmpty(collect)) {
jobStatusResultDto.setEndTime(byFlowNameAndType.getEndTime().getTime()); collect.forEach(byFlowNameAndType ->{
jobStatusResultDto.setJobName(byFlowNameAndType.getFlowName()); JobStatusResultDto jobStatusResultDto = new JobStatusResultDto();
jobStatusResultDto.setRunIng("4".equals(byFlowNameAndType.getFlowStatus())); jobStatusResultDto.setFindDateTime(System.currentTimeMillis());
jobStatusResultDto.setStartDateTime(byFlowNameAndType.getStartTime().getTime()); jobStatusResultDto.setEndTime(byFlowNameAndType.getEndTime().getTime());
jobStatusResultDtos.add(jobStatusResultDto); jobStatusResultDto.setJobName(byFlowNameAndType.getFlowName());
}); jobStatusResultDto.setRunIng("4".equals(byFlowNameAndType.getFlowStatus()));
jobStatusResultDto.setStartDateTime(byFlowNameAndType.getStartTime().getTime());
jobStatusResultDtos.add(jobStatusResultDto);
});
}
} }
} }
} }
}); });
return jobStatusResultDtos; return jobStatusResultDtos;
} }
......
...@@ -208,14 +208,14 @@ ...@@ -208,14 +208,14 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from run_recording from run_recording
<if test="flowStatusCoreDtos != null"> <where>
( <if test="flowStatusCoreDtos != null">
<foreach collection="flowStatusCoreDtos.flowEntityCoreDtos" item="flowEntityCoreDto" separator=" or " open="(" close=")"> <foreach collection="flowStatusCoreDtos.flowEntityCoreDtos" item="flowEntityCoreDto" separator=" or " open="(" close=")">
flow_name = #{flowEntityCoreDto.flowName} and schedule_type = #{flowEntityCoreDto.scheduleType} flow_name = #{flowEntityCoreDto.flowName} and schedule_type = #{flowEntityCoreDto.scheduleType}
</foreach> </foreach>
)
and workspace_id = #{flowStatusCoreDtos.workspaceId} and workspace_id = #{flowStatusCoreDtos.workspaceId}
</if> </if>
</where>
</select> </select>
<select id="findByRunIdAndFlowName" resultMap="BaseResultMap"> <select id="findByRunIdAndFlowName" resultMap="BaseResultMap">
......
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