| | |
| | | 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; |
| | |
| | | * @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(); |
| | |
| | | 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)); |