| 
					
				 | 
			
			
				@ -18,11 +18,10 @@ import org.slf4j.Logger; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.slf4j.LoggerFactory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.data.domain.Page; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.stereotype.Controller; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestMethod; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.ResponseBody; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.Date; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.HashMap; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -34,7 +33,7 @@ import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * @author George 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Controller 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RestController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RequestMapping(value = "patient/device") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Api(value = "患者设备管理", description = "患者设备管理") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class PatientDeviceController extends BaseController { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -57,7 +56,6 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("获取居民标准体征预警值") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "getDeviceStandard", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getDeviceStandard(@ApiParam(name = "type", value = "类型1血糖,2血压", defaultValue = "1") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @RequestParam(value = "type", required = true) Integer type){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -75,7 +73,6 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("设备保存接口") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "SavePatientDevice", method = RequestMethod.POST) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String saveDevice(@ApiParam(name = "json", value = "设备数据json", defaultValue = "{\"deviceId\": \"3\",\"deviceName\": \"血压计-优瑞恩\",\"deviceSn\": \"7052169111\",\"categoryCode\": \"1\",\"userType\": \"-1\"}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             @RequestParam(value = "json", required = true) String json) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -116,7 +113,6 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("患者设备列表获取") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "PatientDeviceList", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getDeviceByPatient(@ApiParam(name = "id", value = "分页起始id", defaultValue = "0") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     @RequestParam(value = "id", required = true) long id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     @ApiParam(name = "pagesize", value = "每页条数", defaultValue = "10") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -134,7 +130,6 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    //要增加时间段信息展示 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("获取患者设备信息") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "PatientDeviceInfo", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getPatientDeviceInfo(@ApiParam(name = "id", value = "患者设备ID", defaultValue = "146") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                       @RequestParam(value = "id", required = true) String id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -153,7 +148,6 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("通过sn码获取设备绑定情况") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "PatientDeviceIdcard", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getDeviceUser(@ApiParam(name = "type", value = "设备类型", defaultValue = "1") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                @RequestParam(value = "type", required = true) String type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                @ApiParam(name = "device_sn", value = "设备SN码", defaultValue = "15L000002") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -176,7 +170,6 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("设备删除") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "DeletePatientDevice",method = {RequestMethod.GET,RequestMethod.POST}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String delete(@ApiParam(name = "id", value = "删除设备关联ID") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         @RequestParam(value = "id", required = true) String id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -201,7 +194,6 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("获取居民的设备任务信息") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "getPatientDeviceTaskInfo",method = RequestMethod.POST) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ResponseBody 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getPatientDeviceTaskInfo(@ApiParam(name = "patientCode",value = "患者code")@RequestParam(value = "patientCode",required = true)String patientCode){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return write(200,"执行成功","data",patientDeviceService.getPatientDeviceTaskInfo(patientCode)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -210,5 +202,42 @@ public class PatientDeviceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("获取居民的爱牵挂设备亲情号码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "getAqgDeviceInfo",method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getAqgDeviceInfo(@ApiParam(name = "deviceSn",value = "设备sn码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                               @RequestParam(value = "deviceSn",required = true)String deviceSn){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return write(200,"获取成功","data",patientDeviceService.getAqgDeviceInfo(deviceSn)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return write(-1,"获取失败!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("修改删除 爱牵挂亲情号码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "updAqgDeviceSosInfo",method = RequestMethod.POST) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String updAqgDeviceSosInfo(@ApiParam(name = "deviceSn",value = "设备id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "deviceSn",required = true)String deviceSn, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @ApiParam(name = "seqid",value = "亲情号码id") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "seqid",required = false)String seqid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @ApiParam(name = "name",value = "亲情号码昵称",required = false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "name",required = false)String name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @ApiParam(name = "num",value = "号码",required = false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "num",required = false)String num, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @ApiParam(name = "dial_flag",value = "0不设置为紧急呼叫号码,1设置为紧急呼叫号码",required = false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "dial_flag",required = false)String dial_flag, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @ApiParam(name = "clear",value = "删除标志,删除传1",required = false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "clear",required = false)String clear){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            com.alibaba.fastjson.JSONObject json = patientDeviceService.updAqgDeviceSosInfo(deviceSn, seqid, name, num, dial_flag, clear); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(json.getBoolean("success")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return success("操作成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return error(-1,json.getString("error_desc")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return write(-1,"操作失败!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |