|
|
@@ -1,7 +1,6 @@
|
|
|
package shop.alien.store.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.alibaba.fastjson2.util.DateUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
@@ -2571,7 +2570,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
return Collections.emptyList();
|
|
|
}
|
|
|
|
|
|
- return filterStoresWithinDistance(storeInfoVoList, lon, lat, DEFAULT_DISTANCE_METER);
|
|
|
+ return filterStoresWithinDistance(storeInfoVoList, lon, lat);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -2580,18 +2579,17 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
|
|
|
* @param storeInfoVoList 原始店铺列表
|
|
|
* @param lon 用户经度
|
|
|
* @param lat 用户纬度
|
|
|
- * @param maxDistance 最大距离(米)
|
|
|
* @return 距离范围内的店铺列表
|
|
|
*/
|
|
|
- private List<StoreInfoVo> filterStoresWithinDistance(List<StoreInfoVo> storeInfoVoList, double lon, double lat, int maxDistance) {
|
|
|
+ private List<StoreInfoVo> filterStoresWithinDistance(List<StoreInfoVo> storeInfoVoList, double lon, double lat) {
|
|
|
List<StoreInfoVo> filteredList = storeInfoVoList.stream()
|
|
|
- .filter(store -> isWithinDistance(store, lon, lat, maxDistance))
|
|
|
+ .filter(store -> isWithinDistance(store, lon, lat, StoreInfoServiceImpl.DEFAULT_DISTANCE_METER))
|
|
|
.sorted(Comparator.comparingDouble(StoreInfoVo::getDistance3))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
if (log.isInfoEnabled()) {
|
|
|
log.info("距离筛选完成,原始店铺数量={},筛选后店铺数量={},筛选距离={}米",
|
|
|
- storeInfoVoList.size(), filteredList.size(), maxDistance);
|
|
|
+ storeInfoVoList.size(), filteredList.size(), StoreInfoServiceImpl.DEFAULT_DISTANCE_METER);
|
|
|
}
|
|
|
return filteredList;
|
|
|
}
|