jinpengyong
2022-01-20 0bb98d4377e5b894a2338b7726846b978450e187
update
8 files modified
24 ■■■■■ changed files
screen-job/src/main/java/com/moral/api/service/impl/CityAqiDailyServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/CityAqiMonthlyServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/CityAqiServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/CityAqiYearlyServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/CityWeatherForecastServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/CityWeatherServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/ForecastServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/HistoryAqiServiceImpl.java 3 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/CityAqiDailyServiceImpl.java
@@ -71,8 +71,9 @@
                .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);
screen-job/src/main/java/com/moral/api/service/impl/CityAqiMonthlyServiceImpl.java
@@ -82,8 +82,9 @@
                .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);
screen-job/src/main/java/com/moral/api/service/impl/CityAqiServiceImpl.java
@@ -72,8 +72,9 @@
        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 {
screen-job/src/main/java/com/moral/api/service/impl/CityAqiYearlyServiceImpl.java
@@ -84,8 +84,9 @@
                .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);
screen-job/src/main/java/com/moral/api/service/impl/CityWeatherForecastServiceImpl.java
@@ -50,8 +50,9 @@
        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);
screen-job/src/main/java/com/moral/api/service/impl/CityWeatherServiceImpl.java
@@ -53,8 +53,9 @@
        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);
screen-job/src/main/java/com/moral/api/service/impl/ForecastServiceImpl.java
@@ -130,9 +130,10 @@
        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);
screen-job/src/main/java/com/moral/api/service/impl/HistoryAqiServiceImpl.java
@@ -72,8 +72,9 @@
        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 {