|  | @ -724,37 +724,37 @@ public class DeviceService {
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     //更新患者在床状态
 | 
	
		
			
				|  |  |                     updatePatientSleepStatus(device,patient,time_begin,bed_status);
 | 
	
		
			
				|  |  |                     if (!orderCreate){
 | 
	
		
			
				|  |  |                         if ("1".equals(bed_status)){//呼吸 心率检测
 | 
	
		
			
				|  |  |                             Integer theshold_breath_h = 25;
 | 
	
		
			
				|  |  |                             Integer theshold_breath_l = 8;
 | 
	
		
			
				|  |  |                             Integer theshold_heartrate_h = 100;
 | 
	
		
			
				|  |  |                             Integer theshold_heartrate_l = 50;
 | 
	
		
			
				|  |  |                             if (StringUtils.isNotBlank(breath)){
 | 
	
		
			
				|  |  |                                 Integer breath1 = Integer.parseInt(breath);
 | 
	
		
			
				|  |  |                                 if (breath1>theshold_breath_h||breath1<theshold_breath_l){
 | 
	
		
			
				|  |  |                                     planDetail.setBreath(breath);
 | 
	
		
			
				|  |  |                                     planDetail.setHeartRate(heartrate);
 | 
	
		
			
				|  |  |                                     planDetail.setBedStatus(1);
 | 
	
		
			
				|  |  |                                     planDetail.setSleepNightRecordList(nightRecord.findBySnPaTime(device,patient,dayTime));
 | 
	
		
			
				|  |  |                                     outBedOrder(null,timeDate,devicePatientDeviceDos.get(0),patient,device,"心率和呼吸频率异常",JSON.toJSONStringWithDateFormat(planDetail,"yyyy-MM-dd HH:mm:ss",SerializerFeature.WriteMapNullValue));
 | 
	
		
			
				|  |  |                                     return null;
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                             if (StringUtils.isNotBlank(heartrate)){
 | 
	
		
			
				|  |  |                                 Integer heartrate1 = Integer.parseInt(heartrate);
 | 
	
		
			
				|  |  |                                 if (heartrate1>theshold_heartrate_h||theshold_heartrate_h<theshold_heartrate_l){
 | 
	
		
			
				|  |  |                                     planDetail.setBreath(breath);
 | 
	
		
			
				|  |  |                                     planDetail.setHeartRate(heartrate);
 | 
	
		
			
				|  |  |                                     planDetail.setBedStatus(1);
 | 
	
		
			
				|  |  |                                     planDetail.setSleepNightRecordList(nightRecord.findBySnPaTime(device,patient,dayTime));
 | 
	
		
			
				|  |  |                                     outBedOrder(null,timeDate,devicePatientDeviceDos.get(0),patient,device,"心率和呼吸频率异常",JSON.toJSONStringWithDateFormat(planDetail,"yyyy-MM-dd HH:mm:ss",SerializerFeature.WriteMapNullValue));
 | 
	
		
			
				|  |  |                                     return null;
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  | //                    if (!orderCreate){
 | 
	
		
			
				|  |  | //                        if ("1".equals(bed_status)){//呼吸 心率检测
 | 
	
		
			
				|  |  | //                            Integer theshold_breath_h = 25;
 | 
	
		
			
				|  |  | //                            Integer theshold_breath_l = 8;
 | 
	
		
			
				|  |  | //                            Integer theshold_heartrate_h = 100;
 | 
	
		
			
				|  |  | //                            Integer theshold_heartrate_l = 50;
 | 
	
		
			
				|  |  | //                            if (StringUtils.isNotBlank(breath)){
 | 
	
		
			
				|  |  | //                                Integer breath1 = Integer.parseInt(breath);
 | 
	
		
			
				|  |  | //                                if (breath1>theshold_breath_h||breath1<theshold_breath_l){
 | 
	
		
			
				|  |  | //                                    planDetail.setBreath(breath);
 | 
	
		
			
				|  |  | //                                    planDetail.setHeartRate(heartrate);
 | 
	
		
			
				|  |  | //                                    planDetail.setBedStatus(1);
 | 
	
		
			
				|  |  | //                                    planDetail.setSleepNightRecordList(nightRecord.findBySnPaTime(device,patient,dayTime));
 | 
	
		
			
				|  |  | //                                    outBedOrder(null,timeDate,devicePatientDeviceDos.get(0),patient,device,"心率和呼吸频率异常",JSON.toJSONStringWithDateFormat(planDetail,"yyyy-MM-dd HH:mm:ss",SerializerFeature.WriteMapNullValue));
 | 
	
		
			
				|  |  | //                                    return null;
 | 
	
		
			
				|  |  | //                                }
 | 
	
		
			
				|  |  | //                            }
 | 
	
		
			
				|  |  | //                            if (StringUtils.isNotBlank(heartrate)){
 | 
	
		
			
				|  |  | //                                Integer heartrate1 = Integer.parseInt(heartrate);
 | 
	
		
			
				|  |  | //                                if (heartrate1>theshold_heartrate_h||theshold_heartrate_h<theshold_heartrate_l){
 | 
	
		
			
				|  |  | //                                    planDetail.setBreath(breath);
 | 
	
		
			
				|  |  | //                                    planDetail.setHeartRate(heartrate);
 | 
	
		
			
				|  |  | //                                    planDetail.setBedStatus(1);
 | 
	
		
			
				|  |  | //                                    planDetail.setSleepNightRecordList(nightRecord.findBySnPaTime(device,patient,dayTime));
 | 
	
		
			
				|  |  | //                                    outBedOrder(null,timeDate,devicePatientDeviceDos.get(0),patient,device,"心率和呼吸频率异常",JSON.toJSONStringWithDateFormat(planDetail,"yyyy-MM-dd HH:mm:ss",SerializerFeature.WriteMapNullValue));
 | 
	
		
			
				|  |  | //                                    return null;
 | 
	
		
			
				|  |  | //                                }
 | 
	
		
			
				|  |  | //                            }
 | 
	
		
			
				|  |  | //
 | 
	
		
			
				|  |  | //                        }
 | 
	
		
			
				|  |  | //                    }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
	
		
			
				|  | @ -818,26 +818,15 @@ public class DeviceService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public void updatePatientSleepStatus(String device,String patient,String time_begin,String bed_status){
 | 
	
		
			
				|  |  |         Integer status = Integer.parseInt(bed_status);
 | 
	
		
			
				|  |  |         BasePatientOutBed outBed = outBedDao.findByPatientAndDeviceSnAndStatus(patient,device,0);
 | 
	
		
			
				|  |  |         switch (status){
 | 
	
		
			
				|  |  |             case 0://离床
 | 
	
		
			
				|  |  |                 if (null==outBed){
 | 
	
		
			
				|  |  |                     outBed = new BasePatientOutBed();
 | 
	
		
			
				|  |  |                     outBed.setPatient(patient);
 | 
	
		
			
				|  |  |                     outBed.setDeviceSn(device);
 | 
	
		
			
				|  |  |                     outBed.setStatus(status);
 | 
	
		
			
				|  |  |                     outBed.setCreateTime(DateUtil.strToDate(time_begin,DateUtil.YYYY_MM_DD_HH_MM_SS));
 | 
	
		
			
				|  |  |                     outBedDao.save(outBed);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 break;
 | 
	
		
			
				|  |  |             case 1://在床
 | 
	
		
			
				|  |  |                 if (null!=outBed){
 | 
	
		
			
				|  |  |                    outBed.setStatus(status);
 | 
	
		
			
				|  |  |                    outBed.setCreateTime(DateUtil.strToDate(time_begin,DateUtil.YYYY_MM_DD_HH_MM_SS));
 | 
	
		
			
				|  |  |                    outBedDao.save(outBed);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 break;
 | 
	
		
			
				|  |  |         BasePatientOutBed outBed = outBedDao.findByPatientAndDeviceSn(patient,device);
 | 
	
		
			
				|  |  |         if (null==outBed){
 | 
	
		
			
				|  |  |             outBed = new BasePatientOutBed();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         outBed.setPatient(patient);
 | 
	
		
			
				|  |  |         outBed.setDeviceSn(device);
 | 
	
		
			
				|  |  |         outBed.setStatus(status);
 | 
	
		
			
				|  |  |         outBed.setCreateTime(DateUtil.strToDate(time_begin,DateUtil.YYYY_MM_DD_HH_MM_SS));
 | 
	
		
			
				|  |  |         outBedDao.save(outBed);
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Async
 |