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
cfe92280
authored
Dec 20, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:离线删除设备
parent
834d9e45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 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 @
cfe92280
...
@@ -236,21 +236,28 @@ public class OffBedAlarm implements IAlarm {
...
@@ -236,21 +236,28 @@ public class OffBedAlarm implements IAlarm {
return
;
return
;
}
}
LocalTime
localTime
=
LocalTime
.
now
().
plusHours
(
7
);
LocalTime
localTime
=
LocalTime
.
now
().
plusHours
(
6
);
if
(!
isInTime
&&
localTime
.
isAfter
(
startTime
)
&&
localTime
.
isBefore
(
endTime
))
{
if
(!
isInTime
&&
localTime
.
isAfter
(
startTime
)
&&
localTime
.
isBefore
(
endTime
))
{
LocalDateTime
dateTime
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
startTime
);
LocalDateTime
dateTime
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
startTime
);
long
mills
=
Duration
.
between
(
dateTime
,
currentTime
()).
toMillis
()
/
1000
;
long
mills
=
Duration
.
between
(
dateTime
,
currentTime
()).
toMillis
()
/
1000
;
if
(
mills
>=
86400
)
{
if
(
mills
>=
86400
)
{
log
.
info
(
"uncross离床告警第一次离床时间在范围前,跨天了:mills:{}"
,
mills
);
mills
=
mills
-
86400
;
mills
=
mills
-
86400
;
}
}
if
(
mills
<=
-
86400
)
{
log
.
info
(
"uncross离床告警第一次离床时间在范围前,跨天了:mills:{}"
,
mills
);
mills
=
mills
+
86400
;
}
boolean
noInOverTime
=
mills
>=
duration
*
60
;
boolean
noInOverTime
=
mills
>=
duration
*
60
;
if
(
noInOverTime
)
{
if
(
noInOverTime
)
{
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
currentTimeMillis
-
firstOffBedLong
));
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
currentTimeMillis
-
firstOffBedLong
));
log
.
info
(
"deviceId:{},uncross离床告警第一次离床时间在范围前,配置:{},date:{},mills:{}"
,
deviceId
,
config
.
getRuleConfig
(),
dateTime
,
mills
);
log
.
info
(
"deviceId:{},uncross离床告警第一次离床时间在范围前,配置:{},date:{},mills:{},first:{}"
,
deviceId
,
config
.
getRuleConfig
(),
dateTime
,
mills
,
firstTime
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
}
else
{
}
else
{
log
.
info
(
"deviceId:{},uncross离床告警第一次离床时间在范围前,未预警,配置:{}"
,
deviceId
,
config
.
getRuleConfig
());
log
.
info
(
"deviceId:{},uncross离床告警第一次离床时间在范围前,未预警,配置:{},间隔:{},first:{}"
,
deviceId
,
config
.
getRuleConfig
(),
mills
,
firstTime
);
}
}
}
else
{
}
else
{
log
.
info
(
"deviceId:{},UnCrossDay 未满足预警条件!fis:{},config:{}"
,
deviceId
,
firstTime
,
config
.
getRuleConfig
());
log
.
info
(
"deviceId:{},UnCrossDay 未满足预警条件!fis:{},config:{}"
,
deviceId
,
firstTime
,
config
.
getRuleConfig
());
...
@@ -327,7 +334,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -327,7 +334,7 @@ public class OffBedAlarm implements IAlarm {
}
}
private
static
LocalDateTime
currentTime
()
{
private
static
LocalDateTime
currentTime
()
{
return
LocalDateTime
.
now
().
plusHours
(
7
);
return
LocalDateTime
.
now
().
plusHours
(
6
);
// return LocalDateTime.now();
// return LocalDateTime.now();
}
}
...
...
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