|  |  | @ -403,10 +403,14 @@ public class ProjectServiceImpl implements ProjectService { | 
			
		
	
		
			
				
					|  |  |  |      * 210622: 新增此API, 后端改为从指标库取值 , 保证平阴县的工作人员,看到的下拉框是平阴县、以及8个街道 | 
			
		
	
		
			
				
					|  |  |  |      * | 
			
		
	
		
			
				
					|  |  |  |      * @param staffId 当前登录用户id | 
			
		
	
		
			
				
					|  |  |  |      * @param currentCustomerId 当前客户id | 
			
		
	
		
			
				
					|  |  |  |      * @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public List<ProjectNextAgencyResultDTO> myNextAgencyMultic(String staffId) { | 
			
		
	
		
			
				
					|  |  |  |     public List<ProjectNextAgencyResultDTO> myNextAgencyMultic(String staffId,String currentCustomerId) { | 
			
		
	
		
			
				
					|  |  |  |         //多客户测试写死值,别忘了注释掉呀
 | 
			
		
	
		
			
				
					|  |  |  |         // staffId="3f04e397cc226e4e2f2531ac4363e3f9";
 | 
			
		
	
		
			
				
					|  |  |  |         // currentCustomerId="613cc61a6b8ce4c70d21bd413dac72cc";
 | 
			
		
	
		
			
				
					|  |  |  |         //1、当前工作人员所属组织信息
 | 
			
		
	
		
			
				
					|  |  |  |         Result<CustomerAgencyDTO> staffResult = govOrgOpenFeignClient.getAgencyByStaff(staffId); | 
			
		
	
		
			
				
					|  |  |  |         if (!staffResult.success() || null == staffResult.getData()) { | 
			
		
	
	
		
			
				
					|  |  | @ -417,26 +421,45 @@ public class ProjectServiceImpl implements ProjectService { | 
			
		
	
		
			
				
					|  |  |  |         staffAgency.setOrgId(staffResult.getData().getId()); | 
			
		
	
		
			
				
					|  |  |  |         staffAgency.setOrgName(staffResult.getData().getOrganizationName()); | 
			
		
	
		
			
				
					|  |  |  |         staffAgency.setOrgType("agency"); | 
			
		
	
		
			
				
					|  |  |  |         staffAgency.setAreaCode(staffResult.getData().getAreaCode()); | 
			
		
	
		
			
				
					|  |  |  |         resultList.add(staffAgency); | 
			
		
	
		
			
				
					|  |  |  |         //2、查询指标库当前组织的下级组织
 | 
			
		
	
		
			
				
					|  |  |  |         List<ScreenCustomerAgencyDTO> agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |         List<ScreenCustomerAgencyDTO> agencyDTOList =new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         Result<List<String>> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(currentCustomerId); | 
			
		
	
		
			
				
					|  |  |  |         if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { | 
			
		
	
		
			
				
					|  |  |  |             log.warn("❤当前客户存在子客户❤"); | 
			
		
	
		
			
				
					|  |  |  |             //如果包含子客户,则根据areaCode查询下一级
 | 
			
		
	
		
			
				
					|  |  |  |             agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |             //当前客户没有子客户,根据agencyId查询下一级组织
 | 
			
		
	
		
			
				
					|  |  |  |             agencyDTOList = screenAgencyService.queryNextAgencyList(StrConstant.EPMETY_STR, staffResult.getData().getId()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         if (CollectionUtils.isNotEmpty(agencyDTOList)) { | 
			
		
	
		
			
				
					|  |  |  |             agencyDTOList.forEach(agencyDTO -> { | 
			
		
	
		
			
				
					|  |  |  |                 ProjectNextAgencyResultDTO nextAgency = new ProjectNextAgencyResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |                 nextAgency.setOrgId(agencyDTO.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |                 nextAgency.setOrgName(agencyDTO.getAgencyName()); | 
			
		
	
		
			
				
					|  |  |  |                 nextAgency.setOrgType("agency"); | 
			
		
	
		
			
				
					|  |  |  |                 nextAgency.setAreaCode(agencyDTO.getAreaCode()); | 
			
		
	
		
			
				
					|  |  |  |                 resultList.add(nextAgency); | 
			
		
	
		
			
				
					|  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         //3、查询指标库当前组织的下级网格
 | 
			
		
	
		
			
				
					|  |  |  |         List<ScreenCustomerGridDTO> gridList = screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |         List<ScreenCustomerGridDTO> gridList = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { | 
			
		
	
		
			
				
					|  |  |  |             //如果包含子客户,则根据areaCode查询下一级网格
 | 
			
		
	
		
			
				
					|  |  |  |             gridList=screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); | 
			
		
	
		
			
				
					|  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |             //当前客户没有子客户,根据agencyId查询下一级网格
 | 
			
		
	
		
			
				
					|  |  |  |             gridList=screenAgencyService.queryGridList(StrConstant.EPMETY_STR,staffResult.getData().getId()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         if (CollectionUtils.isNotEmpty(gridList)) { | 
			
		
	
		
			
				
					|  |  |  |             gridList.forEach(gridDTO -> { | 
			
		
	
		
			
				
					|  |  |  |                 ProjectNextAgencyResultDTO grid = new ProjectNextAgencyResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |                 grid.setOrgId(gridDTO.getGridId()); | 
			
		
	
		
			
				
					|  |  |  |                 grid.setOrgName(gridDTO.getGridName()); | 
			
		
	
		
			
				
					|  |  |  |                 grid.setOrgType("grid"); | 
			
		
	
		
			
				
					|  |  |  |                 grid.setAreaCode(gridDTO.getAreaCode()); | 
			
		
	
		
			
				
					|  |  |  |                 resultList.add(grid); | 
			
		
	
		
			
				
					|  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
	
		
			
				
					|  |  | 
 |