Browse Source

Merge branch 'ppt-20260120' into zhc

ppt-20260120
zhczyx@163.com 1 month ago
parent
commit
33a65f8bfd
  1. 27
      dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java

27
dongjian-dashboard-back-service/src/main/java/com/dongjian/dashboard/back/service/impl/OverviewServiceImpl.java

@ -95,6 +95,12 @@ public class OverviewServiceImpl implements OverviewService {
MonitoringPointCategorySearchParams categorySearchParam = new MonitoringPointCategorySearchParams(); MonitoringPointCategorySearchParams categorySearchParam = new MonitoringPointCategorySearchParams();
categorySearchParam.setCompanyIdList(List.of(companyId)); categorySearchParam.setCompanyIdList(List.of(companyId));
List<MonitoringPointCategoryPageVO> categoryList = monitoringPointCategoryMapperExt.getListPage(categorySearchParam); List<MonitoringPointCategoryPageVO> categoryList = monitoringPointCategoryMapperExt.getListPage(categorySearchParam);
List<Long> allCategoryIds = categoryList.stream()
.map(MonitoringPointCategoryPageVO::getMonitoringPointCategoryId)
.filter(Objects::nonNull)
.toList();
//所有楼宇的监测点分类 //所有楼宇的监测点分类
Map<String, Object> allCategoryParamMap = new HashMap<>(); Map<String, Object> allCategoryParamMap = new HashMap<>();
allCategoryParamMap.put("companyId", companyId); allCategoryParamMap.put("companyId", companyId);
@ -113,16 +119,17 @@ public class OverviewServiceImpl implements OverviewService {
)); ));
Map<Long, List<Long>> notExistingCategoryMap = new HashMap<>(); Map<Long, List<Long>> notExistingCategoryMap = new HashMap<>();
existingCategoryMap.forEach((buildingId, existingCategoryIds) -> { for (OverviewVO building : buildingInfoList) {
List<Long> missingCategoryIds = Long buildingId = building.getBuildingId();
categoryList.stream() Set<Long> existingIds = existingCategoryMap.getOrDefault(buildingId, Collections.emptySet());
.map(MonitoringPointCategoryPageVO::getMonitoringPointCategoryId) List<Long> missingIds = new ArrayList<>();
.filter(Objects::nonNull) for (Long categoryId : allCategoryIds) {
.filter(id -> !existingCategoryIds.contains(id)) if (!existingIds.contains(categoryId)) {
.collect(Collectors.toList()); missingIds.add(categoryId);
}
notExistingCategoryMap.put(buildingId, missingCategoryIds); }
}); notExistingCategoryMap.put(buildingId, missingIds);
}
return notExistingCategoryMap; return notExistingCategoryMap;
} }

Loading…
Cancel
Save