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
eb151a19
authored
Dec 20, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:模拟测试时间
parent
7ace2a21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 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 @
eb151a19
...
@@ -57,12 +57,8 @@ public class OffBedAlarm implements IAlarm {
...
@@ -57,12 +57,8 @@ public class OffBedAlarm implements IAlarm {
log
.
error
(
"离床告警心率设备未关联长者,设备plat_id:"
+
platAlarmCheckDTO
.
getPlatDevice
().
getId
());
log
.
error
(
"离床告警心率设备未关联长者,设备plat_id:"
+
platAlarmCheckDTO
.
getPlatDevice
().
getId
());
return
;
return
;
}
}
if
(!
platDevice
.
getId
().
equals
(
"1732609639364812805"
)){
return
;
}
PlatAlarmConfig
config
=
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
(),
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
OFF_BED
.
getValue
());
PlatAlarmConfig
config
=
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
(),
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
OFF_BED
.
getValue
());
offBedCheckAlarm
(
config
,
platAlarmCheckDTO
,
platDevice
);
offBedCheckAlarm
(
config
,
platAlarmCheckDTO
,
platDevice
);
}
}
...
@@ -75,7 +71,6 @@ public class OffBedAlarm implements IAlarm {
...
@@ -75,7 +71,6 @@ public class OffBedAlarm implements IAlarm {
// log.error("离床告警配置为禁用,告警配置id:" + config.getId());
// log.error("离床告警配置为禁用,告警配置id:" + config.getId());
return
;
return
;
}
}
// String ruleConfigStr = "{\"offBedStart\":\"23:07:00\",\"offBedEnd\":\"00:00:00\",\"duration\":\"1\"}";
String
ruleConfigStr
=
config
.
getRuleConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
if
(
StringUtils
.
isBlank
(
ruleConfigStr
))
{
if
(
StringUtils
.
isBlank
(
ruleConfigStr
))
{
// log.error("离床告警配置未配置,告警配置id:" + config.getId());
// log.error("离床告警配置未配置,告警配置id:" + config.getId());
...
@@ -241,11 +236,10 @@ public class OffBedAlarm implements IAlarm {
...
@@ -241,11 +236,10 @@ public class OffBedAlarm implements IAlarm {
return
;
return
;
}
}
LocalDateTime
now
=
currentTime
();
LocalTime
localTime
=
LocalTime
.
now
().
plusHours
(
7
).
plusMinutes
(
30
);
LocalTime
localTime
=
LocalTime
.
now
().
plusHours
(
8
);
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
,
now
).
toMillis
()
/
1000
;
long
mills
=
Duration
.
between
(
dateTime
,
currentTime
()
).
toMillis
()
/
1000
;
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
));
...
@@ -330,7 +324,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -330,7 +324,7 @@ public class OffBedAlarm implements IAlarm {
}
}
private
static
LocalDateTime
currentTime
()
{
private
static
LocalDateTime
currentTime
()
{
return
LocalDateTime
.
now
().
plusHours
(
8
);
return
LocalDateTime
.
now
().
plusHours
(
7
).
plusMinutes
(
30
);
// 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