| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.common.core.utils.HttpUtils; |
| | | import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService; |
| | | import com.xiaopeng.map.utils.mangoUtils.MongoGeoFenceUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | params.put("start", start.getLongitude() + "," + start.getLatitude()); |
| | | params.put("end", end.getLongitude() + "," + end.getLatitude()); |
| | | params.put("routeUserType",2); |
| | | params.put("voidPolygons", avoidRoads); |
| | | if(avoidRoads!=null && !avoidRoads.isEmpty()){ |
| | | params.put("voidPolygons", avoidRoads); |
| | | } |
| | | if(routePlanRule!=null){ |
| | | params.put("strategy", routePlanRule); |
| | | } |
| | | |
| | | String post = HttpUtils.post(url, JSON.toJSONString(params)); |
| | | System.out.println("高德地图返回结果:"+ post); |
| | | String forObject = restTemplate.getForObject(url, String.class, params); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | String data = jsonObject.getString("data"); |