liujie
2026-04-09 bb60f152e4c4cf4abd81df31aa77c927cdd9e19a
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.api.dto.map.HistoryPointDto;
import com.xiaopeng.api.dto.operation.LonLatDto;
import com.xiaopeng.api.vo.operation.RouteVo;
import com.xiaopeng.common.core.utils.HttpUtils;
@@ -47,7 +48,7 @@
     * @return
     * @throws Exception
     */
    public RouteVo getDistanceAndTime(LonLatDto start, LonLatDto end,String avoidRoads,String fenceId,Integer routePlanRule)  {
    public RouteVo getDistanceAndTime(LonLatDto start, LonLatDto end,String avoidRoads,String fenceId,Integer routePlanRule, List<HistoryPointDto> history)  {
        RouteVo routeVo = new RouteVo();
        String url = "https://tsapi.amap.com/v1/route/price?key=" + key + "&extensions=all&start=" + start.getLongitude() + "," + start.getLatitude();
@@ -62,6 +63,9 @@
        if(routePlanRule!=null){
            params.put("strategy", routePlanRule);
        }
        if(null != history && !history.isEmpty()){
            params.put("history", history);
        }
        log.info("高德地图接口:{}", url);
        log.info("高德地图参数:{}", params);
        String post = HttpUtils.post(url, JSON.toJSONString(params));