From 4db8023227b3900740b8be361c436ddadb1d0585 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 14 一月 2025 08:42:06 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java | 5 +++-- 1 files changed, 3 insertions(+), 2 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..30827ae 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 @@ -100,7 +100,7 @@ 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