jinpengyong
2022-01-21 78ee04a3a91e06f4baf81a8e08e53c73af278004
气象预测定时任务bug修复
1 files modified
2 ■■■ changed files
screen-job/src/main/java/com/moral/api/service/impl/CityWeatherForecastServiceImpl.java 2 ●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/CityWeatherForecastServiceImpl.java
@@ -52,7 +52,6 @@
        List<CityWeatherForecast> cityWeatherForecasts = new ArrayList<>();
        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);
@@ -62,6 +61,7 @@
                String dayTime = fxTime.split("T")[0];
                if (dayTime.equals(nextTime)) {
                    String hourTime = fxTime.substring(0, 17).replaceAll("T", " ");
                    CityWeatherForecast cityWeatherForecast = new CityWeatherForecast();
                    cityWeatherForecast.setCityCode(cityCode);
                    cityWeatherForecast.setTime(DateUtils.getDate(hourTime, DateUtils.yyyy_MM_dd_HH_EN));
                    cityWeatherForecast.setValue(JSONObject.toJSONString(hourlyMap));