فهرست منبع

Merge branch 'dev-v1.0.0-jd' of http://39.106.8.246:3003/apm/energy-report into dev-v1.0.0-jd

lixing 3 سال پیش
والد
کامیت
87f0282c22

+ 19 - 8
src/main/java/com/persagy/apm/energy/report/centermiddleware/service/impl/ICenterMiddlewareWebServiceImp.java

@@ -117,6 +117,8 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
                     dateGraphItemVO.setValue(eer);
                     dateGraphItemVOList.add(dateGraphItemVO);
                 }
+                log.info("项目:"+pjId+"allCoolingCapacity:"+allCoolingCapacity);
+                log.info("项目:"+pjId+"allPowerConsumption:"+allPowerConsumption);
                 Double allEer = null;
                 if (allCoolingCapacity != null && allPowerConsumption != null && allPowerConsumption != 0.0) {
                     allEer = allCoolingCapacity / allPowerConsumption;
@@ -137,12 +139,22 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
     }
 
     private List<Date> getMaxOrMinDateList(List<DateGraphItemVO> dateGraphItemVOList, Integer orderType) {
+        if (CollectionUtils.isEmpty(dateGraphItemVOList)) {
+            return new ArrayList<>();
+        }
+        List<DateGraphItemVO> dataList = new ArrayList<>();
+        for (DateGraphItemVO vo : dateGraphItemVOList) {
+            if (vo.getValue() == null) {
+                continue;
+            }
+            dataList.add(vo);
+        }
         Map<String, Integer> sortMap = new HashMap<>();
         sortMap.put("value", orderType);
-        DataUtils.sort(dateGraphItemVOList, sortMap);
+        DataUtils.sort(dataList, sortMap);
         List<Date> resultList = new ArrayList<>();
         Double maxOrMinData = null;
-        for (DateGraphItemVO vo : dateGraphItemVOList) {
+        for (DateGraphItemVO vo : dataList) {
             if (vo.getValue() == null) {
                 continue;
             }
@@ -242,14 +254,13 @@ public class ICenterMiddlewareWebServiceImp implements ICenterMiddlewareWebServi
                         Double currentDayCoolData = day_coolDataMap.get(date);
                         Double nextDayCoolData = day_coolDataMap.get(DateUtils.getDayOff(date, 1));
                         Double allCool = dataMap.get(date);
-                        if (allCool == null) {
-                            allCool = 0.0;
-                        }
-                        Double cool = 0.0;
                         if (currentDayCoolData != null && nextDayCoolData != null) {
-                            cool = nextDayCoolData - currentDayCoolData;
+                            if (allCool == null) {
+                                allCool = 0.0;
+                            }
+                            Double cool = nextDayCoolData - currentDayCoolData;
+                            allCool = allCool + cool;
                         }
-                        allCool = allCool + cool;
                         dataMap.put(date, allCool);
                     }
                 }

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/common/service/impl/CommonServiceImpl.java

@@ -147,8 +147,8 @@ public class CommonServiceImpl implements CommonService {
             log.info("获取HotelProjectAlarmDealInfo信息时传入参为空,故不进行查询");
             return new HotelProjectAlarmDealInfo();
         }
-        Integer workCount = null;
-        Integer dealCount = null;
+        Integer workCount = 0;
+        Integer dealCount = 0;
         List<WorkOrder> askEndTimeList = iWorkOrderWebService.getWorkOrderNumByParam(projectId, reportDate, "ask_end_time", null, "8");
         if (null != askEndTimeList) {
             dealCount = askEndTimeList.size();
@@ -307,12 +307,12 @@ public class CommonServiceImpl implements CommonService {
         HotelProjectEnergyWorkerOrderInfo hotelProjectEnergyWorkerOrderInfo = new HotelProjectEnergyWorkerOrderInfo();
         try {
             List<WorkOrder> createTimeWorkList = iWorkOrderWebService.getWorkOrderNumByParam(projectId, reportDate, "create_time", workOrderType, null);
-            Integer totalCount = null;
+            Integer totalCount = 0;
             if (null != createTimeWorkList) {
                 totalCount = createTimeWorkList.size();
             }
             List<WorkOrder> realFinishTimeWorkList = iWorkOrderWebService.getWorkOrderNumByParam(projectId, reportDate, "real_finish_time", workOrderType, null);
-            Integer executeCount = null;
+            Integer executeCount = 0;
             if (null != realFinishTimeWorkList) {
                 executeCount = realFinishTimeWorkList.size();
             }
@@ -324,7 +324,7 @@ public class CommonServiceImpl implements CommonService {
             }
             hotelProjectEnergyWorkerOrderInfo.setExecutePercent(executePercent);
             List<WorkOrder> energySaveRealFinishTimeWorkList = iWorkOrderWebService.getWorkOrderNumByParam(projectId, reportDate, "real_finish_time", energySaveWorkOrderType, null);
-            Integer initiativeCount = null;
+            Integer initiativeCount = 0;
             if (null != energySaveRealFinishTimeWorkList) {
                 initiativeCount = energySaveRealFinishTimeWorkList.size();
             }