From 186ec9dcec258b3cead27c6874a828b9f48e1c8b Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Fri, 28 Aug 2020 13:55:15 +0800
Subject: [PATCH] update

---
 src/main/java/com/moral/controller/MobileController.java |   42 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/moral/controller/MobileController.java b/src/main/java/com/moral/controller/MobileController.java
index de362b3..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;
@@ -118,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>("");
 	}
 
@@ -329,11 +331,47 @@
 		return new ResultBean<List<Map<String, Object>>>(sensors);
 	}
 	
-	@RequestMapping("profession-provincecode")
+	@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