|  | @ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; | 
			
		
	
		
		
			
				
					|  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.constant.NumConstant; |  |  | import com.epmet.commons.tools.constant.NumConstant; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.constant.StrConstant; |  |  | import com.epmet.commons.tools.constant.StrConstant; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.commons.tools.exception.EpmetException; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.exception.RenException; |  |  | import com.epmet.commons.tools.exception.RenException; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.commons.tools.page.PageData; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; |  |  | import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; |  |  | import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.utils.ConvertUtils; |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
	
		
		
			
				
					|  | @ -16,6 +18,7 @@ import com.epmet.dto.IcResiCategoryWarnConfigDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |  |  | import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.form.IcUserWarnNoticeFormDTO; |  |  | import com.epmet.dto.form.IcUserWarnNoticeFormDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.form.StatsResiListFormDTO; |  |  | import com.epmet.dto.form.StatsResiListFormDTO; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.dto.form.StatsResiWarnFormDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.result.*; |  |  | import com.epmet.dto.result.*; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.entity.IcResiUserEntity; |  |  | import com.epmet.entity.IcResiUserEntity; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.entity.IcStatsResiWarnEntity; |  |  | import com.epmet.entity.IcStatsResiWarnEntity; | 
			
		
	
	
		
		
			
				
					|  | @ -24,12 +27,13 @@ import com.epmet.feign.OperCustomizeOpenFeignClient; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.IcStatsResiWarnService; |  |  | import com.epmet.service.IcStatsResiWarnService; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.StatsResiWarnService; |  |  | import com.epmet.service.StatsResiWarnService; | 
			
		
	
		
		
			
				
					|  |  | import com.github.pagehelper.PageHelper; |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.github.pagehelper.PageInfo; | 
			
		
	
		
		
			
				
					|  |  | import lombok.extern.slf4j.Slf4j; |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import org.apache.commons.collections4.CollectionUtils; | 
			
		
	
		
		
			
				
					|  |  | import org.apache.commons.lang3.StringUtils; |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
		
		
			
				
					|  |  | import org.springframework.beans.factory.annotation.Autowired; |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
		
			
				
					|  |  | import org.springframework.stereotype.Service; |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
		
			
				
					|  |  | import org.springframework.transaction.annotation.Transactional; |  |  | import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
		
			
				
					|  |  | import org.springframework.util.CollectionUtils; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | import javax.annotation.Resource; |  |  | import javax.annotation.Resource; | 
			
		
	
		
		
			
				
					|  |  | import java.math.BigDecimal; |  |  | import java.math.BigDecimal; | 
			
		
	
	
		
		
			
				
					|  | @ -173,7 +177,6 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { | 
			
		
	
		
		
			
				
					|  |  |         //根据buildingID,tableName he columnName获取名字
 |  |  |         //根据buildingID,tableName he columnName获取名字
 | 
			
		
	
		
		
			
				
					|  |  |         //限制条数 一栋楼内最多显示1000 即可
 |  |  |         //限制条数 一栋楼内最多显示1000 即可
 | 
			
		
	
		
		
			
				
					|  |  |         for (String s : buildingIdList) { |  |  |         for (String s : buildingIdList) { | 
			
		
	
		
		
			
				
					|  |  |             PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_HUNDRED,false).doSelectPage(()->{ |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, Arrays.asList(s), icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); |  |  |             List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, Arrays.asList(s), icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); | 
			
		
	
		
		
			
				
					|  |  |             if (!CollectionUtils.isEmpty(dtos)){ |  |  |             if (!CollectionUtils.isEmpty(dtos)){ | 
			
		
	
		
		
			
				
					|  |  |                 Map<String, List<UserWarnNameListResultDTO>> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); |  |  |                 Map<String, List<UserWarnNameListResultDTO>> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); | 
			
		
	
	
		
		
			
				
					|  | @ -181,12 +184,11 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { | 
			
		
	
		
		
			
				
					|  |  |                     item.setConfigId(configId); |  |  |                     item.setConfigId(configId); | 
			
		
	
		
		
			
				
					|  |  |                     groupByBuild.forEach((k,v) -> { |  |  |                     groupByBuild.forEach((k,v) -> { | 
			
		
	
		
		
			
				
					|  |  |                         if (item.getBuildingId().equals(k)){ |  |  |                         if (item.getBuildingId().equals(k)){ | 
			
		
	
		
		
			
				
					
					|  |  |                                 item.setUserList(v); |  |  |                             item.setCount(v.size()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                         } |  |  |                         } | 
			
		
	
		
		
			
				
					|  |  |                     }); |  |  |                     }); | 
			
		
	
		
		
			
				
					|  |  |                 }); |  |  |                 }); | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |             }); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |         /*PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_THOUSAND,false).doSelectPage(()->{ |  |  |         /*PageHelper.startPage(NumConstant.ONE,NumConstant.ONE_THOUSAND,false).doSelectPage(()->{ | 
			
		
	
		
		
			
				
					|  |  |             List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); |  |  |             List<UserWarnNameListResultDTO> dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); | 
			
		
	
	
		
		
			
				
					|  | @ -205,6 +207,41 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { | 
			
		
	
		
		
			
				
					|  |  |         return mapResult; |  |  |         return mapResult; | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     @Override | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     public PageData<UserWarnNameListResultDTO> allUserWarnList(StatsResiWarnFormDTO formDTO) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         //获取configId预警配置信息
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         IcResiCategoryWarnConfigDTO formDto = new IcResiCategoryWarnConfigDTO(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         formDto.setId(formDTO.getConfigId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         Result<IcResiCategoryWarnConfigDTO> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnInfoById(formDto); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         if (!warnResult.success() || null == warnResult.getData()) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             throw new RenException("获取预警配置信息失败,configId="+ formDTO.getConfigId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         IcResiCategoryWarnConfigDTO icResiCategoryWarnConfigDTO = warnResult.getData(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         List<UserWarnNameListResultDTO> list = icStatsResiWarnDao.userWarnListDTO(formDTO.getCustomerId(), | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 Collections.singletonList(formDTO.getBuildingId()), | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     icResiCategoryWarnConfigDTO.getTableName(), | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         icResiCategoryWarnConfigDTO.getColumnName()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         PageInfo<UserWarnNameListResultDTO> pageInfo = new PageInfo<>(list); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         if (CollectionUtils.isNotEmpty(list)) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             Set<String> homeIds = list.stream().map(UserWarnNameListResultDTO::getHomeId).collect(Collectors.toSet()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(homeIds, formDTO.getCustomerId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             if (!houseInfoRes.success() || CollectionUtils.isEmpty(houseInfoRes.getData())){ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 throw new EpmetException("查询居民所属房屋失败..."); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             Map<String, HouseInfoDTO> houseMap = houseInfoRes.getData().stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             list.forEach(item -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 HouseInfoDTO houseInfo = houseMap.get(item.getHomeId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 if (null != houseInfo) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     item.setUnitName(houseInfo.getUnitName()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     item.setDoorName(houseInfo.getDoorName()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         return new PageData<>(list, pageInfo.getTotal()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     @Override |  |  |     @Override | 
			
		
	
		
		
			
				
					|  |  |     public List<IcStatsResiResultDTO> list(String customerId,String id, String level) { |  |  |     public List<IcStatsResiResultDTO> list(String customerId,String id, String level) { | 
			
		
	
		
		
			
				
					|  |  |         //获取所有配置类项 getshow
 |  |  |         //获取所有配置类项 getshow
 | 
			
		
	
	
		
		
			
				
					|  | 
 |