| 
					
				 | 
			
			
				@ -23,6 +23,7 @@ import io.swagger.annotations.ApiParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import iot.device.LocationDataVO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.JdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import javax.servlet.http.HttpServletRequest; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -52,6 +53,8 @@ public class MonitorPlatformController extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private IotCompanyService iotCompanyService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private CopdXeekDeviceService copdXeekDeviceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private JdbcTemplate jdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @PostMapping(value = IotRequestMapping.PatientDevice.addPatientDevice) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -634,7 +637,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "getXeekDeviceData",method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "塞克设备数据获取") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop getXeekDeviceData(@ApiParam(name="deviceSN",value = "设备sn码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @RequestParam(value = "deviceSN")String deviceSN, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @RequestParam(value = "deviceSN",required = false)String deviceSN, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @ApiParam(name="reportType",value = "测试项目 1=吸气测试;2=呼气测试;6=MVV 测试;7=慢通气测试") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @RequestParam(value = "reportType")String reportType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @ApiParam(name="patient",value = "patient") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -648,6 +651,9 @@ public class MonitorPlatformController extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @ApiParam(name="end",value = "结束时间 YYYY-MM-DD HH:MM:SS" ,defaultValue = "2021-04-14 23:59:59" ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    @RequestParam(value = "end")String end) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isBlank(patient)&&StringUtils.isBlank(deviceSN)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getError("参数错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getSuccess("查询成功",copdXeekDeviceService.getDeviceData(patient,deviceSN,reportType,parameter,time,begin,end)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1028,4 +1034,17 @@ public class MonitorPlatformController extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return sdf.format(calendar.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("获取赛客查询指标") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "getXeekParameters",method = {RequestMethod.POST,RequestMethod.GET}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop getSportRecord(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sql = "select value as code,name from xmiot.wlyy_iot_tz_dict where code='COPD_PARAMETER' and del=1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> result = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  ObjEnvelop.getSuccess("查询成功",result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getError("查询失败"+e.getMessage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |