|  | @@ -332,57 +332,21 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                  item.setPlanId(id);
 | 
	
		
			
				|  |  |                  item.setPointScan(ruleItemVo.isPointScan());
 | 
	
		
			
				|  |  |                  item.setRequired(ruleItemVo.isRequired());
 | 
	
		
			
				|  |  | +                item.setOfOrgId(ruleItemVo.getOfOrgId());
 | 
	
		
			
				|  |  |                  appPlanToItemMapper.insert(item);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -//            Integer orgId = app.getExecOrgType();
 | 
	
		
			
				|  |  | -//            if (orgId != null) {
 | 
	
		
			
				|  |  | -//                AppPlanToCheckOrg checkOrg = new AppPlanToCheckOrg();
 | 
	
		
			
				|  |  | -//                AppPlanToExecOrg execOrg = new AppPlanToExecOrg();
 | 
	
		
			
				|  |  | -//                List<SysOrg> sysOrgs = orgService.selectByOrgType(orgId, SecurityConstants.INNER);
 | 
	
		
			
				|  |  | -//                List<Long> orgids = sysOrgs.stream().map(SysOrg::getId).collect(Collectors.toList());
 | 
	
		
			
				|  |  | -//                for (Long i :
 | 
	
		
			
				|  |  | -//                        orgids) {
 | 
	
		
			
				|  |  | -//                    checkOrg.setOrgId(i);
 | 
	
		
			
				|  |  | -//                    checkOrg.setPlanId(id);
 | 
	
		
			
				|  |  | -//                    execOrg.setOrgId(i);
 | 
	
		
			
				|  |  | -//                    execOrg.setPlanId(id);
 | 
	
		
			
				|  |  | -//                    appPlanToCheckOrgMapper.insert(checkOrg);
 | 
	
		
			
				|  |  | -//                    appPlanToExecOrgMapper.insert(execOrg);
 | 
	
		
			
				|  |  | -//                }
 | 
	
		
			
				|  |  | -//
 | 
	
		
			
				|  |  | -//
 | 
	
		
			
				|  |  | -//
 | 
	
		
			
				|  |  | -//            }
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              if (app.getRoleList() == null) {
 | 
	
		
			
				|  |  |                  app.setRoleList(new ArrayList<>());
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -//            //获取计划对应的已完成任务数量
 | 
	
		
			
				|  |  | -//            Long num = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", app.getId()).eq("status", 3));
 | 
	
		
			
				|  |  | -//            if (num > 0) {
 | 
	
		
			
				|  |  | -//                //如果状态为已禁用
 | 
	
		
			
				|  |  | -//                if (app.getPlanStatus() == 0) {
 | 
	
		
			
				|  |  | -//                    throw new RuntimeException("计划已生成任务,不能禁用!");
 | 
	
		
			
				|  |  | -//                }
 | 
	
		
			
				|  |  | -//
 | 
	
		
			
				|  |  | -//            }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              //修改所有子计划
 | 
	
		
			
				|  |  |              List<AppPlan> appPlans = baseMapper.selectList(new LambdaQueryWrapper<AppPlan>().eq(AppPlan::getParentId, plan.getId()));
 | 
	
		
			
				|  |  |              for (AppPlan ap :
 | 
	
		
			
				|  |  |                      appPlans) {
 | 
	
		
			
				|  |  | -//                Long nums = resumptionMapper.selectCount(new QueryWrapper<Resumption>().eq("plan_id", ap.getId()).eq("status", 3));
 | 
	
		
			
				|  |  | -//                if (nums > 0) {
 | 
	
		
			
				|  |  | -//                    if (app.getPlanStatus() == 0) {
 | 
	
		
			
				|  |  | -//                        throw new RuntimeException("计划已生成任务,不能禁用!");
 | 
	
		
			
				|  |  | -//                    }
 | 
	
		
			
				|  |  | -//                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  ap.setPlanType(plan.getPlanType());
 | 
	
		
			
				|  |  |                  ap.setPlanCycle(plan.getPlanCycle());
 | 
	
		
			
				|  |  | -//                ap.setPlanStatus(plan.getPlanStatus());
 | 
	
		
			
				|  |  |                  ap.setExecOrgType(plan.getExecOrgType());
 | 
	
		
			
				|  |  |                  ap.setPlanExec(plan.getPlanExec());
 | 
	
		
			
				|  |  |                  ap.setModifiedBy(SecurityUtils.getUserId());
 | 
	
	
		
			
				|  | @@ -397,7 +361,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  QueryWrapper<AppPlanToPoint> api = new QueryWrapper<>();
 | 
	
		
			
				|  |  | -                api.lambda().eq(AppPlanToPoint::getPlanId, ap.getId());
 | 
	
		
			
				|  |  | +                api.lambda().eq(AppPlanToPoint::getPlanId, ap.getId()).eq(AppPlanToPoint::getOfOrgId,app.getPlanCreateOrgId());
 | 
	
		
			
				|  |  |                  appPlanToItemMapper.delete(api);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  List<Long> roleList = app.getRoleList();
 | 
	
	
		
			
				|  | @@ -410,8 +374,10 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                List<RuleItemVo> itemList = app.getItemList();
 | 
	
		
			
				|  |  | -                if (itemList.size() == 0) {
 | 
	
		
			
				|  |  | +                List<RuleItemVo> valitemList = app.getItemList();
 | 
	
		
			
				|  |  | +                List<RuleItemVo> itemList = valitemList.stream().filter(e-> e.getOfOrgId().equals(app.getPlanCreateOrgId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                if (valitemList.size() == 0) {
 | 
	
		
			
				|  |  |                      throw new RuntimeException("请选择履职要点");
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  AppPlanToPoint item = null;
 | 
	
	
		
			
				|  | @@ -421,6 +387,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                      item.setPlanId(ap.getId());
 | 
	
		
			
				|  |  |                      item.setPointScan(ruleItemVo.isPointScan());
 | 
	
		
			
				|  |  |                      item.setRequired(ruleItemVo.isRequired());
 | 
	
		
			
				|  |  | +                    item.setOfOrgId(ruleItemVo.getOfOrgId());
 | 
	
		
			
				|  |  |                      appPlanToItemMapper.insert(item);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  //如果计划是编辑全部,代表不存在已完成或者逾期的任务,需要删除重新生成
 | 
	
	
		
			
				|  | @@ -444,7 +411,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              QueryWrapper<AppPlanToPoint> api = new QueryWrapper<>();
 | 
	
		
			
				|  |  | -            api.lambda().eq(AppPlanToPoint::getPlanId, id);
 | 
	
		
			
				|  |  | +            api.lambda().eq(AppPlanToPoint::getPlanId, id).eq(AppPlanToPoint::getOfOrgId,app.getPlanCreateOrgId());
 | 
	
		
			
				|  |  |              appPlanToItemMapper.delete(api);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -463,8 +430,10 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                  appPlanToRoleMapper.insert(atr);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            List<RuleItemVo> itemList = app.getItemList();
 | 
	
		
			
				|  |  | -            if (itemList.size() == 0) {
 | 
	
		
			
				|  |  | +            List<RuleItemVo> valitemList = app.getItemList();
 | 
	
		
			
				|  |  | +            List<RuleItemVo> itemList = valitemList.stream().filter(e-> e.getOfOrgId().equals(app.getPlanCreateOrgId())).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if (valitemList.size() == 0) {
 | 
	
		
			
				|  |  |                  throw new RuntimeException("请选择履职要点");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              AppPlanToPoint item = null;
 | 
	
	
		
			
				|  | @@ -474,6 +443,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 | 
	
		
			
				|  |  |                  item.setPlanId(id);
 | 
	
		
			
				|  |  |                  item.setPointScan(ruleItemVo.isPointScan());
 | 
	
		
			
				|  |  |                  item.setRequired(ruleItemVo.isRequired());
 | 
	
		
			
				|  |  | +                item.setOfOrgId(ruleItemVo.getOfOrgId());
 | 
	
		
			
				|  |  |                  appPlanToItemMapper.insert(item);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 |