jinpengyong
2020-08-06 9880d87f87b074b45150a66867c0d1870e6cb3e2
src/main/java/com/moral/controller/ScreenController.java
@@ -77,11 +77,13 @@
import com.moral.util.TempAllocationUtils;
import com.moral.util.mapUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import net.sf.json.JSONString;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.net.ftp.FTPClient;
@@ -1964,15 +1966,33 @@
        return params;
    }
    @GetMapping("weather_nextDay")
    @ApiOperation(value = "未来一天臭氧预测", notes = "未来一天臭氧预测")
    @GetMapping("forecastO3")
    @ApiOperation(value = "预测和实际臭氧对比", notes = "预测和实际臭氧对比")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "monitorPointId", defaultValue = "6", value = "监控站id", required = true, paramType = "query", dataType = "String"),
            @ApiImplicitParam(name = "monitorPointId", defaultValue = "1", value = "监控站id", required = true, paramType = "query", dataType = "String"),
            @ApiImplicitParam(name = "time", value = "时间(格式:2020-03-19)", required = true, paramType = "query", dataType = "String")})
    public ResultBean<List<Map<String, Object>>> getWeatherNextDayDataByRegion(HttpServletRequest request) throws Exception {
        Map<String, Object> parameters = getParametersStartingWith(request, null);
        parameters.put("typeFormat", "%Y-%m-%d %H");
        List<Map<String, Object>> resultList = weatherService.getNextDayWeatherDataByRegion(parameters);
        parameters.put("typeFormat", "%Y-%m-%d %H:%i:%s");
        List<Map<String, Object>> resultList = weatherService.getForecastAndReal(parameters);
        return new ResultBean<List<Map<String, Object>>>(resultList);
    }
    @GetMapping("weatherData")
    @ApiOperation(value = "根据city查询预测和实际数据", notes = "根据city查询预测和实际数据")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "city", value = "城市名", required = true, paramType = "query", dataType = "String"),
            @ApiImplicitParam(name = "time", value = "时间(格式:2020-03-19)", required = true, paramType = "query", dataType = "String")})
    public ResultBean<List<Map<String, Object>>> getWeatherData(HttpServletRequest request) throws Exception {
        Map<String, Object> parameters = getParametersStartingWith(request, null);
        parameters.put("typeFormat", "%Y-%m-%d %H:%i:%s");
        List<Map<String, Object>> weatherList = weatherService.getWeatherData(parameters);
        return new ResultBean<List<Map<String, Object>>>(weatherList);
    }
    @PostMapping("updateForecastWeather")
    public void updateForecastWeather(HttpServletRequest request){
        Map<String, Object> parameters = getParametersStartingWith(request, null);
        weatherService.updateForecastWeather(parameters);
    }
}