puzhibing
2026-02-24 4fa033eaa1ddfd9ed4030b2db061cfeaf49c2897
修改分表分库框架和XPU对接逻辑
6个文件已修改
64 ■■■■■ 已修改文件
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/map/XpMapClientFallbackFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/map/XpMapClient.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/RouteVo.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/map/XpMapClientFallbackFactory.java
@@ -29,6 +29,13 @@
                return R.fail("获取订单距离和时长失败,"+cause.getMessage());
            }
            @Override
            public R<String> queryRouted(String routedID) {
                log.error("根据导航ID获取车端需要的导航数据失败:{}", cause.getMessage());
                return R.fail("根据导航ID获取车端需要的导航数据失败:" + cause.getMessage());
            }
            @Override
            public R<Boolean> diagnosisArea(RouteAndFareDto dto) {
                log.error("判断是否同一经营区域失败:{}", cause.getMessage());
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/map/XpMapClient.java
@@ -12,6 +12,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(contextId = "XpMapClient", value = ServiceNameConstantsEnum.XP_MAP_SERVICE, fallbackFactory = XpMapClientFallbackFactory.class)
public interface XpMapClient {
@@ -33,6 +34,16 @@
    /**
     * 根据导航ID获取车端需要的导航数据
     * @param routedID
     * @return
     */
    @PostMapping("/base/v1/mini-program/map/queryRouted")
    R<String> queryRouted(@RequestParam("routedID") String routedID);
    /**
     * 判断是否同一经营区域
     * @param dto
     * @return
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/RouteVo.java
@@ -18,8 +18,4 @@
    private String routeID;
    private List<LonLatDto> polyline;
    /**
     * 导航原始数据
     */
    private String routeDataContent;
}
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -434,8 +434,13 @@
                    throw new RuntimeException("获取订单线路和运费失败");
                }
                RouteVo routeVo = routeVoR.getData();
                R<String> stringR = xpMapClient.queryRouted(routeVo.getRouteID());
                if (200 != stringR.getCode()) {
                    throw new RuntimeException("根据导航ID获取车端需要的导航数据失败");
                }
                //构建导航下发请求对象
                cloudPushNavigationInfo(requestId, routeVo.getRouteID(), routeVo.getRouteDataContent(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
                cloudPushNavigationInfo(requestId, routeVo.getRouteID(), stringR.getData(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
            }
        }
    }
@@ -504,8 +509,12 @@
            }
            XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData();
            RouteVo routeVo = routeVoR.getData();
            R<String> stringR = xpMapClient.queryRouted(routeVo.getRouteID());
            if (200 != stringR.getCode()) {
                throw new RuntimeException("根据导航ID获取车端需要的导航数据失败");
            }
            //构建导航下发请求对象
            cloudPushNavigationInfo(requestId, routeVo.getRouteID(), routeVo.getRouteDataContent(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
            cloudPushNavigationInfo(requestId, routeVo.getRouteID(), stringR.getData(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
        }
    }
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java
@@ -119,7 +119,15 @@
        return R.ok(routeVo);
    }
    /**
     * 根据导航ID获取车端需要的导航数据
     * @param routedID
     * @return
     */
    @PostMapping("/map/queryRouted")
    public R<String> getOrderDistanceAndDuration(@RequestParam("routedID") String routedID){
        return R.ok(gdMapGeocodingUtil.routed(routedID));
    }
    /**
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
@@ -71,8 +71,6 @@
        JSONObject jsonObject1 = JSON.parseObject(data);
        String routeID = jsonObject1.getString("routeID");
        JSONArray path = jsonObject1.getJSONArray("paths");
        JSONArray path = jsonObject1.getJSONArray("path");
        routeVo.setRouteDataContent(data);
        for (Object o : path) {
            JSONObject jsonObject2 = (JSONObject) o;
@@ -112,5 +110,22 @@
    }
    /**
     * 线路还原接口
     * 车端使用的数据
     * @param routeID
     * @return
     */
    public String routed(String routeID){
        String url = "https://tsapi.amap.com/v1/route/query/routeid?key=" + key;
        HashMap<String, Object> params = new HashMap<>();
        params.put("routeID", routeID);
        params.put("sdkVersion", "");
        params.put("encoderVersion", "5.1");
        String post = HttpUtils.post(url, JSON.toJSONString(params));
        System.out.println("高德地图返回结果:"+ post);
        JSONObject jsonObject = JSON.parseObject(post);
        return jsonObject.getString("data");
    }
}