Browse Source

空指针

yumeng 5 years ago
parent
commit
72a4541c17

+ 4 - 1
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/MaterialReportServiceImpl.java

@@ -55,6 +55,9 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
             }
             }
             if (type == 1) { // 今天分时数据
             if (type == 1) { // 今天分时数据
                 Integer maxHour = materialReportMapper.selectMaxHourByDate(nowDate);
                 Integer maxHour = materialReportMapper.selectMaxHourByDate(nowDate);
+                if (Check.isNull(maxHour) || maxHour == 0) {
+                    return null;
+                }
                 Integer statHour = maxHour - 1;
                 Integer statHour = maxHour - 1;
                 paramsMap.put("startDate", nowDate);
                 paramsMap.put("startDate", nowDate);
                 paramsMap.put("statHour", statHour);
                 paramsMap.put("statHour", statHour);
@@ -178,7 +181,7 @@ public class MaterialReportServiceImpl implements IMaterialReportService {
 
 
             } else if (type == 4) { //  近15天数据
             } else if (type == 4) { //  近15天数据
 
 
-                 contrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
+                contrastStartDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -15);
                 paramsMap.put("startDate", contrastStartDate);
                 paramsMap.put("startDate", contrastStartDate);
                 paramsMap.put("endDate", anotherDay);
                 paramsMap.put("endDate", anotherDay);
                 contrastJson = materialReportMapper.selectDailyChainRatioByMap(paramsMap);
                 contrastJson = materialReportMapper.selectDailyChainRatioByMap(paramsMap);