Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
767f2f3e
提交
767f2f3e
authored
5月 23, 2022
作者:
Administrator
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/merge_dev' into dev_tzl
上级
25b2b76e
365ce3d6
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
5 行删除
+9
-5
LocationFenceRepository.java
...m/yiring/app/domain/location/LocationFenceRepository.java
+7
-3
PositionMessageServiceImpl.java
.../app/service/message/impl/PositionMessageServiceImpl.java
+2
-2
没有找到文件。
app/src/main/java/com/yiring/app/domain/location/LocationFenceRepository.java
浏览文件 @
767f2f3e
...
...
@@ -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
);
}
app/src/main/java/com/yiring/app/service/message/impl/PositionMessageServiceImpl.java
浏览文件 @
767f2f3e
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论