From 75f9894ebac12b13c7ead27c3e16db833ee9251a Mon Sep 17 00:00:00 2001 From: z1415143022 <z1415143022@163.com> Date: 星期二, 25 三月 2025 20:02:45 +0800 Subject: [PATCH] Merge branch 'develop1.0' into zhangjw_from_develop1.0 --- zhitan-system/src/main/java/com/zhitan/statisticalAnalysis/service/impl/StatisticalAnalysisServiceImpl.java | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-) diff --git a/zhitan-system/src/main/java/com/zhitan/statisticalAnalysis/service/impl/StatisticalAnalysisServiceImpl.java b/zhitan-system/src/main/java/com/zhitan/statisticalAnalysis/service/impl/StatisticalAnalysisServiceImpl.java index 257f890..d0ea2f0 100644 --- a/zhitan-system/src/main/java/com/zhitan/statisticalAnalysis/service/impl/StatisticalAnalysisServiceImpl.java +++ b/zhitan-system/src/main/java/com/zhitan/statisticalAnalysis/service/impl/StatisticalAnalysisServiceImpl.java @@ -6,7 +6,7 @@ import com.zhitan.common.constant.TimeTypeConst; import com.zhitan.common.enums.TimeType; import com.zhitan.dataitem.service.IDataItemService; -import com.zhitan.model.domain.vo.ModelNodeIndexInfor; +import com.zhitan.model.domain.vo.ModelNodeIndexInfo; import com.zhitan.model.service.IModelNodeService; import com.zhitan.realtimedata.domain.DataItem; import com.zhitan.statisticalAnalysis.domain.dto.DataAnalysisMoMDTO; @@ -41,14 +41,14 @@ public List<DataAnalysisYoYVO> listElectricDataComparisonYoY(DataAnalysisMoMDTO dto) { List<DataAnalysisYoYVO> yoyList = new ArrayList<>(); // 鏌ヨ鐐逛綅涓庣敤鑳藉崟鍏冧俊鎭� - List<ModelNodeIndexInfor> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); + List<ModelNodeIndexInfo> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); if (CollectionUtils.isEmpty(nodeInforList)) { return yoyList; } - List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); // 鎸夌収鐐逛綅杩涜鍒嗙粍 - Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeInforList.stream().collect( - Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); + Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeInforList.stream().collect( + Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); // 鑾峰彇鏌ヨ鏃堕棿 Date beginTime = dto.getBeginTime(); Date endTime = dto.getEndTime(); @@ -62,12 +62,12 @@ BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); nodeIndexMap.forEach((key, value) -> { DataAnalysisYoYVO yoyVO = new DataAnalysisYoYVO(); - Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); + Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); first.ifPresent(modelNodeIndexInfor -> yoyVO.setEnergyUnitName(modelNodeIndexInfor.getName())); // 璧嬪�煎崟浣� yoyVO.setUnit("kWh"); // 鎵惧嚭indexIds - List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); // 姹傚拰 BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); @@ -93,11 +93,11 @@ public List<DataAnalysisMoMVO> listElectricDataComparisonMoM(DataAnalysisMoMDTO dto) { List<DataAnalysisMoMVO> momList = new ArrayList<>(); // 鏍规嵁id鏌ヨ鐐逛綅淇℃伅 - List<ModelNodeIndexInfor> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); + List<ModelNodeIndexInfo> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); if (CollectionUtils.isEmpty(nodeIndexInforList)) { return momList; } - List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); Date beginTime = dto.getBeginTime(); Date endTime = dto.getEndTime(); Date lastTime; @@ -121,8 +121,8 @@ lastEndTime = DateUtil.offset(endTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1); } // 鎸夌収鐐逛綅杩涜鍒嗙粍 - Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( - Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); + Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeIndexInforList.stream().collect( + Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); // 鏍规嵁indexId鏌ヨdataItem List<DataItem> dataItemList = dataItemService.getDataItemHourInforByIndexIds(beginTime, endTime, TimeType.HOUR.name(), indexIds); List<DataItem> lastDataItemList = dataItemService.getDataItemHourInforByIndexIds(lastTime, lastEndTime, TimeType.HOUR.name(), indexIds); @@ -130,12 +130,12 @@ BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); nodeIndexMap.forEach((key, value) -> { DataAnalysisMoMVO momVO = new DataAnalysisMoMVO(); - Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); + Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); first.ifPresent(modelNodeIndexInfor -> momVO.setEnergyUnitName(modelNodeIndexInfor.getName())); // 璧嬪�煎崟浣� momVO.setUnit("kWh"); // 鎵惧嚭indexIds - List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); // 姹傚拰 BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); @@ -161,14 +161,14 @@ public List<DataAnalysisYoYVO> listWaterDataComparisonYoY(DataAnalysisMoMDTO dto) { List<DataAnalysisYoYVO> yoyList = new ArrayList<>(); // 鏌ヨ鐐逛綅涓庣敤鑳藉崟鍏冧俊鎭� - List<ModelNodeIndexInfor> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); + List<ModelNodeIndexInfo> nodeInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); if (CollectionUtils.isEmpty(nodeInforList)) { return yoyList; } - List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIds = nodeInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); // 鎸夌収鐐逛綅杩涜鍒嗙粍 - Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeInforList.stream().collect( - Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); + Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeInforList.stream().collect( + Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); // 鏃堕棿绫诲瀷 // 鑾峰彇鏌ヨ鏃堕棿 Date beginTime = dto.getBeginTime(); @@ -183,12 +183,12 @@ BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); nodeIndexMap.forEach((key, value) -> { DataAnalysisYoYVO yoyVO = new DataAnalysisYoYVO(); - Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); + Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); first.ifPresent(modelNodeIndexInfor -> yoyVO.setEnergyUnitName(modelNodeIndexInfor.getName())); // 璧嬪�煎崟浣� yoyVO.setUnit("m鲁"); // 鎵惧嚭indexIds - List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); // 姹傚拰 BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); @@ -214,11 +214,11 @@ public List<DataAnalysisMoMVO> listWaterDataComparisonMoM(DataAnalysisMoMDTO dto) { List<DataAnalysisMoMVO> momList = new ArrayList<>(); // 鏍规嵁id鏌ヨ鐐逛綅淇℃伅 - List<ModelNodeIndexInfor> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); + List<ModelNodeIndexInfo> nodeIndexInforList = listModelNodeIndexIdRelationInfor(dto.getNodeId()); if (CollectionUtils.isEmpty(nodeIndexInforList)) { return momList; } - List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIds = nodeIndexInforList.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); Date beginTime = dto.getBeginTime(); Date endTime = dto.getEndTime(); Date lastTime; @@ -242,8 +242,8 @@ lastEndTime = DateUtil.offset(endTime, DateField.YEAR, CommonConst.DIGIT_MINUS_1); } // 鎸夌収鐐逛綅杩涜鍒嗙粍 - Map<String, List<ModelNodeIndexInfor>> nodeIndexMap = nodeIndexInforList.stream().collect( - Collectors.groupingBy(ModelNodeIndexInfor::getNodeId)); + Map<String, List<ModelNodeIndexInfo>> nodeIndexMap = nodeIndexInforList.stream().collect( + Collectors.groupingBy(ModelNodeIndexInfo::getNodeId)); // 鏌ヨ瀵瑰簲indexIds锛屾壘鍒板搴攄ataItem淇℃伅 List<DataItem> dataItemList = dataItemService.getDataItemHourInforByIndexIds(beginTime, endTime, TimeType.HOUR.name(), indexIds); List<DataItem> lastDataItemList = dataItemService.getDataItemHourInforByIndexIds(lastTime, lastEndTime, TimeType.HOUR.name(), indexIds); @@ -251,12 +251,12 @@ BigDecimal multiple = BigDecimal.valueOf(CommonConst.DIGIT_100); nodeIndexMap.forEach((key, value) -> { DataAnalysisMoMVO momVO = new DataAnalysisMoMVO(); - Optional<ModelNodeIndexInfor> first = value.stream().findFirst(); + Optional<ModelNodeIndexInfo> first = value.stream().findFirst(); first.ifPresent(modelNodeIndexInfor -> momVO.setEnergyUnitName(modelNodeIndexInfor.getName())); // 璧嬪�煎崟浣� momVO.setUnit("m鲁"); // 鎵惧嚭indexIds - List<String> indexIdList = value.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); + List<String> indexIdList = value.stream().map(ModelNodeIndexInfo::getIndexId).collect(Collectors.toList()); // 姹傚拰 BigDecimal sum = BigDecimal.valueOf(dataItemList.stream().filter(li -> indexIdList.contains(li.getIndexId())) .mapToDouble(DataItem::getValue).sum()).setScale(CommonConst.DIGIT_2, RoundingMode.HALF_UP); @@ -278,11 +278,11 @@ /** * 鏌ヨ鐐逛綅涓庣敤鑳藉崟鍏冧俊鎭� */ - private List<ModelNodeIndexInfor> listModelNodeIndexIdRelationInfor(String nodeId) { - List<ModelNodeIndexInfor> nodeInforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(nodeId); + private List<ModelNodeIndexInfo> listModelNodeIndexIdRelationInfor(String nodeId) { + List<ModelNodeIndexInfo> nodeInforList = modelNodeService.listModelNodeIndexIdRelationInforByParentId(nodeId); // 濡傛灉鏄┖瀛樺湪涓ょ鎯呭喌锛�1锛歩d鏈夐棶棰橈紝2锛氭渶搴曞眰 if (CollectionUtils.isEmpty(nodeInforList)) { - List<ModelNodeIndexInfor> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(nodeId); + List<ModelNodeIndexInfo> inforList = modelNodeService.getModelNodeIndexIdRelationInforByNodeId(nodeId); if (CollectionUtils.isNotEmpty(inforList)) { nodeInforList.addAll(inforList); } -- Gitblit v1.9.3