cjl
2023-08-14 02e1281fafd76022b7d64536ea06913cf28b6d7f
screen-job/src/main/java/com/moral/api/service/impl/ForecastServiceImpl.java
@@ -133,10 +133,7 @@
        Map<String, Object> forecastMap = new HashMap<>();
        for (Object obj : cityCodes) {
            Forecast forecast = new Forecast();
            Integer cityCode = Integer.parseInt(obj.toString());
            forecast.setCityCode(cityCode);
            //预测
            List<CityWeatherForecast> cityWeatherForecasts = cityForecast.get(cityCode);
@@ -172,6 +169,8 @@
            }
            for (CityWeatherForecast cityWeatherForecast : cityWeatherForecasts) {
                Forecast forecast = new Forecast();
                forecast.setCityCode(cityCode);
                Date time = cityWeatherForecast.getTime();
                Map<String, Object> value = JSONObject.parseObject(cityWeatherForecast.getValue(), Map.class);
                String weather = value.get("text").toString();
@@ -211,7 +210,7 @@
                }
            }
        }
        forecastMapper.insertForecast(forecastList);
       // forecastMapper.insertForecast(forecastList);
    }
    private Double calculateAvg(List<Map<String, Object>> list, String param) {