|  |  | @ -42,9 +42,11 @@ import com.epmet.dto.CustomerAgencyDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.CustomerGridDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcUserDemandRecDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.CustomerGridFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.ResiUserFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.demand.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.AllGridsByUserIdResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.IcResiUserBriefDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.ResiUserResDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.UserBaseInfoResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.demand.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.*; | 
			
		
	
	
		
			
				
					|  |  | @ -583,7 +585,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         IcResiUserBriefDTO icResiUserDTO = userRes.getData(); | 
			
		
	
		
			
				
					|  |  |  |         DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, DemandResearchAnalysisResultDTO.class); | 
			
		
	
		
			
				
					|  |  |  |         resultDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList()); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         //返参格式套一层类别和类别名称
 | 
			
		
	
		
			
				
					|  |  |  |         List<DemandDataDTO> demandData=new ArrayList<>(); | 
			
		
	
	
		
			
				
					|  |  | @ -593,12 +595,34 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
			
		
	
		
			
				
					|  |  |  |         demandDataDTO.setDemandList(new ArrayList<>()); | 
			
		
	
		
			
				
					|  |  |  |         demandData.add(demandDataDTO); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         //如果是服务措施分析来的,并且是pc录入的需求,需要先去找epmetUserIdList
 | 
			
		
	
		
			
				
					|  |  |  |         if(UserDemandConstant.DEMAND_ANALYSIS.equals(formDTO.getQueryOrigin()) | 
			
		
	
		
			
				
					|  |  |  |                 &&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ | 
			
		
	
		
			
				
					|  |  |  |             ResiUserFormDTO resiUserFormDTO=new ResiUserFormDTO(); | 
			
		
	
		
			
				
					|  |  |  |             resiUserFormDTO.setCustomerId(formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |             resiUserFormDTO.setIcResiUserId(formDTO.getIcResiUserId()); | 
			
		
	
		
			
				
					|  |  |  |             Result<ResiUserResDTO> resiRes=epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); | 
			
		
	
		
			
				
					|  |  |  |             if(!resiRes.success()){ | 
			
		
	
		
			
				
					|  |  |  |                 throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询小程序用户异常"); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) { | 
			
		
	
		
			
				
					|  |  |  |                 formDTO.setEpmetUserIdList(resiRes.getData().getEpmetUserIdList()); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         //获取当前需求人,相同分类的需求列表。不分页,直接返回所有
 | 
			
		
	
		
			
				
					|  |  |  |         List<String> userIds=new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         userIds.add(formDTO.getIcResiUserId()); | 
			
		
	
		
			
				
					|  |  |  |         if(StringUtils.isNotBlank(formDTO.getIcResiUserId())){ | 
			
		
	
		
			
				
					|  |  |  |             userIds.add(formDTO.getIcResiUserId()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ | 
			
		
	
		
			
				
					|  |  |  |             userIds.addAll(formDTO.getEpmetUserIdList()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ | 
			
		
	
		
			
				
					|  |  |  |             //需求人不能为空
 | 
			
		
	
		
			
				
					|  |  |  |             throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空"); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         IcResiUserDemandFromDTO icResiUserDemandFromDTO=new IcResiUserDemandFromDTO(); | 
			
		
	
		
			
				
					|  |  |  |         icResiUserDemandFromDTO.setUserIds(userIds); | 
			
		
	
		
			
				
					|  |  |  |         icResiUserDemandFromDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode()); | 
			
		
	
	
		
			
				
					|  |  | @ -625,6 +649,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             demandData.get(NumConstant.ZERO).setDemandList(CollectionUtils.isNotEmpty(demandList) ? demandList : Collections.emptyList()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         resultDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList()); | 
			
		
	
		
			
				
					|  |  |  |         resultDTO.setDemandData(demandData); | 
			
		
	
		
			
				
					|  |  |  |         return resultDTO; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  | 
 |