| 
					
				 | 
			
			
				@ -1575,6 +1575,11 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        JSONObject locationTmp = response.getJSONObject("last_location"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        Double lon = locationTmp.getJSONArray("coordinates").getDouble(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        Double lat = locationTmp.getJSONArray("coordinates").getDouble(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (!response.getBoolean("online")){//设备离线 取居民表定位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            result.put("X1online",false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            result.put("X1online",true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        JSONObject tmp = gpsUtil.gcj02_To_Bd09(lat,lon); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        tmp.put("city",response.getString("last_city")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        tmp.put("province",response.getString("last_province")); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2058,7 +2063,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String,Object>> findMonitorPatientsByDoctor(String doctor,String topicItem){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject findMonitorPatientsByDoctor(String doctor,String topicItem,Integer page,Integer pageSize,Integer detail){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = " SELECT DISTINCT p.id,p.name,p.residential_area residentialArea,p.photo,p.idcard,p.mobile, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.openid,p.sex,p.pad_imei padImei " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2071,7 +2078,39 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("preventLost".equals(topicItem)){//有绑定围栏的居民 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            filter += " and EXISTS (select 1 from wlyy_patient_safe_area sf where sf.patient = p.id and sf.del=1 and sf.manage_status=1) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return jdbcTemplate.queryForList(sql+filter); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> list =  jdbcTemplate.queryForList(sql+filter); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        result.put("total",list.size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (1 == detail){//获取详情 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONArray monitorInfos = new JSONArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            page = page>0?page-1:0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer totalPage = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(list.size()%pageSize==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalPage =list.size()/pageSize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalPage = list.size()/pageSize+1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer currentIndexFrom = page*pageSize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer currentIndexEnd = page*pageSize+pageSize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("totalPage",totalPage); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("currentPage",page+1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (int i=currentIndexFrom;i<list.size()&&i<currentIndexEnd;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map<String,Object> patientTmp = list.get(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject object = patientMonitoringInfo(patientTmp.get("id").toString(),topicItem); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                object.put("patientInfo",patientTmp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                monitorInfos.add(object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("topicInfo",monitorInfos); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONArray monitorInfos = new JSONArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (int i=0;i<list.size();i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map<String,Object> patientTmp = list.get(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject object = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                object.put("patientInfo",patientTmp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                monitorInfos.add(object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            result.put("topicInfo",monitorInfos); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |