提交 767f2f3e 作者: Administrator

Merge remote-tracking branch 'origin/merge_dev' into dev_tzl

......@@ -36,14 +36,18 @@ public interface LocationFenceRepository
* @param name 围栏名称
* @return 围栏信息
*/
@Query("SELECT f FROM LocationFence f WHERE name like %?1% AND deleted = false")
@Query("SELECT f FROM LocationFence f WHERE f.name like %?1% AND f.deleted = false")
List<LocationFence> findLikeName(String name);
/**
* 查询空间信息在围栏内的围栏信息
* @param areaId 地图区域 id
* @param geometry 空间信息
* @return 围栏信息
*/
@Query(value = "select f.* from bs_location_fence f where st_contains(f.geometry, :geometry)", nativeQuery = true)
List<LocationFence> findByGeometryContains(Geometry geometry);
@Query(
value = "select f.* from bs_location_fence f where map_id = :areaId and st_contains(f.geometry, :geometry)",
nativeQuery = true
)
List<LocationFence> findByGeometryContains(Long areaId, Geometry geometry);
}
......@@ -185,8 +185,8 @@ public class PositionMessageServiceImpl implements PositionMessageService {
// 计算出入标记(围栏、区域)
List<LocationTurnover> turnovers = new ArrayList<>();
// 查询定位在围栏内的围栏信息
List<LocationFence> fences = locationFenceRepository.findByGeometryContains(point);
// 查询定位在围栏内的围栏信息(同时根据地图区域查询,用来区分不同楼层的围栏)
List<LocationFence> fences = locationFenceRepository.findByGeometryContains(locationLog.getAreaId(), point);
Set<Long> fenceIds = fences.stream().map(LocationFence::getId).collect(Collectors.toSet());
locationLog.setFences(new JSONArray().fluentAddAll(fenceIds));
// 计算围栏进出
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论