|
@@ -184,41 +184,46 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public int cheHui(Long id) {
|
|
|
|
|
|
|
+ public void cheHui(Long id) {
|
|
|
AppPlan plan = baseMapper.selectById(id);
|
|
AppPlan plan = baseMapper.selectById(id);
|
|
|
-
|
|
|
|
|
//修改所有子计划
|
|
//修改所有子计划
|
|
|
List<AppPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, id));
|
|
List<AppPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, id));
|
|
|
for (AppPlan ap :
|
|
for (AppPlan ap :
|
|
|
appPlans) {
|
|
appPlans) {
|
|
|
//修改计划状态为停用
|
|
//修改计划状态为停用
|
|
|
- //如果是已经撤回的计划
|
|
|
|
|
- if("2".equals(plan.getDistribute())){
|
|
|
|
|
- //修改计划状态到进行中,下发状态到1
|
|
|
|
|
- plan.setDistribute("1");
|
|
|
|
|
- plan.setPlanStatus(1);
|
|
|
|
|
- }else {
|
|
|
|
|
- ap.setPlanStatus(2);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ ap.setPlanStatus(2);
|
|
|
baseMapper.updateById(ap);
|
|
baseMapper.updateById(ap);
|
|
|
}
|
|
}
|
|
|
- //如果是已经撤回的计划
|
|
|
|
|
- if("2".equals(plan.getDistribute())){
|
|
|
|
|
- //修改计划状态到进行中,下发状态到1
|
|
|
|
|
- plan.setDistribute("3");
|
|
|
|
|
- plan.setPlanStatus(1);
|
|
|
|
|
- baseMapper.updateById(plan);
|
|
|
|
|
- return 2;
|
|
|
|
|
- }else{
|
|
|
|
|
- plan.setDistribute("2");
|
|
|
|
|
- plan.setPlanStatus(0);
|
|
|
|
|
- baseMapper.updateById(plan);
|
|
|
|
|
- return 1;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //设置下发状态为未下发
|
|
|
|
|
+ plan.setDistribute("0");
|
|
|
|
|
+ plan.setPlanStatus(0);
|
|
|
|
|
+ baseMapper.updateById(plan);
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int distributeCheHui(Long id) {
|
|
|
|
|
+ AppPlan plan = baseMapper.selectById(id);
|
|
|
|
|
+ //修改所有子计划
|
|
|
|
|
+ List<AppPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, id));
|
|
|
|
|
+ //如果不存在子计划直接返回
|
|
|
|
|
+ if(appPlans==null||appPlans.size()==0){
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (AppPlan ap :
|
|
|
|
|
+ appPlans) {
|
|
|
|
|
+//修改计划状态为停用
|
|
|
|
|
+ ap.setPlanStatus(1);
|
|
|
|
|
+ baseMapper.updateById(ap);
|
|
|
|
|
+ }
|
|
|
|
|
+ //设置下发状态为下发
|
|
|
|
|
+ plan.setDistribute("1");
|
|
|
|
|
+ plan.setPlanStatus(1);
|
|
|
|
|
+ baseMapper.updateById(plan);
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取检查要点分页
|
|
* 获取检查要点分页
|
|
|
*
|
|
*
|
|
@@ -267,7 +272,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
plan.setPlanOfOrgName(app.getPlanCreateOrgName());
|
|
plan.setPlanOfOrgName(app.getPlanCreateOrgName());
|
|
|
//验证名称是否重复
|
|
//验证名称是否重复
|
|
|
QueryWrapper<AppPlan> qw = new QueryWrapper<>();
|
|
QueryWrapper<AppPlan> qw = new QueryWrapper<>();
|
|
|
- qw.lambda().eq(AppPlan::getPlanName, app.getPlanName()).eq(AppPlan::getDeleted,0);
|
|
|
|
|
|
|
+ qw.lambda().eq(AppPlan::getPlanName, app.getPlanName()).eq(AppPlan::getDeleted, 0);
|
|
|
|
|
|
|
|
Long size = baseMapper.selectCount(qw);
|
|
Long size = baseMapper.selectCount(qw);
|
|
|
|
|
|
|
@@ -275,7 +280,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
throw new RuntimeException("计划名称重复,请确认!");
|
|
throw new RuntimeException("计划名称重复,请确认!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ plan.setDistribute("0");
|
|
|
baseMapper.insert(plan);
|
|
baseMapper.insert(plan);
|
|
|
Long id = plan.getId();
|
|
Long id = plan.getId();
|
|
|
|
|
|
|
@@ -305,7 +310,6 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// Integer orgId = app.getExecOrgType();
|
|
// Integer orgId = app.getExecOrgType();
|
|
|
// if (orgId != null) {
|
|
// if (orgId != null) {
|
|
|
// AppPlanToCheckOrg checkOrg = new AppPlanToCheckOrg();
|
|
// AppPlanToCheckOrg checkOrg = new AppPlanToCheckOrg();
|
|
@@ -331,10 +335,10 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取计划对应的已完成任务数量
|
|
//获取计划对应的已完成任务数量
|
|
|
- Long num = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", app.getId()).eq("status",3));
|
|
|
|
|
|
|
+ Long num = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", app.getId()).eq("status", 3));
|
|
|
if (num > 0) {
|
|
if (num > 0) {
|
|
|
//如果状态为已禁用
|
|
//如果状态为已禁用
|
|
|
- if(app.getPlanStatus()==0){
|
|
|
|
|
|
|
+ if (app.getPlanStatus() == 0) {
|
|
|
throw new RuntimeException("计划已生成任务,不能禁用!");
|
|
throw new RuntimeException("计划已生成任务,不能禁用!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -344,7 +348,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
List<AppPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()));
|
|
List<AppPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()));
|
|
|
for (AppPlan ap :
|
|
for (AppPlan ap :
|
|
|
appPlans) {
|
|
appPlans) {
|
|
|
- Long nums = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", ap.getId()).eq("status",3));
|
|
|
|
|
|
|
+ Long nums = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", ap.getId()).eq("status", 3));
|
|
|
if (nums > 0) {
|
|
if (nums > 0) {
|
|
|
if (app.getPlanStatus() == 0) {
|
|
if (app.getPlanStatus() == 0) {
|
|
|
throw new RuntimeException("计划已生成任务,不能禁用!");
|
|
throw new RuntimeException("计划已生成任务,不能禁用!");
|
|
@@ -450,7 +454,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
appPlanToExecOrgMapper.insert(execOrg);
|
|
appPlanToExecOrgMapper.insert(execOrg);
|
|
|
}
|
|
}
|
|
|
//更新任务的名称
|
|
//更新任务的名称
|
|
|
- resumptionMapper.updateNameByPlanId(app.getPlanName(),app.getId());
|
|
|
|
|
|
|
+ resumptionMapper.updateNameByPlanId(app.getPlanName(), app.getId());
|
|
|
|
|
|
|
|
//最后处理本计划
|
|
//最后处理本计划
|
|
|
plan.setUpdateTime(new Date());
|
|
plan.setUpdateTime(new Date());
|
|
@@ -519,17 +523,17 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
|
|
|
/**
|
|
/**
|
|
|
* 验证计划是否被应用
|
|
* 验证计划是否被应用
|
|
|
*/
|
|
*/
|
|
|
- Long num = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", id).eq("status",3));
|
|
|
|
|
|
|
+ Long num = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", id).eq("status", 3));
|
|
|
if (num > 0) {
|
|
if (num > 0) {
|
|
|
throw new RuntimeException("计划已生成任务,不能删除!");
|
|
throw new RuntimeException("计划已生成任务,不能删除!");
|
|
|
}
|
|
}
|
|
|
//查找子计划
|
|
//查找子计划
|
|
|
- List<AppPlan> childrens = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId,id));
|
|
|
|
|
|
|
+ List<AppPlan> childrens = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, id));
|
|
|
|
|
|
|
|
//删除子计划
|
|
//删除子计划
|
|
|
for (AppPlan ap :
|
|
for (AppPlan ap :
|
|
|
childrens) {
|
|
childrens) {
|
|
|
- Long nums = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", ap.getId()).eq("status",3));
|
|
|
|
|
|
|
+ Long nums = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", ap.getId()).eq("status", 3));
|
|
|
if (nums > 0) {
|
|
if (nums > 0) {
|
|
|
throw new RuntimeException("子计划已生成任务,不能删除!");
|
|
throw new RuntimeException("子计划已生成任务,不能删除!");
|
|
|
}
|
|
}
|