Commit e06d75af by 向延琳

查询地址

1 parent 4c81f924
...@@ -146,7 +146,7 @@ public class FeignGpsBsController implements GpsBsFeignService { ...@@ -146,7 +146,7 @@ public class FeignGpsBsController implements GpsBsFeignService {
@ResponseBody @ResponseBody
@Override @Override
public R<LngLatAddressDTO> getAddressMap(@RequestBody List<LngLatDTO> lngLats) { public R<LngLatAddressDTO> getAddressMap(@RequestBody List<LngLatDTO> lngLats) {
Map<LngLatDTO, String> addressMap = gpsBsLocationService.getAddressMap(lngLats); Map<String, String> addressMap = gpsBsLocationService.getAddressMap(lngLats);
return R.ok().data(new LngLatAddressDTO(addressMap)); return R.ok().data(new LngLatAddressDTO(addressMap));
} }
......
...@@ -96,7 +96,7 @@ public interface GpsBsLocationService { ...@@ -96,7 +96,7 @@ public interface GpsBsLocationService {
* @param lngLats 经纬度集合 * @param lngLats 经纬度集合
* @return 经纬度对应的地址 * @return 经纬度对应的地址
*/ */
Map<LngLatDTO, String> getAddressMap(List<LngLatDTO> lngLats); Map<String, String> getAddressMap(List<LngLatDTO> lngLats);
/** /**
* 根据设备号和报警时间获取报警时间的定位 * 根据设备号和报警时间获取报警时间的定位
......
...@@ -440,14 +440,14 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService { ...@@ -440,14 +440,14 @@ public class GpsBsLocationServiceImpl implements GpsBsLocationService {
* 获取经纬度对应的地址 * 获取经纬度对应的地址
*/ */
@Override @Override
public Map<LngLatDTO, String> getAddressMap(List<LngLatDTO> lngLats) { public Map<String, String> getAddressMap(List<LngLatDTO> lngLats) {
Map<LngLatDTO, String> result = Maps.newHashMap(); Map<String, String> result = Maps.newHashMap();
if (CollectionUtils.isEmpty(lngLats)) { if (CollectionUtils.isEmpty(lngLats)) {
return result; return result;
} }
lngLats.forEach(e -> { lngLats.forEach(e -> {
String address = getAddressBylngAndLat(e.getLat(), e.getLng()); String address = getAddressBylngAndLat(e.getLat(), e.getLng());
result.put(e, address); result.put(e.getLat() + e.getLng(), address);
}); });
return result; return result;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!