Commit 6871c11e authored by litengwei's avatar litengwei

定时任务超时创建漏检记录

parent c91c35d8
......@@ -227,5 +227,9 @@ public interface PlanTaskMapper extends BaseMapper {
List<Long> getPlanTaskListByPlanId(long planId, int finishStatus);
List<PlanTask> getPlanTaskTListByPlanId(long planId, int finishStatus);
void updatePlanTaskByPlanId(List<Long> ids, int finishStatus);
void updatePlanTaskDetailsByPlanId(List<Long> ids, int finishStatus);
}
......@@ -602,16 +602,7 @@ public class JobService implements IJobService {
} else if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (!ValidationUtil.isEmpty(StartPlanTaskList)) {
planTaskMapper.updatePlanTaskByPlanId(StartPlanTaskList,PlanTaskFinishStatusEnum.OVERTIME.getValue());
for (Long id : StartPlanTaskList) {
List<PlanTaskDetail> planTaskDetails = iPlanTaskDetailDao.findAllByTaskNoAndStatus(id, PlanTaskDetailStatusEnum.NOTSTARTED.getValue());
if (!planTaskDetails.isEmpty()) {
planTaskDetails.stream().forEach(action -> {
action.setIsFinish(PlanTaskDetailIsFinishEnum.OVERTIME.getValue());
action.setStatus(PlanTaskDetailStatusEnum.OMISSION.getValue());
iPlanTaskDetailDao.saveAndFlush(action);
});
}
}
planTaskMapper.updatePlanTaskDetailsByPlanId(StartPlanTaskList,PlanTaskFinishStatusEnum.OVERTIME.getValue());
for (PlanTask planTask: planTaskList
) {
......
......@@ -1584,13 +1584,26 @@
<update id="updatePlanTaskByPlanId">
update
"p_plan_task"
"p_plan_task"
set
finish_status = #{finishStatus}
where
id in
<foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updatePlanTaskDetailsByPlanId">
update
"p_plan_task_detail"
set
finish_status = #{finishStatus}
is_finish = 2,
status = 3
where
id in
task_no in
<foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
#{id}
</foreach>
AND is_finish = 0
</update>
</mapper>
\ No newline at end of file
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