| 
					
				 | 
			
			
				@ -2326,7 +2326,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("emergencyAssistance".equals(topicItem)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            fliter = " and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where  pd.user = sr.patient and pd.del=0 and pd.category_code in ('7','4')) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where  pd.user = sr.patient and pd.del=0 and pd.category_code in ('7')) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            fliter = " and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where  pd.user = sr.patient and pd.del=0 and pd.category_code in (" + categoryCode + ") and FIND_IN_SET('" + topicItemTmp + "',dd.service_topic)) "; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2394,13 +2394,17 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    case "emergencyAssistance": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        String id = (String) list.get(i).get("id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        String residentialArea = (String) list.get(i).get("residentialArea"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        String SoSDeviceSql = "SELECT count(*)  FROM base_emergency_assistance_order WHERE `status` = '1' AND patient = '" + id + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        Integer integer = jdbcTemplate.queryForObject(SoSDeviceSql, int.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        String SoSDeviceSql = "SELECT id  FROM base_emergency_assistance_order WHERE `status` = '1' AND patient = '" + id + "'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        List<Map<String, Object>> listMapsOrder = jdbcTemplate.queryForList(SoSDeviceSql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        JSONObject tmp = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (integer > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (listMapsOrder.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            for (Map<String, Object> stringObjectMap : listMapsOrder) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                tmp.put("orderId",stringObjectMap.get("id")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            tmp.put("eCall", 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            tmp.put("eCall", 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            tmp.put("orderId", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        BasePatientDO patientDO = basePatientDao.findById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (null != patientDO) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2417,7 +2421,15 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                        tmp.put("atHome", true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    String locationAddress = LatitudeUtils.getLocationAddress(latLon[0], latLon[1]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    tmp.put("address", locationAddress); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    tmp.put("atHome", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    tmp.put("address", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                tmp.put("atHome", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                tmp.put("address", ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        object.put("info", tmp); 
			 |