| | |
| | | areaIdSet.addAll(parseIdList(record.getAreaDivideIds())); |
| | | } |
| | | |
| | | // 汇总场景关联的区域与设备,便于统计设备数量 |
| | | Map<Long, BigDecimal> areaSizeMap = new HashMap<>(); |
| | | Map<Long, List<Long>> areaDeviceMap = new HashMap<>(); |
| | | Set<Long> deviceIdSet = new HashSet<>(); |
| | |
| | | |
| | | Map<Long, String> deviceTypeMap = new HashMap<>(); |
| | | if (!deviceIdSet.isEmpty()) { |
| | | // 批量拉取设备类型,降低循环查询成本 |
| | | List<FwDeviceEntity> deviceList = fwDeviceService.listByIds(deviceIdSet); |
| | | for (FwDeviceEntity device : deviceList) { |
| | | if (device == null || device.getId() == null) { |
| | |
| | | if (areaIds == null || areaIds.isEmpty()) { |
| | | return 0; |
| | | } |
| | | // 面积按平方米整数返回 |
| | | BigDecimal total = BigDecimal.ZERO; |
| | | for (Long areaId : areaIds) { |
| | | BigDecimal areaSize = areaSizeMap.get(areaId); |