| 
					
				 | 
			
			
				@ -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 
			 |