Explorar el Código

修正环境和eer天维度获取不到数据问题

wangchenghong hace 3 años
padre
commit
44a0ef1f41

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

@@ -413,7 +413,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;
             }

+ 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);