ソースを参照

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 年 前
コミット
070a2795af

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

@@ -227,10 +227,6 @@ public class CommonServiceImpl implements CommonService {
             String itemId = itemIdList[0];
             String itemStandardCode = itemIdList[1];
             String targetCode = iDataAnalysisWebService.getTargetCode(userCode, groupCode, itemId);
-            if (null == targetCode) {
-                log.info("根据itemId:" + itemId + "未获取到数据质量配置信息");
-                return new HotelProjectMaintenanceGraph();
-            }
             CountAndDayRateDataVo dataVo = iDataAnalysisWebService.getIotDataAnalysisData(userCode, groupCode, projectId, reportDate, targetCode);
             List<DateGraphItemVO> dateGraphItemVOList = new ArrayList<>();
             TreeMap<Date, Double> dataMap = dataVo.getDataMap();
@@ -413,7 +409,7 @@ public class CommonServiceImpl implements CommonService {
         sortMap.put("eer", -1);
         DataUtils.sort(projectEERDataVoList, sortMap);
         for (int i = 0; i < projectEERDataVoList.size(); i++) {
-            ProjectEERDataVo vo = projectEERDataVoList.get(0);
+            ProjectEERDataVo vo = projectEERDataVoList.get(i);
             if (!vo.getProjectId().equals(projectId)) {
                 continue;
             }
@@ -421,6 +417,9 @@ public class CommonServiceImpl implements CommonService {
             hotelProjectChillerPlantEfficiency.setMaxEerTime(vo.getMaxEerTimeList());
             hotelProjectChillerPlantEfficiency.setMinEerTime(vo.getMinEerTimeList());
             hotelProjectChillerPlantEfficiency.setCoolingCapacityCurrentMonth(vo.getCoolingCapacityCurrentMonth());
+            List<DateGraphItemVO> eerDetailInfo = vo.getEerDetailInfo();
+            sortMap.put("date", 1);
+            DataUtils.sort(vo.getEerDetailInfo(), sortMap);
             hotelProjectChillerPlantEfficiency.setEerDetailInfo(vo.getEerDetailInfo());
             if (vo.getEer() != null) {
                 hotelProjectChillerPlantEfficiency.setRankWithinClimateZone(i + 1);

+ 3 - 1
src/main/java/com/persagy/apm/energy/report/environment/service/impl/IEnvironmentWebServiceImpl.java

@@ -128,9 +128,11 @@ public class IEnvironmentWebServiceImpl implements IEnvironmentWebService {
                     }*/
                     List<Date> dateList = DateUtils.getDayList(DateUtils.str2Date(batchQueryEnvListByParamDTO.getStartTime(), DateUtils.SDF_SECOND), DateUtils.str2Date(batchQueryEnvListByParamDTO.getEndTime(), DateUtils.SDF_SECOND));
                     for (Date date : dateList) {
+                        String dateStr = DateUtils.date2Str(date, DateUtils.SDF_SECOND);
+                        String dateStrToEight = DateUtils.date2Str(DateUtils.getHourOff(date, 8), DateUtils.SDF_SECOND);
                         DateGraphItemVO dateGraphItemVO = new DateGraphItemVO();
                         dateGraphItemVO.setDate(date);
-                        dateGraphItemVO.setValue(null == dataMap ? null : dataMap.get(DateUtils.date2Str(date, DateUtils.SDF_SECOND)));
+                        dateGraphItemVO.setValue(null == dataMap ? null : dataMap.get(dateStrToEight) == null ? dataMap.get(dateStr) : dataMap.get(dateStrToEight));
                         detailInfo.add(dateGraphItemVO);
                     }
                     resultList.add(hotelProjectKpiItem);

+ 4 - 0
src/main/java/com/persagy/apm/energy/report/iotdataanalysis/service/impl/IDataAnalysisWebServiceImpl.java

@@ -55,6 +55,10 @@ public class IDataAnalysisWebServiceImpl implements IDataAnalysisWebService {
 
     @Override
     public CountAndDayRateDataVo getIotDataAnalysisData(String userId, String groupCode, String projectId, Date reportDate, String targetCode) {
+        if(targetCode == null){
+            log.info("targetCode为空故不进行数据质量信息的查询");
+            return new CountAndDayRateDataVo();
+        }
         CountAndDayRateDataVo vo = new CountAndDayRateDataVo();
         try {
             JSONObject paramObject = new JSONObject();