From 29c9ada64cee7adf3399e92ee3a62f2b9ed338ed Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 14 一月 2025 10:19:38 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng --- ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java index 384a27e..0475c35 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java @@ -10,6 +10,7 @@ import com.ruoyi.account.api.model.*; import com.ruoyi.account.mapper.AppUserMapper; import com.ruoyi.account.service.*; +import com.ruoyi.account.util.GeodesyUtil; import com.ruoyi.account.util.SMSUtil; import com.ruoyi.account.util.payment.PaymentUtil; import com.ruoyi.account.util.payment.model.CloseOrderResult; @@ -713,7 +714,18 @@ nearbyReferrerVo.setVip("合伙人"); break; } + + String latitude = nearbyReferrerVo.getLatitude(); + String longitude = nearbyReferrerVo.getLongitude(); + Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, nearbyReferrer.getLongitude() + "," + nearbyReferrer.getLatitude()).get("WGS84"); + nearbyReferrerVo.setDistance(wgs84); } + list.sort(new Comparator<NearbyReferrerVo>() { + @Override + public int compare(NearbyReferrerVo o1, NearbyReferrerVo o2) { + return o1.getDistance().compareTo(o2.getDistance()); + } + }); return pageInfo.setRecords(list); } return null; -- Gitblit v1.7.1