jinpengyong
2020-12-11 e20989d3c8f87c1831e608999c4c859cf4970012
src/main/java/com/moral/service/impl/HistoryServiceImpl.java
@@ -406,14 +406,16 @@
        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()) {
        if (ObjectUtils.isEmpty(map) || map.isEmpty()) {
            returnMap.put("AQI", "N/V");
        } 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);
        }