|  | @@ -146,14 +146,14 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                      dto.getOrgAndStatus()) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                AppPlan tempplan = baseMapper.selectOne(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getPlanOfOrgId,d.getOrgId()).eq(AppPlan::getParentId,dto.getId()));
 | 
	
		
			
				|  |  | +                AppPlan tempplan = baseMapper.selectOne(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getPlanOfOrgId, d.getOrgId()).eq(AppPlan::getParentId, dto.getId()));
 | 
	
		
			
				|  |  |                  //如果子计划已存在
 | 
	
		
			
				|  |  | -                if(tempplan!=null){
 | 
	
		
			
				|  |  | -                    tempplan.setPlanStatus(d.getStatus()>0?1:2);
 | 
	
		
			
				|  |  | +                if (tempplan != null) {
 | 
	
		
			
				|  |  | +                    tempplan.setPlanStatus(d.getStatus() > 0 ? 1 : 2);
 | 
	
		
			
				|  |  |                      tempplan.setDistributePlanStatus(d.getStatus().toString());
 | 
	
		
			
				|  |  |                      tempplan.setDistributeStatus("1");
 | 
	
		
			
				|  |  |                      baseMapper.updateById(tempplan);
 | 
	
		
			
				|  |  | -                }else {
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  |                      AppPlan plan = baseMapper.selectById(dto.getId());
 | 
	
		
			
				|  |  |                      plan.setOrgId(d.getOrgId().toString());
 | 
	
		
			
				|  |  |                      plan.setDistributeStatus("1");
 | 
	
	
		
			
				|  | @@ -234,7 +234,13 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |          AppPlan plan = baseMapper.selectById(id);
 | 
	
		
			
				|  |  |          //设置计划状态
 | 
	
		
			
				|  |  |          plan.setPlanStatus(1);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        //如果是行社撤回需要修改下发状态
 | 
	
		
			
				|  |  | +        //行社下发
 | 
	
		
			
				|  |  | +        if (plan.getPlanOfOrgType() == 3 && plan.getDistribute().equals("0")) {
 | 
	
		
			
				|  |  | +            plan.setDistribute("1");
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            plan.setDistribute("0");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          baseMapper.updateById(plan);
 | 
	
		
			
				|  |  |          return 1;
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -359,7 +365,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  QueryWrapper<AppPlanToPoint> api = new QueryWrapper<>();
 | 
	
		
			
				|  |  | -                api.lambda().eq(AppPlanToPoint::getPlanId, ap.getId()).eq(AppPlanToPoint::getOfOrgId,app.getPlanCreateOrgId());
 | 
	
		
			
				|  |  | +                api.lambda().eq(AppPlanToPoint::getPlanId, ap.getId()).eq(AppPlanToPoint::getOfOrgId, app.getPlanCreateOrgId());
 | 
	
		
			
				|  |  |                  appPlanToItemMapper.delete(api);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  List<Long> roleList = app.getRoleList();
 | 
	
	
		
			
				|  | @@ -373,7 +379,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  List<RuleItemVo> valitemList = app.getItemList();
 | 
	
		
			
				|  |  | -                List<RuleItemVo> itemList = valitemList.stream().filter(e-> e.getOfOrgId().equals(app.getPlanCreateOrgId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +                List<RuleItemVo> itemList = valitemList.stream().filter(e -> e.getOfOrgId().equals(app.getPlanCreateOrgId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  if (valitemList.size() == 0) {
 | 
	
		
			
				|  |  |                      throw new RuntimeException("请选择履职要点");
 | 
	
	
		
			
				|  | @@ -391,9 +397,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                  //如果计划是编辑全部,代表不存在已完成或者逾期的任务,需要删除重新生成
 | 
	
		
			
				|  |  |                  if (app.getHasEdit() == null) {
 | 
	
		
			
				|  |  |                      resumptionMapper.delete(new LambdaQueryWrapper<Resumption>().eq(Resumption::getPlanId, ap.getId()));
 | 
	
		
			
				|  |  | -                }else {
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  |                      //否则代表编辑名称,需要同步未进行的任务名称
 | 
	
		
			
				|  |  | -                    resumptionMapper.updateNameByPlanId(app.getPlanName(),ap.getId());
 | 
	
		
			
				|  |  | +                    resumptionMapper.updateNameByPlanId(app.getPlanName(), ap.getId());
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -409,7 +415,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              QueryWrapper<AppPlanToPoint> api = new QueryWrapper<>();
 | 
	
		
			
				|  |  | -            api.lambda().eq(AppPlanToPoint::getPlanId, id).eq(AppPlanToPoint::getOfOrgId,app.getPlanCreateOrgId());
 | 
	
		
			
				|  |  | +            api.lambda().eq(AppPlanToPoint::getPlanId, id).eq(AppPlanToPoint::getOfOrgId, app.getPlanCreateOrgId());
 | 
	
		
			
				|  |  |              appPlanToItemMapper.delete(api);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -429,7 +435,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              List<RuleItemVo> valitemList = app.getItemList();
 | 
	
		
			
				|  |  | -            List<RuleItemVo> itemList = valitemList.stream().filter(e-> e.getOfOrgId().equals(app.getPlanCreateOrgId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +            List<RuleItemVo> itemList = valitemList.stream().filter(e -> e.getOfOrgId().equals(app.getPlanCreateOrgId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              if (valitemList.size() == 0) {
 | 
	
		
			
				|  |  |                  throw new RuntimeException("请选择履职要点");
 | 
	
	
		
			
				|  | @@ -549,7 +555,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |          /**
 | 
	
		
			
				|  |  |           * 验证计划是否被应用
 | 
	
		
			
				|  |  |           */
 | 
	
		
			
				|  |  | -        Long num = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", id).in("status", 3,4));
 | 
	
		
			
				|  |  | +        Long num = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", id).in("status", 3, 4));
 | 
	
		
			
				|  |  |          if (num > 0) {
 | 
	
		
			
				|  |  |              throw new RuntimeException("计划有已完成或者已逾期的任务,不能被删除。");
 | 
	
		
			
				|  |  |          }
 |