| 
					
				 | 
			
			
				@ -2073,7 +2073,6 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " and m.doctor_code = '"+doctor+"' and m.del = '1' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String filter = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String deviceSn =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String categoryCode =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        switch (topicItem){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case "actionTrack": 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2099,15 +2098,10 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("actionTrack".equals(topicItem)){//行动轨迹 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter =" 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('preventLost',dd.service_topic)) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<String> deviceSns = jdbcTemplate.queryForList("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  and pd.category_code in ("+categoryCode+") FIND_IN_SET('preventLost',dd.service_topic)",String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (deviceSns.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                deviceSn = deviceSns.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter =" 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 and pd.category_code in ("+categoryCode+")  FIND_IN_SET('"+topicItem+"',dd.service_topic)) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " where  pd.user = sr.patient and pd.del=0 and pd.category_code in ("+categoryCode+") and FIND_IN_SET('"+topicItem+"',dd.service_topic)) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("preventLost".equals(topicItem)){//有绑定围栏的居民 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2131,6 +2125,18 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (int i=currentIndexFrom;i<list.size()&&i<currentIndexEnd;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map<String,Object> patientTmp = list.get(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject object = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String deviceSn =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<String> deviceSns = jdbcTemplate.queryForList("select pd.device_sn from wlyy_patient_device pd INNER JOIN dm_device dd " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " on pd.device_id = dd.id where  pd.user = '"+patientTmp.get("id").toString()+"' and pd.del=0  and pd.category_code in ("+categoryCode+") and FIND_IN_SET('"+topicItem+"',dd.service_topic)",String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (deviceSns.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    deviceSn = deviceSns.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (deviceSns.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    deviceSn = deviceSns.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                object.put("deviceCode",deviceSn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                switch (topicItem){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    case "actionTrack": 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        org.json.JSONArray locations = patientDeviceService.getX1Locations(deviceSn, day); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2149,7 +2155,14 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONArray monitorInfos = new JSONArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (int i=0;i<list.size();i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map<String,Object> patientTmp = list.get(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject object = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String deviceSn =""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<String> deviceSns = jdbcTemplate.queryForList("select pd.device_sn from wlyy_patient_device pd INNER JOIN dm_device dd " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " on pd.device_id = dd.id where  pd.user = '"+patientTmp.get("id").toString()+"' and pd.del=0  and pd.category_code in ("+categoryCode+") and FIND_IN_SET('"+topicItem+"',dd.service_topic)",String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (deviceSns.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    deviceSn = deviceSns.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject object  = patientMonitoringInfo(patientTmp.get("id").toString(),"null",false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                object.put("deviceSn",deviceSn); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                object.put("patientInfo",patientTmp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                monitorInfos.add(object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 |