|  | @ -3,6 +3,7 @@ package com.yihu.jw.care.service.third;
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSON;
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.dao.device.BaseSleepPlanDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.dao.device.PatientSafeAreaDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.dao.label.BaseCapacityLabelDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.dao.security.BaseEmergencyWarnLogDao;
 | 
	
	
		
			
				|  | @ -15,8 +16,11 @@ import com.yihu.jw.care.service.lifeCare.LifeCareOrderService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.security.SecurityMonitoringOrderService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.sign.ServicePackageService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.util.CountDistance;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.util.Point;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.patient.BasePatientDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.care.device.BaseSleepPlan;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.care.device.PatientSafeAreaDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.care.label.BaseCapacityLabelDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.care.securitymonitoring.BaseEmergencyWarnLogDO;
 | 
	
	
		
			
				|  | @ -74,6 +78,10 @@ public class PatientInfoPlatFormService {
 | 
	
		
			
				|  |  |     private SecurityMonitoringOrderDao securityMonitoringOrderDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BaseSleepPlanDao sleepPlanDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PatientSafeAreaDao patientSafeAreaDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private CountDistance countDistance;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
	
		
			
				|  | @ -296,8 +304,24 @@ public class PatientInfoPlatFormService {
 | 
	
		
			
				|  |  |                 SecurityMonitoringOrderDO orderDO = securityMonitoringOrderDao.findOne(orderId);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 if ("疑似离开安全区域".equals(orderDO.getServeDesc())){
 | 
	
		
			
				|  |  |                     //超出距离
 | 
	
		
			
				|  |  |                     info.put("info1","超出距离: 1m");//todo
 | 
	
		
			
				|  |  |                     //超出距离 获取居民
 | 
	
		
			
				|  |  |                     List<PatientSafeAreaDO> patientSafeAreaDOs = patientSafeAreaDao.findByPatient(orderDO.getPatient());
 | 
	
		
			
				|  |  |                     if (patientSafeAreaDOs.size()>0){
 | 
	
		
			
				|  |  |                         PatientSafeAreaDO patientSafeAreaDO = patientSafeAreaDOs.get(0);
 | 
	
		
			
				|  |  |                         List<Point> pointList = new ArrayList<Point>(){};
 | 
	
		
			
				|  |  |                         String pointStr = patientSafeAreaDO.getSafeAreaGz();
 | 
	
		
			
				|  |  |                         String[] points = pointStr.split(";");
 | 
	
		
			
				|  |  |                         for (String tmp:points){
 | 
	
		
			
				|  |  |                             String[] lonLat = tmp.split(",");
 | 
	
		
			
				|  |  |                             pointList.add(new Point(Double.parseDouble(lonLat[1]) , Double.parseDouble(lonLat[0])));
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                         Point p = new Point(Double.parseDouble(orderDO.getServeLat()) , Double.parseDouble(orderDO.getServeLon()));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                         String dist = countDistance.getPointToEdgeDistance(p,pointList,2);
 | 
	
		
			
				|  |  |                         if (StringUtils.isNotBlank(dist)){
 | 
	
		
			
				|  |  |                             info.put("info1","超出距离: "+dist+"m");
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if ("超时未起床".equals(orderDO.getServeDesc())){
 | 
	
		
			
				|  |  |                     List<BaseSleepPlan> sleepPlan = sleepPlanDao.findByPatient(orderDO.getPatient());
 |