|
@ -206,7 +206,7 @@ public class ContactsService {
|
|
List<Map<String,Object>> result = new ArrayList<>();
|
|
List<Map<String,Object>> result = new ArrayList<>();
|
|
String sql = "select * from base_org org " ;
|
|
String sql = "select * from base_org org " ;
|
|
if (StringUtils.isNotBlank(patient)){
|
|
if (StringUtils.isNotBlank(patient)){
|
|
sql +=" LEFT JOIN ( " +
|
|
|
|
|
|
sql +=" Inner JOIN ( " +
|
|
"SELECT DISTINCT pack.org_code,'1' as signFlag FROM base_service_package_sign_record sr, base_service_package_record r, " +
|
|
"SELECT DISTINCT pack.org_code,'1' as signFlag FROM base_service_package_sign_record sr, base_service_package_record r, " +
|
|
" base_service_package pack WHERE sr.id = r.sign_id and sr.status=1 and sr.patient = '"+patient+"'" +
|
|
" base_service_package pack WHERE sr.id = r.sign_id and sr.status=1 and sr.patient = '"+patient+"'" +
|
|
" and r.service_package_id = pack.id " +
|
|
" and r.service_package_id = pack.id " +
|
|
@ -422,8 +422,32 @@ public class ContactsService {
|
|
sosContactsDao.save(modify);
|
|
sosContactsDao.save(modify);
|
|
}
|
|
}
|
|
|
|
|
|
public List<PatientSafeAreaDO> getPatientSafeArea(String patient){
|
|
|
|
return safeAreaDao.findByPatient(patient);
|
|
|
|
|
|
public JSONObject getPatientSafeArea(String patient){
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
result.put("currentPositioning",null); //当前定位
|
|
|
|
result.put("currentLat",null); //当前定位
|
|
|
|
result.put("currentLon",null);
|
|
|
|
List<PatientSafeAreaDO> safes = safeAreaDao.findByPatient(patient);
|
|
|
|
result.put("fences",safes);
|
|
|
|
Double dulat = null;
|
|
|
|
Double dulon = null;
|
|
|
|
BasePatientDO patientDO = basePatientDao.findById(patient);
|
|
|
|
String points = patientDO.getLatLon();
|
|
|
|
if (StringUtils.isNotBlank(points)){
|
|
|
|
String[] pointss = points.split(",");
|
|
|
|
if (2==pointss.length){
|
|
|
|
if (StringUtils.isNotBlank(pointss[0])){
|
|
|
|
dulat = Double.parseDouble(pointss[0]);
|
|
|
|
}
|
|
|
|
if (StringUtils.isNotBlank(pointss[1])){
|
|
|
|
dulon = Double.parseDouble(pointss[1]);
|
|
|
|
}
|
|
|
|
result.put("currentPositioning",LatitudeUtils.getLocationAddress(dulat+"",dulon+""));
|
|
|
|
result.put("currentLat",dulat);
|
|
|
|
result.put("currentLon",dulon);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|