From a9bd63ec999704d57bcde0a116e5942eddbed289 Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期三, 15 一月 2025 20:22:39 +0800
Subject: [PATCH] 12.18
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
index 9991212..68b621e 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -73,7 +73,7 @@
List<NearbyShopVO> nearbyShopVOS = shopMapper.selectNearbyShopList();
for (NearbyShopVO nearbyShopVO : nearbyShopVOS) {
Double wgs84 = GeodesyUtil.getDistance(nearbyShopVO.getLongitude() + "," + nearbyShopVO.getLatitude(), longitude + "," + latitude).get("WGS84");
- nearbyShopVO.setDistance(wgs84);
+ nearbyShopVO.setDistance(new BigDecimal(wgs84).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
}
nearbyShopVOS.sort(new Comparator<NearbyShopVO>() {
@Override
@@ -93,14 +93,14 @@
}
Shop shop = shopMapper.selectById(appUser.getShopId());
- if(null != shop){
+ if(null != shop && shop.getDelFlag() == 0 && shop.getStatus() == 1){
NearbyShopVO vo = new NearbyShopVO();
vo.setId(appUser.getShopId().longValue());
vo.setName(shop.getName());
vo.setAddress(shop.getAddress());
vo.setHomePicture(shop.getHomePicture());
Double wgs84 = GeodesyUtil.getDistance(longitude.toString() + "," + latitude.toString(), shop.getLongitude() + "," + shop.getLatitude()).get("WGS84");
- vo.setDistance(wgs84);
+ vo.setDistance(new BigDecimal(wgs84).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
nearbyShopVOS.add(0, vo);
}
}
@@ -117,6 +117,7 @@
Map<Long, List<ShopScore>> shopScoreMap = shopScores.stream().collect(Collectors.groupingBy(ShopScore::getShopId));
AppUser finalAppUser1 = appUser;
nearbyShopVOS.forEach(nearbyShopVO -> {
+ nearbyShopVO.setScore("5");
List<ShopScore> scores = shopScoreMap.get(nearbyShopVO.getId());
if (scores != null && !scores.isEmpty()){
BigDecimal score = scores.stream()
--
Gitblit v1.7.1