| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -2,6 +2,7 @@ package com.epmet.service.impl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.alibaba.fastjson.JSON; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -9,8 +10,6 @@ import com.epmet.dao.IcResiUserDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.IcStatsResiWarnDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcResiCategoryStatsConfigDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcResiCategoryWarnConfigDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.PersonWarnLeftPieDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.CategoryCountListFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.StatsResiListFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.*; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -20,6 +19,7 @@ import com.epmet.feign.GovOrgOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.OperCustomizeOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.IcStatsResiWarnService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.StatsResiWarnService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -159,26 +159,21 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcResiCategoryWarnConfigDTO icResiCategoryWarnConfigDTO = warnResult.getData(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //根据buildingID,tableName he columnName获取名字
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        List<Map<String, String>> maps = icStatsResiWarnDao.userWarnList(customerId,buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName());
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        result.forEach(item->{
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            item.setConfigId(configId);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            List<Map<String, String>> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList());
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//            item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames"));
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//        });
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!CollectionUtils.isEmpty(dtos)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, List<UserWarnNameListResultDTO>> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            result.forEach(item->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                item.setConfigId(configId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                groupByBuild.forEach((k,v) -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (item.getBuildingId().equals(k)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        item.setUserList(v); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //限制条数 一栋楼内最多显示1000 即可
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_THOUSAND,false).doSelectPage(()->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!CollectionUtils.isEmpty(dtos)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Map<String, List<UserWarnNameListResultDTO>> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                result.forEach(item->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    item.setConfigId(configId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    groupByBuild.forEach((k,v) -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (item.getBuildingId().equals(k)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            item.setUserList(v); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return mapResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |