| | |
| | | .collect(Collectors.groupingBy(o -> o.get("city_code").toString())); |
| | | |
| | | List<CityAqiDaily> cityAqiDailies = new ArrayList<>(); |
| | | CityAqiDaily cityAqiDaily = new CityAqiDaily(); |
| | | |
| | | data.forEach((cityCode, value) -> { |
| | | CityAqiDaily cityAqiDaily = new CityAqiDaily(); |
| | | Map<String, Object> jsonMap = new HashMap<>(); |
| | | cityAqiDaily.setCityCode(Integer.parseInt(cityCode)); |
| | | cityAqiDaily.setTime(start); |
| | |
| | | .collect(Collectors.groupingBy(CityAqiMonthly::getCityCode)); |
| | | |
| | | List<CityAqiMonthly> cityAqiMonthlyList = new ArrayList<>(); |
| | | CityAqiMonthly cityAqiMonthly = new CityAqiMonthly(); |
| | | |
| | | data.forEach((cityCode, value) -> { |
| | | CityAqiMonthly cityAqiMonthly = new CityAqiMonthly(); |
| | | Map<String, Object> jsonMap = new HashMap<>(); |
| | | cityAqiMonthly.setCityCode(Integer.parseInt(cityCode)); |
| | | cityAqiMonthly.setTime(start); |
| | |
| | | List<CityConfigAqi> list = cityConfigAqiService.list(wrapper); |
| | | |
| | | List<CityAqi> cityAqiList = new ArrayList<>(); |
| | | CityAqi cityAqi = new CityAqi(); |
| | | |
| | | for (CityConfigAqi cityConfigAqi : list) { |
| | | CityAqi cityAqi = new CityAqi(); |
| | | Integer cityCode = cityConfigAqi.getCityCode(); |
| | | Map<String, Object> data; |
| | | try { |
| | |
| | | .collect(Collectors.groupingBy(CityAqiYearly::getCityCode)); |
| | | |
| | | List<CityAqiYearly> cityAqiYearlyList = new ArrayList<>(); |
| | | CityAqiYearly cityAqiYearly = new CityAqiYearly(); |
| | | |
| | | data.forEach((cityCode, value) -> { |
| | | CityAqiYearly cityAqiYearly = new CityAqiYearly(); |
| | | Map<String, Object> jsonMap = new HashMap<>(); |
| | | cityAqiYearly.setCityCode(Integer.parseInt(cityCode)); |
| | | cityAqiYearly.setTime(start); |
| | |
| | | List<CityConfigWeatherForecast> list = cityConfigWeatherForecastService.list(wrapper); |
| | | |
| | | List<CityWeatherForecast> cityWeatherForecasts = new ArrayList<>(); |
| | | CityWeatherForecast cityWeatherForecast = new CityWeatherForecast(); |
| | | |
| | | for (CityConfigWeatherForecast cityConfigWeatherForecast : list) { |
| | | CityWeatherForecast cityWeatherForecast = new CityWeatherForecast(); |
| | | Integer cityCode = cityConfigWeatherForecast.getCityCode(); |
| | | Integer locationId = cityConfigWeatherForecast.getLocationId(); |
| | | Map<String, Object> data = restTemplate.getForObject("https://api.qweather.com/v7/weather/72h?key=da05c6c4852d4f7aa3364a9236ee9e26&gzip=n&location={1}", Map.class, locationId); |
| | |
| | | List<CityConfigWeather> list = cityConfigWeatherService.list(wrapper); |
| | | |
| | | List<CityWeather> cityWeathers = new ArrayList<>(); |
| | | CityWeather cityWeather = new CityWeather(); |
| | | |
| | | for (CityConfigWeather cityConfigWeather : list) { |
| | | CityWeather cityWeather = new CityWeather(); |
| | | Integer cityCode = cityConfigWeather.getCityCode(); |
| | | Integer locationId = cityConfigWeather.getLocationId(); |
| | | Map<String, Object> data = restTemplate.getForObject("https://api.qweather.com/v7/weather/now?key=da05c6c4852d4f7aa3364a9236ee9e26&gzip=n&location={1}", Map.class, locationId); |
| | |
| | | Map<Date, List<Integer>> hours = DateUtils.getBeforeAndAfterHourDate(nextDay); |
| | | |
| | | List<Forecast> forecastList = new ArrayList<>(); |
| | | Forecast forecast = new Forecast(); |
| | | |
| | | Map<String, Object> forecastMap = new HashMap<>(); |
| | | for (Object obj : cityCodes) { |
| | | Forecast forecast = new Forecast(); |
| | | Integer cityCode = Integer.parseInt(obj.toString()); |
| | | |
| | | forecast.setCityCode(cityCode); |
| | |
| | | String timeStr = DateUtils.dateToDateString(time, DateUtils.yyyy_MM_dd_HH_mm_ss_EN); |
| | | |
| | | List<HistoryAqi> historyAqis = new ArrayList<>(); |
| | | HistoryAqi historyAqi = new HistoryAqi(); |
| | | |
| | | for (GovMonitorPoint govMonitorPoint : govMonitorPoints) { |
| | | HistoryAqi historyAqi = new HistoryAqi(); |
| | | String guid = govMonitorPoint.getGuid(); |
| | | ResponseEntity<String> response; |
| | | try { |