From ff773f631c6e792a1e0a11d2a4fe30805825faa2 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 27 三月 2026 14:37:11 +0800
Subject: [PATCH] 修改bug

---
 xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
index 6fecbc9..41c4da5 100644
--- a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
+++ b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
@@ -77,6 +77,45 @@
             JSONObject jsonObject2 = (JSONObject) o;
             String routeID = jsonObject2.getString("routeID");
             String points = jsonObject2.getString("points");
+            String label = jsonObject2.getString("label");
+            if(label.contains("大众常选")){
+                String[] split = points.split(";");
+                List<LonLatDto> pointsArray = new ArrayList<>();
+                for (int i = 0; i < split.length; i++) {
+                    if((i % 2) == 0){
+                        String[] split1 = split[i].split(",");
+                        LonLatDto lonLatDto = new LonLatDto(Double.parseDouble(split1[0]), Double.parseDouble(split1[1]));
+                        pointsArray.add(lonLatDto);
+                    }
+                }
+                ForkJoinPool pool = new ForkJoinPool(); // 创建ForkJoinPool对象(默认使用处理器的核心数作为线程池大小)
+                ArrayPointsTask arrayPointsTask = new ArrayPointsTask(pointsArray, fenceId); // 创建求和任务对象并传入数组作为参数(这里也可以传入数组的一部分作为参数来实现更细粒度的拆分)
+                Long temp = pool.invoke(arrayPointsTask); // 提交任务并等待处理完成(也可以使用submit方法提交任务并获取一个Future对象来异步获取结果)
+                pool.shutdown(); // 关闭ForkJoinPool(释放资源)
+                if(temp==0){
+                    Integer costTime = jsonObject2.getInteger("costTime");
+                    Integer distance = jsonObject2.getInteger("distance");
+                    routeVo.setDistance(distance);
+                    routeVo.setDuration(costTime);
+                    ArrayList<LonLatDto> lonLatDtos = new ArrayList<>(split.length);
+                    for (String s : split) {
+                        String[] split1 = s.split(",");
+                        LonLatDto lonLatDto = new LonLatDto(Double.parseDouble(split1[0]), Double.parseDouble(split1[1]));
+                        lonLatDtos.add(lonLatDto);
+                    }
+                    routeVo.setPolyline(lonLatDtos);
+                    routeVo.setRouteID(routeID);
+                    log.info("导航 {} 在 {} 运营区域内", routeVo.getRouteID(), fenceId);
+                    return routeVo;
+                }
+            }
+
+        }
+
+        for (Object o : path) {
+            JSONObject jsonObject2 = (JSONObject) o;
+            String routeID = jsonObject2.getString("routeID");
+            String points = jsonObject2.getString("points");
             String[] split = points.split(";");
             List<LonLatDto> pointsArray = new ArrayList<>();
             for (int i = 0; i < split.length; i++) {

--
Gitblit v1.7.1