Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
814113d5
authored
Dec 14, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
e367ad8f
25d08b5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/FallAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/HeartAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/FallAlarm.java
View file @
814113d5
package
com
.
makeit
.
service
.
platform
.
alarm
.
alarmStrategy
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.makeit.dto.platform.alarm.PlatAlarmCheckDTO
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigBehaviorDTOVO
;
...
...
@@ -61,6 +62,7 @@ public class FallAlarm implements IAlarm {
*/
@Override
public
void
checkConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
log
.
info
(
"跌倒预警config开始"
);
JSONObject
properties
=
platAlarmCheckDTO
.
getProperties
();
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
String
deviceId
=
platDevice
.
getId
();
...
...
@@ -68,7 +70,7 @@ public class FallAlarm implements IAlarm {
properties
=
new
JSONObject
();
}
String
personState
=
Convert
.
toStr
(
properties
.
get
(
"personState"
));
log
.
info
(
"跌倒预警personState:{}"
,
personState
);
//记录停留时长
recordDuration
(
platAlarmCheckDTO
);
...
...
@@ -182,8 +184,10 @@ public class FallAlarm implements IAlarm {
@Override
public
void
notice
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
log
.
info
(
"跌倒预警参数platAlarmCheckDTO:{}"
,
platAlarmCheckDTO
);
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
List
<
PlatElder
>
platElderList
=
platAlarmCheckDTO
.
getPlatElderList
();
log
.
info
(
"跌倒预警长者:{}"
,
JSONUtil
.
toJsonStr
(
platElderList
));
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
if
(
CommonEnum
.
NO
.
getValue
().
equals
(
config
.
getStatus
()))
{
log
.
error
(
"告警配置为禁用,告警配置id:"
+
config
.
getId
());
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/HeartAlarm.java
View file @
814113d5
...
...
@@ -107,7 +107,7 @@ public class HeartAlarm implements IAlarm {
RedisUtil
.
delete
(
RedisConst
.
ALARM_DEVICE_HR_ID
+
deviceId
);
return
;
}
log
.
info
(
"hr:{},end:{},start:{},mes:{}"
,
hr
,
end
,
start
,
messageType
);
if
((
hr
>
end
||
hr
<
start
)
&&
StringUtils
.
equalsAnyIgnoreCase
(
messageType
,
"REPORT_PROPERTY"
))
{
if
(
alarmRedisDTO
==
null
){
alarmRedisDTO
=
new
AlarmRedisDTO
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment