From c98bb582d6a313940310a5e05bc80bafe386e3a2 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Thu, 19 Aug 2021 15:25:12 +0800
Subject: [PATCH] 走航车轨迹
---
screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java | 38 +++++++++++++++++++++++++++++++++++---
1 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java b/screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java
index ce0faaa..7b5ae9c 100644
--- a/screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java
@@ -4,11 +4,17 @@
import com.moral.api.pojo.form.device.MonitorPointQueryForm;
import com.moral.api.pojo.vo.monitorPoint.MonitorPointsVO;
import com.moral.api.pojo.vo.monitorPoint.StateControllerStationVO;
+import com.moral.api.service.HistoryFiveMinutelyService;
import com.moral.api.service.MonitorPointService;
import com.moral.api.service.OrganizationService;
import com.moral.constant.ResponseCodeEnum;
import com.moral.constant.ResultMessage;
+import com.moral.util.WebUtils;
+
import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
@@ -17,6 +23,9 @@
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
/**
* @ClassName DeviceController
@@ -35,8 +44,11 @@
@Autowired
MonitorPointService monitorPointService;
+ @Autowired
+ private HistoryFiveMinutelyService historyFiveMinutelyService;
+
@GetMapping("queryMonitorPoints")
- public ResultMessage queryMonitorPointsAndDevices(MonitorPointQueryForm form){
+ public ResultMessage queryMonitorPointsAndDevices(MonitorPointQueryForm form) {
//������������������������
if (!form.valid())
return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
@@ -51,15 +63,35 @@
}
@GetMapping("queryStateControlStation")
- public ResultMessage queryStateControlStation(Integer regionCode){
+ public ResultMessage queryStateControlStation(Integer regionCode) {
List<MonitorPoint> monitorPoints = monitorPointService.queryStateControlStationByRegionCode(regionCode);
//������������������������
StateControllerStationVO vo = StateControllerStationVO.convert(monitorPoints);
- return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),vo);
+ return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(), vo);
}
+ /**
+ * @param request ������������
+ * @return ������������������������������������
+ */
+ @GetMapping("getWindData")
+ @ApiOperation(value = "������������������", notes = "������������������")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
+ @ApiImplicitParam(name = "monitorPointIds", value = "������id", required = true, paramType = "query", dataType = "String")
+ })
+ public ResultMessage getWindData(HttpServletRequest request) {
+ Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
+ if (!params.containsKey("monitorPointIds")) {
+ return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
+ }
+ String[] monitorPointIds = params.remove("monitorPointIds").toString().split(",");
+ params.put("monitorPointIds", monitorPointIds);
+ List<Object> response = historyFiveMinutelyService.getAreaWindData(params);
+ return ResultMessage.ok(response);
+ }
}
--
Gitblit v1.8.0