Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
05a5010f
提交
05a5010f
authored
5月 14, 2022
作者:
方治民
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'dev_fzm' 到 'merge_dev'
feat: 新增实时统计区域内标签、接口文档使用不当问题修复 查看合并请求 chemical-kesai/kshg-api!25
上级
8edc9c05
8eb5c9fe
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
38 行增加
和
14 行删除
+38
-14
District.java
...rc/main/java/com/yiring/app/domain/district/District.java
+9
-0
PositionMessageServiceImpl.java
.../app/service/message/impl/PositionMessageServiceImpl.java
+16
-8
HistoryRouteVo.java
...va/com/yiring/app/vo/analysis/history/HistoryRouteVo.java
+2
-1
LocationFenceVo.java
...ava/com/yiring/app/vo/location/fence/LocationFenceVo.java
+2
-1
AccidentSpotVo.java
...main/java/com/yiring/app/vo/rehearsal/AccidentSpotVo.java
+2
-1
RehearsalPlanController.java
...com/yiring/app/web/rehearsal/RehearsalPlanController.java
+7
-3
没有找到文件。
app/src/main/java/com/yiring/app/domain/district/District.java
浏览文件 @
05a5010f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
domain
.
district
;
import
com.yiring.app.domain.location.LocationTag
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.HashSet
;
import
java.util.Set
;
import
javax.persistence.*
;
import
lombok.*
;
import
lombok.experimental.FieldNameConstants
;
...
...
@@ -75,4 +78,10 @@ public class District implements Serializable {
@Comment
(
value
=
"是否删除"
)
@Column
(
nullable
=
false
)
Boolean
deleted
;
@ToString
.
Exclude
@Comment
(
"区域中的标签集合"
)
@Builder
.
Default
@ManyToMany
(
fetch
=
FetchType
.
LAZY
)
Set
<
LocationTag
>
tags
=
new
HashSet
<>(
0
);
}
app/src/main/java/com/yiring/app/service/message/impl/PositionMessageServiceImpl.java
浏览文件 @
05a5010f
...
...
@@ -223,13 +223,7 @@ public class PositionMessageServiceImpl implements PositionMessageService {
turnovers
.
add
(
turnover
);
// 更新围栏内的标签
Set
<
LocationTag
>
tags
=
fence
.
getTags
();
if
(
Boolean
.
TRUE
.
equals
(
isEnter
))
{
tags
.
add
(
id
.
getTag
());
}
else
{
tags
.
remove
(
id
.
getTag
());
}
fence
.
setTags
(
tags
);
fence
.
setTags
(
resetInTags
(
tag
,
isEnter
,
fence
.
getTags
()));
// 有人员进出围栏,需要检查是否触发围栏报警规则
// TODO: 通过定时任务调度异步实现,提高定位消息消费能力
// 1. 判断是否触发围栏报警规则,触发则记录报警记录,同时记录报警记录触发所需推送的消息
...
...
@@ -276,6 +270,9 @@ public class PositionMessageServiceImpl implements PositionMessageService {
.
isLatest
(
true
)
.
build
();
turnovers
.
add
(
turnover
);
// 更新区域内的标签
district
.
setTags
(
resetInTags
(
tag
,
isEnter
,
district
.
getTags
()));
}
}
}
...
...
@@ -291,8 +288,10 @@ public class PositionMessageServiceImpl implements PositionMessageService {
tag
.
setSilent
(
locationLog
.
getSilent
());
locationTagRepository
.
save
(
tag
);
// 更新围栏
记录
的标签数据
// 更新围栏
内
的标签数据
locationFenceRepository
.
saveAll
(
fences
);
// 更新区域内的标签数据
districtRepository
.
saveAll
(
districts
);
// 写入围栏/区域进出记录
locationTurnoverRepository
.
saveAll
(
turnovers
);
...
...
@@ -396,6 +395,15 @@ public class PositionMessageServiceImpl implements PositionMessageService {
}
}
public
Set
<
LocationTag
>
resetInTags
(
LocationTag
tag
,
Boolean
enter
,
Set
<
LocationTag
>
tags
)
{
if
(
Boolean
.
TRUE
.
equals
(
enter
))
{
tags
.
add
(
tag
);
}
else
{
tags
.
remove
(
tag
);
}
return
tags
;
}
/**
* 处理低电量报警消息
* @param data 消息内容
...
...
app/src/main/java/com/yiring/app/vo/analysis/history/HistoryRouteVo.java
浏览文件 @
05a5010f
...
...
@@ -14,13 +14,14 @@ import lombok.NoArgsConstructor;
import
org.locationtech.jts.geom.Point
;
/**
* 历史轨迹信息VO
* @author tml
* @version 1.0
* @date 2022/5/6 14:18
*/
@Data
@Builder
@ApiModel
(
"
历史轨迹信息VO
"
)
@ApiModel
(
"
HistoryRouteVo
"
)
@NoArgsConstructor
@AllArgsConstructor
public
class
HistoryRouteVo
implements
Serializable
{
...
...
app/src/main/java/com/yiring/app/vo/location/fence/LocationFenceVo.java
浏览文件 @
05a5010f
...
...
@@ -20,11 +20,12 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
/**
* 围栏信息VO
* @author tml
* @version 1.0
* @date 2022/4/28 11:07
*/
@ApiModel
(
"
围栏信息VO
"
)
@ApiModel
(
"
LocationFenceVo
"
)
@Data
@Builder
@AllArgsConstructor
...
...
app/src/main/java/com/yiring/app/vo/rehearsal/AccidentSpotVo.java
浏览文件 @
05a5010f
...
...
@@ -15,6 +15,7 @@ import lombok.NoArgsConstructor;
import
org.locationtech.jts.geom.Geometry
;
/**
* 事故点VO
* @author tml
* @version 1.0
* @date 2022/5/7 11:25
...
...
@@ -23,7 +24,7 @@ import org.locationtech.jts.geom.Geometry;
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"
事故点VO
"
)
@ApiModel
(
"
AccidentSpotVo
"
)
public
class
AccidentSpotVo
implements
Serializable
{
@Serial
...
...
app/src/main/java/com/yiring/app/web/rehearsal/RehearsalPlanController.java
浏览文件 @
05a5010f
...
...
@@ -19,6 +19,7 @@ import com.yiring.common.param.PageParam;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
...
...
@@ -28,6 +29,7 @@ import javax.validation.Valid;
import
org.locationtech.jts.geom.Geometry
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.http.MediaType
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
/**
...
...
@@ -35,8 +37,10 @@ import org.springframework.web.bind.annotation.*;
* @version 1.0
* @date 2022/5/10 14:08
*/
@Validated
@SuppressWarnings
({
"deprecation"
})
@Api
(
tags
=
"演练计划"
,
description
=
"RehearsalPlan"
)
@RestController
@Api
(
tags
=
"RehearsalPlan(演练计划)"
)
@RequestMapping
(
"/rehearsal/plan"
)
public
class
RehearsalPlanController
{
...
...
@@ -123,11 +127,11 @@ public class RehearsalPlanController {
}
@GetMapping
(
"/get"
)
public
List
<
LocationTag
>
get
()
{
public
Result
<
ArrayList
<
LocationTag
>
>
get
()
{
Optional
<
AccidentSpot
>
optional
=
accidentSpotRepository
.
findById
(
1524292027951353856L
);
Geometry
geometry
=
optional
.
get
().
getGeometry
();
List
<
LocationTag
>
inArea
=
locationTagRepository
.
findInArea
(
geometry
);
System
.
out
.
println
(
inArea
);
return
inArea
;
return
Result
.
ok
(
new
ArrayList
<>(
inArea
))
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论