From e399f702d76b2b170956a5996b5364f148b54b8d Mon Sep 17 00:00:00 2001 From: 于紫祥_1901 <email@yuzixiang_1910> Date: Thu, 10 Sep 2020 15:13:37 +0800 Subject: [PATCH] 三天因子对比(update) --- src/main/java/com/moral/controller/ScreenController.java | 71 ++++++++++++++++++++++++++++++++++- 1 files changed, 69 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/moral/controller/ScreenController.java b/src/main/java/com/moral/controller/ScreenController.java index 7535f2a..13f4b9e 100644 --- a/src/main/java/com/moral/controller/ScreenController.java +++ b/src/main/java/com/moral/controller/ScreenController.java @@ -86,6 +86,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.ModelAndView; import org.xml.sax.InputSource; @@ -175,6 +176,9 @@ @Resource private QualityDailyService qualityDailyService; + + @Resource + private RestTemplate restTemplate; /** * Screen login. ������������ @@ -1959,6 +1963,9 @@ if (mac!=null){ Device device=deviceService.byMacGetDevice(mac); List list1= LatLngTransformation.Convert_BD09_To_GCJ02(device.getLatitude(),device.getLongitude()); + if (device.getState()!=4+""){ + devMap.put("state",device.getState()); + } devMap.put("lat",list1.get(1)); devMap.put("lng",list1.get(0)); devMap.put("monitorPointId",device.getMonitorPointId()); @@ -1993,11 +2000,33 @@ List list=deviceService.byMonitorIdGetDeviceAndWind(monitorPointId,time,table); return list; } + + //������������ + @GetMapping("/windAndDeviceDataByArea") + @ResponseBody + public List windAndDeviceDataByArea(String monitorPointId) { + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.MINUTE, (calendar.get(Calendar.MINUTE) - 2)); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + String time = df.format(calendar.getTime())+":00"; + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + 1; + String mon; + if (month<10){ + mon="0"+month; + }else { + mon=""+month; + } + String table="history_minutely_"+year+mon; + List list=deviceService.byMonitorIdGetDeviceAndWindSpecial(monitorPointId,time,table); + return list; + } + @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")}) + @ApiImplicitParam(name = "time", value = "���6���(���������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); List<Map<String, Object>> resultList = weatherService.getForecastAndReal(parameters); @@ -2005,7 +2034,7 @@ } @GetMapping("weatherData") - @ApiOperation(value = "������city���������������������������", notes = "������city���������������������������") + @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")}) @@ -2013,6 +2042,30 @@ Map<String, Object> parameters = getParametersStartingWith(request, null); List<Map<String, Object>> weatherList = weatherService.getWeatherData(parameters); return new ResultBean<List<Map<String, Object>>>(weatherList); + } + + @GetMapping("weatherDataDay") + @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>>> getWeatherDataByDay(HttpServletRequest request) throws Exception { + Map<String, Object> parameters = getParametersStartingWith(request, null); + List<Map<String, Object>> weatherList = weatherService.getWeatherDataByDay(parameters); + return new ResultBean<List<Map<String, Object>>>(weatherList); + } + + @GetMapping("monitorDeviceData") + @ApiOperation(value = "���������������5������������������������", notes = "���������������5������������������������") + @ApiImplicitParams(value = { + @ApiImplicitParam(name = "city", value = "���������", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "time", value = "������(���������2020-03-15)", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "type", value = "������(5���������m,������������h)", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "range", value = "������������������������(������������������m,���������a)", required = true, paramType = "query", dataType = "String")}) + public ResultBean<List<Map<String, Object>>> get5MinutesOrHalfHour(HttpServletRequest request) throws Exception { + Map<String, Object> parameters = getParametersStartingWith(request, null); + List<Map<String, Object>> deviceData = historyMinutelyService.get5MinutesOrHalfHour(parameters); + return new ResultBean<List<Map<String, Object>>>(deviceData); } @PostMapping("updateForecastWeather") @@ -2164,4 +2217,18 @@ return new ResultBean<List<Map<String, Object>>>(list); } + + + @GetMapping("/contrastFactor") + @ApiOperation(value = "������������", notes = "������������") + @ApiImplicitParams(value = { + @ApiImplicitParam(name = "mac", value = "������mac", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "sensor", value = "������", required = true, paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "time", value = "������(���������2020-03-19���20���21)", required = true, paramType = "query", dataType = "String")}) + public ResultBean<List<Map<String, Object>>> contrastFactor(HttpServletRequest request) throws Exception { + Map<String, Object> parameters = getParametersStartingWith(request, null); + List list=historyHourlyService.getDataByMacAndTime(parameters); + //System.out.println(list); + return new ResultBean<List<Map<String, Object>>>(list); + } } -- Gitblit v1.8.0