kaiyu
2020-12-15 1a406e3e206af1ab7e38042548a085b078b6ca09
src/main/java/com/moral/service/impl/HistoryServiceImpl.java
@@ -406,14 +406,17 @@
        String timeUnits = startTime.substring(0, 10).replace("-", "");
        Map<String, Object> map = historyMapper.getAVGValueByMacAndTimeslot(mac, startTime, endTime, timeUnits);
        Map<String, Object> returnMap = new HashMap<>();
        if (map.isEmpty()) {
            returnMap.put("AQI", "N/V");
        if (ObjectUtils.isEmpty(map) || map.isEmpty()) {
             returnMap.put("AQI", "N/V");
             return returnMap;
        } else {
            Map<String, Double> AQIMap = new HashMap<>();
            for (Map.Entry<String, Object> entry : map.entrySet()) {
                String key = entry.getKey();
                Double value = Double.parseDouble(entry.getValue().toString());
                AQIMap.put(key, value);
                if (entry.getValue() != null) {
                    Double value = Double.parseDouble(entry.getValue().toString());
                    AQIMap.put(key, value);
                }
            }
            returnMap = AQICalculation.hourlyAQI(AQIMap);
        }