| 
					
				 | 
			
			
				@ -1318,23 +1318,39 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void preventFire(JSONObject result,String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"15"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (devicePatientDeviceDos.size()==0){} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT r.value from wlyy_patient_device pd,base_device_health_index r " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE pd.device_sn = r.device_sn and pd.`user` = '"+patient+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " and pd.category_code='15' ORDER BY r.create_time desc LIMIT 1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> list1 = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(list1.size()==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("smoke","-1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("smoke",list1.get(0).get("value")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("orderNum",getOrder(patient,"preventFire")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        monitorInfo(result, patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void preventGasLeakage(JSONObject result,String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"14"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (devicePatientDeviceDos.size()==0){} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Integer getOrder(String patient,String topicItem){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "select count(1) from base_security_monitoring_order " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE patient = '"+patient+"' and `status` = 1 and topic_item = '"+topicItem+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer num = jdbcTemplate.queryForObject(sql,Integer.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return num; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void preventGasLeakage(JSONObject result,String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT r.value from wlyy_patient_device pd,base_device_health_index r " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "WHERE pd.device_sn = r.device_sn and pd.`user` = '"+patient+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql += " and pd.category_code='14' ORDER BY r.create_time desc LIMIT 1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> list1 = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(list1.size()==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("methane","-1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("methane",list1.get(0).get("value")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("orderNum",getOrder(patient,"preventGasLeakage")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        monitorInfo(result, patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |