| | |
| | | @Override |
| | | public List<HomeEnergyStatisticsVO> energyConsumptionSummation(String timeType, String modelcode) { |
| | | Date currentTime = new Date(); |
| | | // Date currentTime = DateUtil.parseDateTime("2023-04-11 00:00:00"); |
| | | |
| | | DateTime tongbiTime = DateUtil.offsetMonth(currentTime, -12); |
| | | DateTime huanbiTime = DateUtil.offsetMonth(currentTime, -1); |
| | | if(TimeType.DAY.name().equals( timeType)){ |
| | | huanbiTime = DateUtil.offsetDay(currentTime, -1); |
| | | } |
| | | |
| | | final List<HomeEnergyStatisticsVO> current = getEnergyTotalByTime(timeType, modelcode, currentTime); |
| | | final List<HomeEnergyStatisticsVO> tongbi = getEnergyTotalByTime(timeType, modelcode, tongbiTime); |
| | | final List<HomeEnergyStatisticsVO> huanbi = getEnergyTotalByTime(timeType, modelcode, huanbiTime); |
| | |
| | | final List<ElectricityDataItem> electricityDataItems = electricityDataMap.get(vo.getTimeType()); |
| | | if(null != electricityDataItems) { |
| | | final double sum = electricityDataItems.stream().map(ElectricityDataItem::getElectricity).mapToDouble(BigDecimal::doubleValue).sum(); |
| | | vo.setCount(sum); |
| | | vo.setCount(format2Double(sum)); |
| | | if(totalElectric != 0) { |
| | | vo.setPercentage(format2Double(sum / totalElectric * 100)); |
| | | } |
| | |
| | | } |
| | | }); |
| | | List<String> indexIds = nodeIndexInforList.stream().filter(l -> StringUtils.isNotEmpty(l.getIndexId())).map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toList()); |
| | | // Date queryTime = new Date(); |
| | | Date queryTime = DateUtil.parseDateTime("2023-03-28 00:00:00"); |
| | | Date queryTime = new Date(); |
| | | // Date queryTime = DateUtil.parseDateTime("2023-03-28 00:00:00"); |
| | | Date beginTime; |
| | | Date endTime; |
| | | String shixuTimeType; |