net
2025-02-14 06d3d15a5a08637041cc601101c063b11b07a346
zhitan-system/src/main/java/com/zhitan/home/service/HomePageServiceImpl.java
@@ -66,10 +66,13 @@
    @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);
@@ -237,7 +240,7 @@
                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));
                    }
@@ -390,8 +393,8 @@
            }
        });
        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;