| | |
| | | if (!ObjectUtils.isEmpty(data)) { |
| | | values = data.values(); |
| | | pubtime = format.parse(data.get("pubtime").toString()); |
| | | int hours = pubtime.getHours(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | int hour = calendar.get(Calendar.HOUR_OF_DAY); |
| | | if (hour != hours){ |
| | | pubtime = null; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (ObjectUtils.isEmpty(entity) || ObjectUtils.isEmpty(values) || values.contains("None")) { |
| | | if (ObjectUtils.isEmpty(entity) || ObjectUtils.isEmpty(values) || values.contains("None") || pubtime == null) { |
| | | Map<String, Object> mjMap = restTemplate.getForObject("http://sapi.7drlb.com/api/mj?cityID={1}&apiKey=aqi", Map.class, cityAqiConfig.get("city_id")); |
| | | if (ObjectUtils.isEmpty(mjMap)) { |
| | | continue; |