电子围栏优化

master
guochaojie 5 months ago
parent 838a02108b
commit 88998e2432

@ -15,7 +15,6 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
*
* *
* V3.5 * V3.5
* https://www.jnpfsoft.com * https://www.jnpfsoft.com
@ -40,7 +39,7 @@ public class IStationAreaServiceImpl extends ServiceImpl<StationAreaMapper, Stat
for (StationArea area : areas) { for (StationArea area : areas) {
String mapInfo = area.getAreaMapInfo(); String mapInfo = area.getAreaMapInfo();
if(StringUtils.hasText(mapInfo)&& AreaUtil.isInsidePolygon(mapInfo, lng, lat)){ if (StringUtils.hasText(mapInfo) && AreaUtil.isInsidePolygon(mapInfo, lat, lng)) {
return area; return area;
} }
} }

@ -51,7 +51,7 @@
</select> </select>
//区域所属商户名下距离最近的回收站 <!-- 区域所属商户名下距离最近的回收站-->
<select id="getNearbyInArea" resultType="RecycleStation"> <select id="getNearbyInArea" resultType="RecycleStation">
SELECT a.*, SELECT a.*,
ROUND( ROUND(
@ -59,7 +59,7 @@
SQRT( SQRT(
POW(SIN((#{position.latitude} - latitude) * PI() / 360), 2) + POW(SIN((#{position.latitude} - latitude) * PI() / 360), 2) +
COS(#{position.latitude} * PI() / 180) * COS(latitude * PI() / 180) * COS(#{position.latitude} * PI() / 180) * COS(latitude * PI() / 180) *
POW(SIN((#{postion.longitude} - longitude) * PI() / 360), 2))) * 1000 POW(SIN((#{position.longitude} - longitude) * PI() / 360), 2))) * 1000
) AS distance ) AS distance
FROM nx_enterprise_recycle_station a FROM nx_enterprise_recycle_station a
WHERE a.latitude IS NOT NULL WHERE a.latitude IS NOT NULL

Loading…
Cancel
Save