Commit 44cadb63 authored by chenzhao's avatar chenzhao

防火监督 Web端计划添加已超时判断

parent b9b6b243
...@@ -14,7 +14,9 @@ public enum PlanStatusEnum { ...@@ -14,7 +14,9 @@ public enum PlanStatusEnum {
EXAMINE_FORMULATE("已审核/检查内容未制定",4, 5), EXAMINE_FORMULATE("已审核/检查内容未制定",4, 5),
EXAMINE_DEVELOPED("检查内容已制定/未执行",5, 6), EXAMINE_DEVELOPED("检查内容已制定/未执行",5, 6),
IN_EXECUTION("执行中",6, 7), IN_EXECUTION("执行中",6, 7),
COMPLETED("已完成",7, 7); COMPLETED("已完成",7, 7),
OUT_TIME("已超时",8, 8);
/** /**
* 名称 * 名称
......
...@@ -396,7 +396,23 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -396,7 +396,23 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
// 计划已过期,则更新status = 7,已完成 // 计划已过期,则更新status = 7,已完成
if (!vo.getIsGenData()) { if (!vo.getIsGenData()) {
paramMap.put("status", PlanStatusEnum.COMPLETED.getValue()); int num = 0;
//根据计划id查询关联的任务
List<PlanTask> planTaskByRouteId = planTaskMapper.getPlanTaskByRouteId(plan.getId());
if (!ValidationUtil.isEmpty(planTaskByRouteId)){
HashMap<String, Object> param = new HashMap<String, Object>();
param.put("pointId",plan.getId());
//根据任务id查询关联的任务是否存在未完成的 如果存在 则修改状态为已超时
List<Map<String, Object>> planTaskPoints = planTaskMapper.getPlanTaskPoints(param);
if (!ValidationUtil.isEmpty(planTaskPoints)){
num = (int) planTaskPoints.stream().filter(c -> c.containsKey("finish") && !String.valueOf(c.get("finish")).equals("2")).count();
}
if (num >= 1){
paramMap.put("status", PlanStatusEnum.OUT_TIME.getValue());
}else {
paramMap.put("status", PlanStatusEnum.COMPLETED.getValue());
}
}
planMapper.updPlanStatusOrGenDate(paramMap); planMapper.updPlanStatusOrGenDate(paramMap);
continue; continue;
} }
......
...@@ -398,7 +398,9 @@ ...@@ -398,7 +398,9 @@
<if test="taskType != null and taskType != ''">and ppn.check_type_id = #{taskType}</if> <if test="taskType != null and taskType != ''">and ppn.check_type_id = #{taskType}</if>
<if test="planTaskId != null and planTaskId > 0 ">and ptd.task_no = #{planTaskId}</if> <if test="planTaskId != null and planTaskId > 0 ">and ptd.task_no = #{planTaskId}</if>
<if test="orderBy != null and orderBy != ''">order by ${orderBy}</if> <if test="orderBy != null and orderBy != ''">order by ${orderBy}</if>
limit #{offset},#{pageSize} <if test="offset != null and pageSize != null">
limit #{offset},#{pageSize}
</if>
</select> </select>
<select id="getPlanTaskPointsCount" resultType="long"> <select id="getPlanTaskPointsCount" resultType="long">
......
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