| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.enums.DictTypeEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -43,6 +44,7 @@ import com.epmet.dto.form.demand.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.AllGridsByUserIdResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.UserBaseInfoResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.demand.DemandRecResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.demand.IcResiUserReportDemandRes; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.EpmetAdminOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.EpmetUserOpenFeignClient; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -301,7 +303,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        break; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }*/ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                 //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?serviceTypeMap.get(res.getServiceType()):StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat(serviceTypeMap.get(res.getServiceType())):StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                /*switch(res.getServiceType()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    case UserDemandConstant.VOLUNTEER : | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        res.setServiceShowName(res.getServiceName().concat("(志愿者)")); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -455,4 +457,87 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        demandSatisfactionDao.insert(satisfactionEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 数据分析-个人档案,居民需求列表table | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param formDTO | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public PageData<IcResiUserReportDemandRes> queryMyDemand(IcResiUserDemandFromDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageInfo<IcResiUserReportDemandRes> pageInfo = PageHelper.startPage(formDTO.getPageNo(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectUserDemand(formDTO)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcResiUserReportDemandRes> list = pageInfo.getList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isNotEmpty(list)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 1、状态字典
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //2、查询分类名称
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<String> categoryCodes = list.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<IcResiDemandDictEntity> dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            for (IcResiUserReportDemandRes resDto : list) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resDto.setCategoryName(dictMap.get(resDto.getCategoryCode())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new PageData<>(list, pageInfo.getTotal()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 数据分析-个人档案、居民需求列表-查看需求详情 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param formDTO | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        DemandRecResultDTO res = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (null != res) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            customerGridFormDTO.setGridId(res.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<CustomerGridDTO> gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            res.setGridName(gridInfoRes.success() && null != gridInfoRes.getData() ? gridInfoRes.getData().getGridNamePath() : StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            res.setCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getCategoryCode())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (UserDemandConstant.VOLUNTEER.equals(res.getServiceType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // 如果服务方是志愿者,需要查询小程序端的志愿者姓名
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<String> userIdList = Arrays.asList(res.getServerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (!userInfoRes.success() || CollectionUtils.isEmpty(userInfoRes.getData())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询志愿者信息异常"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                res.setServiceName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //查询字典表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<Map<String, String>> reportTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, String> reportTypeMap = reportTypeRes.success() && MapUtils.isNotEmpty(reportTypeRes.getData()) ? reportTypeRes.getData() : new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<Map<String, String>> serviceTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, String> serviceTypeMap = serviceTypeRes.success() && MapUtils.isNotEmpty(serviceTypeRes.getData()) ? serviceTypeRes.getData() : new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            res.setReportTypeName(reportTypeMap.containsKey(res.getReportType()) ? reportTypeMap.get(res.getReportType()) : StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            res.setStatusName(statusMap.containsKey(res.getStatus()) ? statusMap.get(res.getStatus()) : StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType()) ? res.getServiceName().concat(serviceTypeMap.get(res.getServiceType())) : StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return res; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} |