From 91c1c308abec43a67335cdebb574940ed41b09cf Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Wed, 05 Aug 2020 16:56:16 +0800
Subject: [PATCH] 修改预测参数,提交到数据库

---
 src/main/java/com/moral/controller/ScreenController.java |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java
index f42bc29..ca6b595 100644
--- a/src/main/java/com/moral/controller/ScreenController.java
+++ b/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;
@@ -723,8 +725,8 @@
             String time = map.get("time").toString();
             time = time.substring(time.length() - 2);
             map.put("time", Integer.valueOf(time));
-            if(parameters.get("type").equals("day")){
-                map.put("time", Integer.valueOf(time)+1);
+            if (parameters.get("type").equals("day")) {
+                map.put("time", Integer.valueOf(time) + 1);
             }
             map.put("value", map.remove(sensorKey));
         }
@@ -1927,8 +1929,8 @@
             if (minAngle > (Double) longAndLatiList.get(j).get("angle")) {
                 minAngle = (Double) longAndLatiList.get(j).get("angle");
                 indexAngle = j;
-            }else {
-                indexAngle=indexAngle;
+            } else {
+                indexAngle = indexAngle;
             }
         }
         preAngleDeviceList.add(deviceList.get((Integer) longAndLatiList.get(indexAngle).get("h")));
@@ -1960,8 +1962,37 @@
         locationList.add(fivethLoction);
         String preAngleDeviceString = JSON.toJSON(preAngleDeviceList).toString();
         params.put("preAngleDeviceString", preAngleDeviceString);//���������������������������
-        params.put("locationList",locationList);
+        params.put("locationList", locationList);
         return params;
     }
 
+    @GetMapping("forecastO3")
+    @ApiOperation(value = "���������������������������", notes = "���������������������������")
+    @ApiImplicitParams(value = {
+            @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:%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);
+    }
 }

--
Gitblit v1.8.0