Commit 87df9b624fd00c135d8a470cb8b4fc54ef89009e
1 parent
dd8d8404
Replace Baidu Map API with Amap across all services.
Showing
4 changed files
with
5 additions
and
5 deletions
sl-express-ms-oms-service/src/main/java/com/sl/ms/oms/service/impl/OrderServiceImpl.java
| @@ -215,7 +215,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl | @@ -215,7 +215,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl | ||
| 215 | Coordinate destination = new Coordinate(receiveLnt, receiveLat); | 215 | Coordinate destination = new Coordinate(receiveLnt, receiveLat); |
| 216 | //设置高德地图参数,默认是不返回预计耗时的,需要额外设置参数 | 216 | //设置高德地图参数,默认是不返回预计耗时的,需要额外设置参数 |
| 217 | Map<String, Object> param = MapUtil.<String, Object>builder().put("show_fields", "cost").build(); | 217 | Map<String, Object> param = MapUtil.<String, Object>builder().put("show_fields", "cost").build(); |
| 218 | - String driving = this.eagleMapTemplate.opsForDirection().driving(ProviderEnum.BAIDU, origin, destination, param); | 218 | + String driving = this.eagleMapTemplate.opsForDirection().driving(ProviderEnum.AMAP, origin, destination, param); |
| 219 | if (StrUtil.isEmpty(driving)) { | 219 | if (StrUtil.isEmpty(driving)) { |
| 220 | return; | 220 | return; |
| 221 | } | 221 | } |
| @@ -282,7 +282,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl | @@ -282,7 +282,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderEntity> impl | ||
| 282 | throw new SLException("下单时发货地址不能为空"); | 282 | throw new SLException("下单时发货地址不能为空"); |
| 283 | } | 283 | } |
| 284 | //根据详细地址查询坐标 | 284 | //根据详细地址查询坐标 |
| 285 | - GeoResult geoResult = this.eagleMapTemplate.opsForBase().geoCode(ProviderEnum.BAIDU, address, null); | 285 | + GeoResult geoResult = this.eagleMapTemplate.opsForBase().geoCode(ProviderEnum.AMAP, address, null); |
| 286 | Coordinate coordinate = geoResult.getLocation(); | 286 | Coordinate coordinate = geoResult.getLocation(); |
| 287 | 287 | ||
| 288 | log.info("地址和坐标-->" + address + "--" + coordinate); | 288 | log.info("地址和坐标-->" + address + "--" + coordinate); |
sl-express-ms-service-scope-service/src/main/java/com/sl/ms/scope/service/impl/ScopeServiceImpl.java
| @@ -141,7 +141,7 @@ public class ScopeServiceImpl implements ScopeService { | @@ -141,7 +141,7 @@ public class ScopeServiceImpl implements ScopeService { | ||
| 141 | */ | 141 | */ |
| 142 | @Override | 142 | @Override |
| 143 | public List<ServiceScopeEntity> queryListByPoint(ServiceTypeEnum type, String address) { | 143 | public List<ServiceScopeEntity> queryListByPoint(ServiceTypeEnum type, String address) { |
| 144 | - GeoResult geoResult = eagleMapTemplate.opsForBase().geoCode(ProviderEnum.BAIDU, address, null); | 144 | + GeoResult geoResult = eagleMapTemplate.opsForBase().geoCode(ProviderEnum.AMAP, address, null); |
| 145 | Coordinate coordinate = geoResult.getLocation(); | 145 | Coordinate coordinate = geoResult.getLocation(); |
| 146 | return queryListByPoint(type, new GeoJsonPoint(coordinate.getLongitude(), coordinate.getLatitude())); | 146 | return queryListByPoint(type, new GeoJsonPoint(coordinate.getLongitude(), coordinate.getLatitude())); |
| 147 | } | 147 | } |
sl-express-ms-transport-service/src/main/java/com/sl/transport/service/impl/TransportLineServiceImpl.java
| @@ -140,7 +140,7 @@ public class TransportLineServiceImpl implements TransportLineService { | @@ -140,7 +140,7 @@ public class TransportLineServiceImpl implements TransportLineService { | ||
| 140 | Coordinate destination = new Coordinate(endOrgan.getLongitude(), endOrgan.getLatitude()); | 140 | Coordinate destination = new Coordinate(endOrgan.getLongitude(), endOrgan.getLatitude()); |
| 141 | //设置高德地图参数,默认是不返回预计耗时的,需要额外设置参数 | 141 | //设置高德地图参数,默认是不返回预计耗时的,需要额外设置参数 |
| 142 | Map<String, Object> param = MapUtil.<String, Object>builder().put("show_fields", "cost").build(); | 142 | Map<String, Object> param = MapUtil.<String, Object>builder().put("show_fields", "cost").build(); |
| 143 | - String driving = this.eagleMapTemplate.opsForDirection().driving(ProviderEnum.BAIDU, origin, destination, param); | 143 | + String driving = this.eagleMapTemplate.opsForDirection().driving(ProviderEnum.AMAP, origin, destination, param); |
| 144 | if (StrUtil.isEmpty(driving)) { | 144 | if (StrUtil.isEmpty(driving)) { |
| 145 | return; | 145 | return; |
| 146 | } | 146 | } |
sl-express-ms-web-manager/src/main/java/com/sl/ms/web/manager/service/impl/AgencyServiceImpl.java
| @@ -104,7 +104,7 @@ public class AgencyServiceImpl implements AgencyService { | @@ -104,7 +104,7 @@ public class AgencyServiceImpl implements AgencyService { | ||
| 104 | address.append(areaMap.get(agencyVO.getProvinceId()).getName()); | 104 | address.append(areaMap.get(agencyVO.getProvinceId()).getName()); |
| 105 | address.append(areaMap.get(agencyVO.getCountyId()).getName()); | 105 | address.append(areaMap.get(agencyVO.getCountyId()).getName()); |
| 106 | address.append(agencyVO.getAddress()); | 106 | address.append(agencyVO.getAddress()); |
| 107 | - GeoResult geoResult = eagleMapTemplate.opsForBase().geoCode(ProviderEnum.BAIDU, address.toString(), null); | 107 | + GeoResult geoResult = eagleMapTemplate.opsForBase().geoCode(ProviderEnum.AMAP, address.toString(), null); |
| 108 | Coordinate coordinate = geoResult.getLocation(); | 108 | Coordinate coordinate = geoResult.getLocation(); |
| 109 | 109 | ||
| 110 | log.info("地址和坐标-->" + address + "--" + coordinate); | 110 | log.info("地址和坐标-->" + address + "--" + coordinate); |