From c3e1f9b9af29647bd157f2ea268bc56b2d3b9df1 Mon Sep 17 00:00:00 2001
From: 于紫祥_1901 <email@yuzixiang_1910>
Date: Mon, 31 Aug 2020 14:47:46 +0800
Subject: [PATCH] 风场图update
---
src/main/java/com/moral/controller/MobileController.java | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/moral/controller/MobileController.java b/src/main/java/com/moral/controller/MobileController.java
index a15ddaf..23a1a9c 100644
--- a/src/main/java/com/moral/controller/MobileController.java
+++ b/src/main/java/com/moral/controller/MobileController.java
@@ -13,6 +13,7 @@
import org.springframework.cglib.beans.BeanMap;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -20,6 +21,7 @@
import com.moral.common.bean.AppData;
import com.moral.common.bean.ResultBean;
import com.moral.common.util.Crypto;
+import com.moral.common.util.WebUtils;
import com.moral.entity.Account;
import com.moral.entity.Device;
import com.moral.entity.MonitorPoint;
@@ -117,7 +119,8 @@
*/
@RequestMapping("reportDevice")
public AppData<String> installDevice(EquDeviceAdapter equDeviceAdapter) {
- deviceService.addOrModify(equDeviceAdapter.toDevice());
+ //deviceService.addOrModify(equDeviceAdapter.toDevice());
+ deviceService.saveOrUpdate4Mobile(equDeviceAdapter.toDevice(), equDeviceAdapter.getDeviceProperty());
return new AppData<String>("");
}
@@ -327,4 +330,48 @@
List<Map<String, Object>> sensors = historyService.getSensorDataBySensorKey(parameters);
return new ResultBean<List<Map<String, Object>>>(sensors);
}
+
+ @GetMapping("profession-provincecode")
+ @ApiOperation(value = "���������code������������������", notes = "���������code������������������")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "provinceCode", value = "���code", required = true, paramType = "query", dataType = "String")
+ })
+ public ResultBean<List<Profession>> getProfessionByProvinceCode(HttpServletRequest request){
+ Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
+ List<Profession> professions = professionService.getProfessiontList(parameters);
+ return new ResultBean<List<Profession>>(professions);
+ }
+
+ @PostMapping("update-maintenance")
+ @ApiOperation(value = "������������������������������������", notes = "������������������������������������")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "������ID", required = true, paramType = "query", dataType = "int") ,
+ @ApiImplicitParam(name = "old_state", value = "������������������", required = true, paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "new_state", value = "������������������", required = true, paramType = "query", dataType = "String")
+
+ })
+ public ResultBean offLinToMaintenance(HttpServletRequest request) {
+ Map<String, Object> parameters = getParametersStartingWith(request, null);
+ deviceService.offLinToMaintenance(parameters);
+ ResultBean resultBean = new ResultBean(parameters);
+ return resultBean;
+ }
+
+ @GetMapping("mointorPointRank")
+ @ApiOperation(value = "������������������", notes = "������������������")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "accountId", value = "������id", required = true, paramType = "query", dataType = "String"),
+ @ApiImplicitParam(name = "sensor", value = "������", required = true, paramType = "query", dataType = "String")
+ })
+ public ResultBean<List<Map<String, Object>>> getMointorPointRank(HttpServletRequest request){
+ Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
+ String id = parameters.get("accountId").toString();
+ String sensor = parameters.get("sensor").toString();
+ Map<String, Object> account = accountService.getOrganizationIdByAccountId(id);
+ //������������id������������������������������
+ account.put("sensor", sensor);
+ List<Map<String, Object>> returnList = historyService.getMointorPointRankByOrganizationId(account);
+ return new ResultBean<List<Map<String, Object>>>(returnList);
+ }
+
}
--
Gitblit v1.8.0