|
|
@@ -164,9 +164,49 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
|
|
|
CoreSafecheckPlan coreSafecheckPlan = new CoreSafecheckPlan();
|
|
|
coreSafecheckPlan.setId(dto.getId());
|
|
|
coreSafecheckPlan.setDistribute("1");
|
|
|
+ coreSafecheckPlan.setPlanStatus(1L);
|
|
|
coreSafecheckPlanMapper.updateById(coreSafecheckPlan);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void cheHui(Long id) {
|
|
|
+ CoreSafecheckPlan plan = baseMapper.selectById(id);
|
|
|
+ //修改所有子计划
|
|
|
+ List<CoreSafecheckPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<CoreSafecheckPlan>().eq(CoreSafecheckPlan::getParentId, id));
|
|
|
+ for (CoreSafecheckPlan ap :
|
|
|
+ appPlans) {
|
|
|
+//修改计划状态为停用
|
|
|
+ ap.setPlanStatus(2L);
|
|
|
+ baseMapper.updateById(ap);
|
|
|
+ }
|
|
|
+ //设置下发状态为未下发
|
|
|
+ plan.setDistribute("0");
|
|
|
+ plan.setPlanStatus(0L);
|
|
|
+ baseMapper.updateById(plan);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int distributeCheHui(Long id) {
|
|
|
+ CoreSafecheckPlan plan = baseMapper.selectById(id);
|
|
|
+ //修改所有子计划
|
|
|
+ List<CoreSafecheckPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<CoreSafecheckPlan>().eq(CoreSafecheckPlan::getParentId, id));
|
|
|
+ //如果不存在子计划直接返回
|
|
|
+ if(appPlans==null||appPlans.size()==0){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ for (CoreSafecheckPlan ap :
|
|
|
+ appPlans) {
|
|
|
+//修改计划状态为停用
|
|
|
+ ap.setPlanStatus(1L);
|
|
|
+ baseMapper.updateById(ap);
|
|
|
+ }
|
|
|
+ //设置下发状态为下发
|
|
|
+ plan.setDistribute("1");
|
|
|
+ plan.setPlanStatus(1L);
|
|
|
+ baseMapper.updateById(plan);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询常规安全检查计划
|
|
|
@@ -209,11 +249,13 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
|
|
|
coreSafecheckPlan.setIsDeleted("0");
|
|
|
coreSafecheckPlan.setCreateTime(DateUtils.getNowDate());
|
|
|
coreSafecheckPlan.setModifiedBy(SecurityUtils.getUserId());
|
|
|
+ coreSafecheckPlan.setDistribute("0");
|
|
|
coreSafecheckPlanMapper.insert(coreSafecheckPlan);
|
|
|
|
|
|
} else {
|
|
|
coreSafecheckPlan.setUpdateTime(DateUtils.getNowDate());
|
|
|
coreSafecheckPlan.setModifiedBy(SecurityUtils.getUserId());
|
|
|
+ coreSafecheckPlan.setPlanStatus(null);
|
|
|
coreSafecheckPlanMapper.updateById(coreSafecheckPlan);
|
|
|
}
|
|
|
|