From c168f544ecd041760e7d0fba66c48e06b9ab67dc Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期一, 05 十二月 2022 16:51:21 +0800
Subject: [PATCH] Merge branch 'local_20221104' into huacheng_test
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java | 41 +++++++++++++++++++++++++++++++++--------
1 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java
index f558c61..8a090d5 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java
@@ -22,10 +22,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
@@ -150,10 +147,11 @@
String maxLng = around.get("maxLng").toString();
List<ConvenientElevatingPointDO> convenientElevatingPointDOS = this.baseMapper.selectList(
new LambdaQueryWrapper<ConvenientElevatingPointDO>()
- .ge(ConvenientElevatingPointDO::getLat, minLng)
- .le(ConvenientElevatingPointDO::getLat, maxLng)
- .ge(ConvenientElevatingPointDO::getLon, minLat)
- .le(ConvenientElevatingPointDO::getLon, maxLat));
+ .ge(ConvenientElevatingPointDO::getLat, Double.parseDouble(minLng))
+ .le(ConvenientElevatingPointDO::getLat, Double.parseDouble(maxLng))
+ .ge(ConvenientElevatingPointDO::getLon, Double.parseDouble(minLat))
+ .le(ConvenientElevatingPointDO::getLon, Double.parseDouble(maxLat))
+ .eq(ConvenientElevatingPointDO::getBusinessStatus,1));
List<ConvenientElevatingPointVO> convenientElevatingPointVOS = new ArrayList<>();
convenientElevatingPointDOS.forEach(f -> {
ConvenientElevatingPointVO convenientElevatingPointVO = new ConvenientElevatingPointVO();
@@ -162,7 +160,34 @@
convenientElevatingPointVO.setDistance(distance);
convenientElevatingPointVOS.add(convenientElevatingPointVO);
});
+ Collections.sort(convenientElevatingPointVOS);
return R.ok(convenientElevatingPointVOS);
}
+
+ @Override
+ public R findPointNumByDistance(Integer distance, String lat, String lng) {
+ Map<Object, Object> around = MapDistance.getAround(lat, lng, distance * 1000d);
+ String maxLat = around.get("maxLat").toString();
+ String minLat = around.get("minLat").toString();
+ String minLng = around.get("minLng").toString();
+ String maxLng = around.get("maxLng").toString();
+ List<ConvenientElevatingPointDO> convenientElevatingPointDOS = this.baseMapper.selectList(
+ new LambdaQueryWrapper<ConvenientElevatingPointDO>()
+ .ge(ConvenientElevatingPointDO::getLat, Double.parseDouble(minLng))
+ .le(ConvenientElevatingPointDO::getLat, Double.parseDouble(maxLng))
+ .ge(ConvenientElevatingPointDO::getLon, Double.parseDouble(minLat))
+ .le(ConvenientElevatingPointDO::getLon, Double.parseDouble(maxLat))
+ .eq(ConvenientElevatingPointDO::getBusinessStatus,1));
+ List<ConvenientElevatingPointVO> convenientElevatingPointVOS = new ArrayList<>();
+ convenientElevatingPointDOS.forEach(f -> {
+ ConvenientElevatingPointVO convenientElevatingPointVO = new ConvenientElevatingPointVO();
+ BeanUtils.copyProperties(f, convenientElevatingPointVO);
+ Double distancem = MapDistance.distanceOfTwoPoints(lat, lng, f.getLon(), f.getLat());
+ convenientElevatingPointVO.setDistance(distancem);
+ convenientElevatingPointVOS.add(convenientElevatingPointVO);
+ });
+ Collections.sort(convenientElevatingPointVOS);
+ return R.ok(convenientElevatingPointVOS.size());
+ }
}
--
Gitblit v1.7.1