|  |  | @ -17,6 +17,7 @@ | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | package com.epmet.service.impl; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import cn.hutool.core.bean.BeanUtil; | 
			
		
	
		
			
				
					|  |  |  | import com.alibaba.fastjson.JSON; | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
	
		
			
				
					|  |  | @ -37,12 +38,14 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.security.dto.TokenDto; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.IcPlatformConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.SystemMessageType; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.UserConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dao.IcResiUserDao; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.CustomerAgencyDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.CustomerGridDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcHouseDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcResiCategoryStatsConfigDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcNeighborHoodDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.*; | 
			
		
	
	
		
			
				
					|  |  | @ -56,6 +59,7 @@ import com.github.pagehelper.PageInfo; | 
			
		
	
		
			
				
					|  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.collections4.CollectionUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
			
		
	
	
		
			
				
					|  |  | @ -526,6 +530,33 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
			
		
	
		
			
				
					|  |  |  |          * 先查询customize配置的 | 
			
		
	
		
			
				
					|  |  |  |          * 再根据配置去查询字段 | 
			
		
	
		
			
				
					|  |  |  |          */ | 
			
		
	
		
			
				
					|  |  |  |         IcResiCategoryStatsConfigDTO dto = new IcResiCategoryStatsConfigDTO(); | 
			
		
	
		
			
				
					|  |  |  |         dto.setCustomerId(personData.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |         Result<List<IcResiCategoryStatsConfigDTO>> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(dto); | 
			
		
	
		
			
				
					|  |  |  |         if (!categoryListResult.success()){ | 
			
		
	
		
			
				
					|  |  |  |             throw new RenException("查询客户下的人员类别失败..."); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         List<IcResiCategoryStatsConfigDTO> categoryData = categoryListResult.getData(); | 
			
		
	
		
			
				
					|  |  |  |         if (!CollectionUtils.isEmpty(categoryData)){ | 
			
		
	
		
			
				
					|  |  |  |             Map<String, List<IcResiCategoryStatsConfigDTO>> groupByStatus = categoryData.stream().collect(Collectors.groupingBy(IcResiCategoryStatsConfigDTO::getStatus)); | 
			
		
	
		
			
				
					|  |  |  |             List<IcResiCategoryStatsConfigDTO> showList = groupByStatus.get(IcPlatformConstant.PERSON_CATEGORY_SHOW); | 
			
		
	
		
			
				
					|  |  |  |             List<String> personCategoryList = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |             if (!CollectionUtils.isEmpty(showList)){ | 
			
		
	
		
			
				
					|  |  |  |                 Map<String, List<IcResiCategoryStatsConfigDTO>> groupByTableName = showList.stream().collect(Collectors.groupingBy(IcResiCategoryStatsConfigDTO::getTableName)); | 
			
		
	
		
			
				
					|  |  |  |                 groupByTableName.forEach((tableName,list) -> { | 
			
		
	
		
			
				
					|  |  |  |                     List<String> columns = list.stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String, String> result = baseDao.selectPersonType(columns, personData.getCustomerId(), tableName); | 
			
		
	
		
			
				
					|  |  |  |                     list.forEach(l -> { | 
			
		
	
		
			
				
					|  |  |  |                         result.forEach((k,v) -> { | 
			
		
	
		
			
				
					|  |  |  |                             if (l.getColumnName().equals(k) && v.equals(NumConstant.ONE_STR)){ | 
			
		
	
		
			
				
					|  |  |  |                                 personCategoryList.add(l.getLabel()); | 
			
		
	
		
			
				
					|  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |                         }); | 
			
		
	
		
			
				
					|  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |                 personData.setPersonCategory(personCategoryList); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return personData; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |