修改获取附近车辆bug
修改默认所有相机启动引导队列
| | |
| | | String carId = (String) carMap.get("carId"); |
| | | Map<String, Object> carGPSTrack = sYClient.getCarNearPositionByCarId(syUrl, carId, ardSyUser.getUserId(), sessionId); |
| | | List<Map<String, Object>> carGPSMap = (List<Map<String, Object>>) carGPSTrack.get("list"); |
| | | Double lng = Double.valueOf((String) carGPSMap.get(0).get("lng")); |
| | | Double lat = Double.valueOf((String) carGPSMap.get(0).get("lat")); |
| | | double distance = GisUtil.getDistance(new double[]{longitude, latitude}, new double[]{lng, lat}); |
| | | if (distance <= radius) { |
| | | carMap.put("longitude", lng); |
| | | carMap.put("latitude", lat); |
| | | filteredList.add(carMap); // 将满足条件的车辆添加到筛选列表中 |
| | | if(carGPSMap.size()>0) { |
| | | Double lng = Double.valueOf((String) carGPSMap.get(0).get("lng")); |
| | | Double lat = Double.valueOf((String) carGPSMap.get(0).get("lat")); |
| | | double distance = GisUtil.getDistance(new double[]{longitude, latitude}, new double[]{lng, lat}); |
| | | if (distance <= radius) { |
| | | carMap.put("longitude", lng); |
| | | carMap.put("latitude", lat); |
| | | filteredList.add(carMap); // 将满足条件的车辆添加到筛选列表中 |
| | | } |
| | | } |
| | | } |
| | | return filteredList; |
| | |
| | | |
| | | //创建引导队列 |
| | | private void createGuideQueue(ArdCameras camera) { |
| | | if (camera.getCamAlarmGuideEnable() != null) { |
| | | if (camera.getCamAlarmGuideEnable() == 1) { |
| | | if (!GuidePriorityQueue.cameraQueueMap.containsKey(camera.getId())) { |
| | | Comparator<GuideTask> comparator = GuidePriorityQueue.getComparator(); |
| | | PriorityBlockingQueue<GuideTask> priorityQueue = new PriorityBlockingQueue<>(1000, comparator); |
| | | GuidePriorityQueue.cameraQueueMap.put(camera.getId(), priorityQueue); |
| | | //启动队列处理器 |
| | | queueHandler.process(camera.getId()); |
| | | } |
| | | } |
| | | if (!GuidePriorityQueue.cameraQueueMap.containsKey(camera.getId())) { |
| | | Comparator<GuideTask> comparator = GuidePriorityQueue.getComparator(); |
| | | PriorityBlockingQueue<GuideTask> priorityQueue = new PriorityBlockingQueue<>(1000, comparator); |
| | | GuidePriorityQueue.cameraQueueMap.put(camera.getId(), priorityQueue); |
| | | //启动队列处理器 |
| | | queueHandler.process(camera.getId()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //创建引导队列 |
| | | private void createGuideQueue(ArdCameras camera) { |
| | | if (camera.getCamAlarmGuideEnable() != null) { |
| | | if (camera.getCamAlarmGuideEnable() == 1) { |
| | | if (!GuidePriorityQueue.cameraQueueMap.containsKey(camera.getId())) { |
| | | Comparator<GuideTask> comparator = GuidePriorityQueue.getComparator(); |
| | | PriorityBlockingQueue<GuideTask> priorityQueue = new PriorityBlockingQueue<>(1000, comparator); |
| | | GuidePriorityQueue.cameraQueueMap.put(camera.getId(), priorityQueue); |
| | | //启动队列处理器 |
| | | queueHandler.process(camera.getId()); |
| | | } |
| | | } |
| | | if (!GuidePriorityQueue.cameraQueueMap.containsKey(camera.getId())) { |
| | | Comparator<GuideTask> comparator = GuidePriorityQueue.getComparator(); |
| | | PriorityBlockingQueue<GuideTask> priorityQueue = new PriorityBlockingQueue<>(1000, comparator); |
| | | GuidePriorityQueue.cameraQueueMap.put(camera.getId(), priorityQueue); |
| | | //启动队列处理器 |
| | | queueHandler.process(camera.getId()); |
| | | } |
| | | } |
| | | |