| | |
| | | Date date = (Date) forecastDatum.get("time"); |
| | | String value = forecastDatum.get("value").toString(); |
| | | Map<String, Object> data = JSONObject.parseObject(value, Map.class); |
| | | Object o3 = data.get("o3"); |
| | | Object o3 = data.get("O3"); |
| | | if (i == DateUtils.getHour(date) * 2) { |
| | | if (!ObjectUtils.isEmpty(o3)) { |
| | | map.put("O3", o3); |
| | |
| | | Date date = (Date) measuredDatum.get("time"); |
| | | String value = measuredDatum.get("value").toString(); |
| | | Map<String, Object> data = JSONObject.parseObject(value, Map.class); |
| | | Object o3 = data.get("o3"); |
| | | Object o3 = data.get("O3"); |
| | | if (i == (DateUtils.getHour(date) * 2 + 1)) { |
| | | if (!ObjectUtils.isEmpty(o3)) { |
| | | map.put("O3", o3); |
| | |
| | | if (value == null) |
| | | value = queryCityAqiByRegionCodeFromDB(regionCode); |
| | | //根据AQI计算污染等级 |
| | | if (value == null || value.get("aqi") == null) |
| | | if (value == null || value.get("AQI") == null) |
| | | return null; |
| | | Integer aqi = Integer.parseInt(value.get("aqi").toString()); |
| | | Integer aqi = Integer.parseInt(value.get("AQI").toString()); |
| | | String category = AQIUtils.classOfPollutionByAqi(aqi); |
| | | value.put("category", category); |
| | | return value; |
| | |
| | | continue; |
| | | } |
| | | Map<String, Object> allDataMap = JSON.parseObject(allDataJson, Map.class); |
| | | Object aqiData = allDataMap.get("aqi"); |
| | | Object aqiData = allDataMap.get("AQI"); |
| | | if (aqiData == null) |
| | | result.put(key, ""); |
| | | else |