|
|
@ -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; |
|
|
} |
|
|
} |
|
|
@ -189,6 +196,7 @@ public class OverviewServiceImpl implements OverviewService { |
|
|
|
|
|
|
|
|
// 分组监测点分类
|
|
|
// 分组监测点分类
|
|
|
List<OverviewVO.MonitoringPointCategoryAlarm> categoryAlarms = buildingInfos.stream() |
|
|
List<OverviewVO.MonitoringPointCategoryAlarm> categoryAlarms = buildingInfos.stream() |
|
|
|
|
|
.filter(dto -> dto.getMonitoringPointCategoryId() != null) |
|
|
.collect(Collectors.groupingBy(OverviewInfo::getMonitoringPointCategoryId)) |
|
|
.collect(Collectors.groupingBy(OverviewInfo::getMonitoringPointCategoryId)) |
|
|
.entrySet() |
|
|
.entrySet() |
|
|
.stream() |
|
|
.stream() |
|
|
|