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
eaa4fc32
authored
Dec 14, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:离床预警多个不同config
parent
8be6c5a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
View file @
eaa4fc32
...
@@ -134,7 +134,8 @@ public class OffBedAlarm implements IAlarm {
...
@@ -134,7 +134,8 @@ public class OffBedAlarm implements IAlarm {
boolean
over
=
(
Math
.
abs
(
Duration
.
between
(
LocalDateTime
.
now
(),
startTime
).
toMillis
()))
/
1000
>=
duration
*
60
;
boolean
over
=
(
Math
.
abs
(
Duration
.
between
(
LocalDateTime
.
now
(),
startTime
).
toMillis
()))
/
1000
>=
duration
*
60
;
if
(
over
)
{
if
(
over
)
{
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
localDateLong
-
firstOffBedLong
));
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
localDateLong
-
firstOffBedLong
));
log
.
info
(
"离床告警离床时间在范围前,发送预警"
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
log
.
info
(
"离床告警离床时间在范围前,发送预警,配置:{}"
,
config
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
return
;
return
;
}
}
...
@@ -145,7 +146,8 @@ public class OffBedAlarm implements IAlarm {
...
@@ -145,7 +146,8 @@ public class OffBedAlarm implements IAlarm {
boolean
isInRange
=
LocalDateTime
.
now
().
isAfter
(
startTime
)
&&
LocalDateTime
.
now
().
isBefore
(
endTime
);
boolean
isInRange
=
LocalDateTime
.
now
().
isAfter
(
startTime
)
&&
LocalDateTime
.
now
().
isBefore
(
endTime
);
if
(
isOffBedValid
&&
isInRange
&&
isOverTime
)
{
if
(
isOffBedValid
&&
isInRange
&&
isOverTime
)
{
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
localDateLong
-
firstOffBedLong
));
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
localDateLong
-
firstOffBedLong
));
log
.
info
(
"离床告警离床时间在范围时间内(小于范围结束时间-持续分钟)"
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
log
.
info
(
"离床告警离床时间在范围时间内(小于范围结束时间-持续分钟),配置:{}"
,
config
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
return
;
return
;
}
}
...
...
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