| | |
| | | }); |
| | | |
| | | |
| | | |
| | | nodeIndexMap.forEach((nodeId,indexList)->{ |
| | | indexList.forEach(index->{ |
| | | final String energyId = index.getEnergyId(); |
| | |
| | | // return consumptionAnalysisVO; |
| | | // } |
| | | //修改过滤统计点位 |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().filter(x->x.getIndexType().equals("STATISTIC")).map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | nodeIndexInforList = nodeIndexInforList.stream().filter(x -> "STATISTIC".equals(x.getIndexType())).collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().filter(x -> "STATISTIC".equals(x.getIndexType())).map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList),SysEnergy::getEnersno,eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | throw new RuntimeException("能源类型" + energyId + "没有配置折标系数,无法计算"); |
| | | } |
| | | |
| | | sum = sum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP);; |
| | | sum = sum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP); |
| | | ; |
| | | // if(energyProportionMap.containsKey(energyId)) { |
| | | // energyProportionMap.put(energyId,energyProportionMap.get(energyId) + sum.doubleValue()); |
| | | // }else { |
| | |
| | | throw new RuntimeException("能源类型" + energyId + "没有配置折标系数,无法计算"); |
| | | } |
| | | |
| | | lastSum = lastSum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP);; |
| | | lastSum = lastSum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP); |
| | | ; |
| | | } |
| | | } |
| | | data.setCurrentValue(sum.doubleValue()); |
| | |
| | | // if (CollectionUtils.isEmpty(nodeIndexInforList)) { |
| | | // return consumptionAnalysisVO; |
| | | // } |
| | | |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | nodeIndexInforList = nodeIndexInforList.stream().filter(x -> "STATISTIC".equals(x.getIndexType())).collect(Collectors.toList()); |
| | | final List<String> eneryIdList = nodeIndexInforList.stream().filter(x -> "STATISTIC".equals(x.getIndexType())).map(ModelNodeIndexInfor::getEnergyId).distinct().collect(Collectors.toList()); |
| | | final LambdaQueryWrapper<SysEnergy> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CollectionUtils.isNotEmpty(eneryIdList),SysEnergy::getEnersno,eneryIdList); |
| | | final List<SysEnergy> sysEnergies = sysEnergyMapper.selectList(queryWrapper); |
| | |
| | | throw new RuntimeException("能源类型" + energyId + "没有配置折标系数,无法计算"); |
| | | } |
| | | |
| | | sum = sum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP);; |
| | | sum = sum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP); |
| | | ; |
| | | // if(energyProportionMap.containsKey(energyId)) { |
| | | // energyProportionMap.put(energyId,energyProportionMap.get(energyId) + sum.doubleValue()); |
| | | // }else { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Map<String, List<DataItem>> indexDataItemMap = dataItemList.stream().collect(Collectors.groupingBy(DataItem::getIndexId)); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | // 根据indexId查询dataItem |
| | | List<DataItem> dataItemList = new ArrayList<>(); |
| | | if(CollectionUtils.isNotEmpty(indexIds)) { |
| | |
| | | throw new RuntimeException("能源类型" + energyId + "没有配置折标系数,无法计算"); |
| | | } |
| | | |
| | | sum = sum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP);; |
| | | sum = sum.add(new BigDecimal(dataItem.getValue()).multiply(coefficient)).setScale(2, RoundingMode.HALF_UP); |
| | | ; |
| | | } |
| | | |
| | | } |