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