|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<ArdAlarmpointsWell> getNearbyWellList(Long deptId, Double[] position, Integer range) { | 
|---|
|  |  |  | public List<ArdAlarmpointsWell> getNearbyWellList(Double longitudeCenter,Double latitudeCenter, Long deptId, Integer range) { | 
|---|
|  |  |  | List<ArdAlarmpointsWell> nearbyWellList = new ArrayList<>(); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell(); | 
|---|
|  |  |  | ardAlarmpointsWell.setDeptId(deptId); | 
|---|
|  |  |  | List<ArdAlarmpointsWell> ardAlarmpointsWells = ardAlarmpointsWellMapper.selectArdAlarmpointsWellList(ardAlarmpointsWell); | 
|---|
|  |  |  | if (ardAlarmpointsWells.size() > 0) { | 
|---|
|  |  |  | for (ArdAlarmpointsWell well : ardAlarmpointsWells) { | 
|---|
|  |  |  | Double longitude = well.getLongitude(); | 
|---|
|  |  |  | Double latitude = well.getLatitude(); | 
|---|
|  |  |  | if (longitude != null && latitude != null) { | 
|---|
|  |  |  | double distance = GisUtil.getDistance(position, new Double[]{longitude, latitude}); | 
|---|
|  |  |  | if (distance <= range) { | 
|---|
|  |  |  | nearbyWellList.add(well); | 
|---|
|  |  |  | if (longitudeCenter != null && latitudeCenter != null) { | 
|---|
|  |  |  | ArdAlarmpointsWell ardAlarmpointsWell=new ArdAlarmpointsWell(); | 
|---|
|  |  |  | ardAlarmpointsWell.setDeptId(deptId); | 
|---|
|  |  |  | List<ArdAlarmpointsWell> ardAlarmpointsWells = ardAlarmpointsWellMapper.selectArdAlarmpointsWellList(ardAlarmpointsWell); | 
|---|
|  |  |  | if (ardAlarmpointsWells.size() > 0) { | 
|---|
|  |  |  | for (ArdAlarmpointsWell well : ardAlarmpointsWells) { | 
|---|
|  |  |  | Double longitude = well.getLongitude(); | 
|---|
|  |  |  | Double latitude = well.getLatitude(); | 
|---|
|  |  |  | if (longitude != null && latitude != null) { | 
|---|
|  |  |  | double distance = GisUtil.getDistance(new Double[]{longitudeCenter, latitudeCenter}, new Double[]{longitude, latitude}); | 
|---|
|  |  |  | if (distance <= range) { | 
|---|
|  |  |  | nearbyWellList.add(well); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|