jinpengyong
2020-08-13 f0ebb071ac4828e1a5b55eccbba8d8dd9a4d80ad
根据臭氧预测算法更新接口
2 files modified
12 ■■■■■ changed files
src/main/java/com/moral/service/impl/WeatherServiceImpl.java 10 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/ForecastWeatherMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/java/com/moral/service/impl/WeatherServiceImpl.java
@@ -234,8 +234,8 @@
                    hour = "24";
                }
                map.put("time", Integer.valueOf(hour));
                if (forecastMap.get("result") != null) {
                    values.add(forecastMap.get("result").toString().replace("\"", ""));
                if (forecastMap.get("O3") != null) {
                    values.add(forecastMap.get("O3").toString().replace("\"", ""));
                } else {
                    values.add("");
                }
@@ -252,8 +252,8 @@
                    hour = "24";
                }
                map.put("time", Integer.valueOf(hour));
                if (forecastMap.get("result") != null) {
                    values.add(forecastMap.get("result").toString().replace("\"", ""));
                if (forecastMap.get("O3") != null) {
                    values.add(forecastMap.get("O3").toString().replace("\"", ""));
                } else {
                    values.add("");
                }
@@ -344,7 +344,9 @@
            hashMap.put("SO2C", "");
            hashMap.put("NO2C", "");
            hashMap.put("COC", "");
            if (forecastMap.get("O3C") == null) {
            hashMap.put("O3C", "");
            }
            hashMap.put("PM25C", "");
            hashMap.put("PM10C", "");
            hashMap.put("city", parameters.get("name").toString());
src/main/resources/mapper/ForecastWeatherMapper.xml
@@ -7,7 +7,7 @@
    <select id="getForecastHour" resultType="java.util.Map">
        SELECT
        DATE_FORMAT(time, #{typeFormat}) time,
        (case when result is null then json->'$.temp' else result end) result
        json->'$.O3C' 'O3'
        from forecast_weather
        where time >= #{start}
        AND time <![CDATA[<]]> #{end}