From cdd72249b457b83e425584c3fd9bdf82577179ea Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Wed, 09 May 2018 14:10:03 +0800 Subject: [PATCH] 三级警报 优化 --- src/main/java/com/moral/controller/MobileController.java | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/moral/controller/MobileController.java b/src/main/java/com/moral/controller/MobileController.java index 1e290e6..5ce114d 100644 --- a/src/main/java/com/moral/controller/MobileController.java +++ b/src/main/java/com/moral/controller/MobileController.java @@ -74,7 +74,14 @@ OperateUser operateUser = operateUserService.updatePassword(uid,password,newpassword); return new AppData<OperateUser>(operateUser); } - + /** + * ������ ������id ��������������������� + */ + @RequestMapping("deviceInfo") + public AppData<Device> deviceInfo(Integer id){ + Device device = deviceService.queryById(id); + return new AppData<Device>(device); + } /** * * @param equDeviceAdapter @@ -110,10 +117,14 @@ @RequestMapping("getEquInfoByMac") public AppData<Map> getDeviceByMac(@RequestParam(value="mac", required=true)String mac) { Device device = deviceService.getDeviceByMac(mac,false);//��������������� - Map<String,Object> deviceMap = new HashMap<>(BeanMap.create(device)); - deviceMap.put("monitorpointDetail",deviceMap.get("monitorPoint")); - deviceMap.remove("monitorPoint"); - return new AppData<Map>(deviceMap); + if(device!=null){ + Map<String,Object> deviceMap = new HashMap<>(BeanMap.create(device)); + deviceMap.put("monitorpointDetail",deviceMap.get("monitorPoint")); + deviceMap.remove("monitorPoint"); + return new AppData<Map>(deviceMap); + }else{ + return new AppData("mac���������������",AppData.FAIL); + } } /** -- Gitblit v1.8.0