| | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutionException; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | log.info("相机:" + cameraId + "未开启报警引导功能"); |
| | | return; |
| | | } |
| | | |
| | | SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | GuideTask guideTask = new GuideTask(); |
| | | //相机ID |
| | |
| | | */ |
| | | private String getNearbyCamera(double[] targetPosition) { |
| | | String minDistanceCameraId = ""; |
| | | try { |
| | | //获取所有大光电 |
| | | List<ArdCameras> ardCamerasList = ardCamerasMapper.selectArdCamerasList(new ArdCameras("1")); |
| | | //统计所有大光电可视范围内与报警点的距离 |
| | | Map<String, Double> distanceMap = new HashMap<>(); |
| | | Map<String, Integer> guideMap = new HashMap<>(); |
| | | for (ArdCameras camera : ardCamerasList) { |
| | | if (camera.getCamMaxVisibleDistance() == null) { |
| | | continue; |
| | | } |
| | | double[] camPosition = new double[]{camera.getLongitude(), camera.getLatitude()}; |
| | | double distance = GisTool.getDistance(targetPosition, camPosition); |
| | | if (distance != 0.0 && distance <= camera.getCamMaxVisibleDistance()) { |
| | |
| | | return " "; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | log.error("获取附近开启报警引导功能光电异常:"+ex.getMessage()); |
| | | } |
| | | return minDistanceCameraId; |
| | | } |
| | | |