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
a6a112b6
authored
Dec 18, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:bug修复
parent
bd36f727
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
server-web/src/test/java/com/makeit/iotapi/IotDeviceInfoContentFall.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
View file @
a6a112b6
...
@@ -159,10 +159,6 @@ public class OffBedAlarm implements IAlarm {
...
@@ -159,10 +159,6 @@ public class OffBedAlarm implements IAlarm {
LocalTime
endTimeLimit
=
endTime
.
plusMinutes
(-
duration
);
LocalTime
endTimeLimit
=
endTime
.
plusMinutes
(-
duration
);
// 离床时间在范围内
// 离床时间在范围内
if
(
isInTime
&&
isOverTime
)
{
if
(
isInTime
&&
isOverTime
)
{
if
(
firstTime
.
isAfter
(
endTimeLimit
))
{
log
.
info
(
"handleCrossDay 第一次离床时间,{}+持续时间:{}将超过范围,{}"
,
firstTime
,
duration
,
endTime
);
return
;
}
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
currentTimeMillis
-
firstOffBedLong
));
platAlarmCheckDTO
.
setAbnormalValue
(
String
.
valueOf
(
currentTimeMillis
-
firstOffBedLong
));
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
log
.
info
(
"cross离床告警离床时间在范围时间内,配置:{}"
,
config
.
getRuleConfig
());
log
.
info
(
"cross离床告警离床时间在范围时间内,配置:{}"
,
config
.
getRuleConfig
());
...
@@ -198,7 +194,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -198,7 +194,7 @@ public class OffBedAlarm implements IAlarm {
LocalTime
startTime
=
ruleConfig
.
getOffBedStart
();
LocalTime
startTime
=
ruleConfig
.
getOffBedStart
();
LocalDateTime
startLocalDteTime
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
startTime
);
LocalDateTime
startLocalDteTime
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
startTime
);
LocalTime
endTime
=
ruleConfig
.
getOffBedEnd
();
LocalTime
endTime
=
ruleConfig
.
getOffBedEnd
();
LocalDateTime
endLocalDteTime
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
endTime
);
//
LocalDateTime endLocalDteTime = LocalDateTime.of(LocalDate.now(), endTime);
Long
firstOffBedLong
=
alarmRedisDTO
.
getStartLong
();
Long
firstOffBedLong
=
alarmRedisDTO
.
getStartLong
();
long
currentTimeMillis
=
System
.
currentTimeMillis
();
long
currentTimeMillis
=
System
.
currentTimeMillis
();
...
...
server-web/src/test/java/com/makeit/iotapi/IotDeviceInfoContentFall.java
View file @
a6a112b6
package
com
.
makeit
.
iotapi
;
package
com
.
makeit
.
iotapi
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.makeit.dto.platform.alarm.PlatAlarmCheckDTO
;
import
com.makeit.dto.platform.alarm.PlatAlarmCheckDTO
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.module.admin.vo.plat.PlatTenantVO
;
import
com.makeit.module.admin.vo.plat.PlatTenantVO
;
...
@@ -89,6 +91,14 @@ public class IotDeviceInfoContentFall {
...
@@ -89,6 +91,14 @@ public class IotDeviceInfoContentFall {
platDevice
.
setOrgId
(
"1712384736845950978"
);
platDevice
.
setOrgId
(
"1712384736845950978"
);
platDevice
.
setId
(
"1732609639364812811"
);
platDevice
.
setId
(
"1732609639364812811"
);
platAlarmCheckDTO
.
setPlatDevice
(
platDevice
);
platAlarmCheckDTO
.
setPlatDevice
(
platDevice
);
JSONObject
properties
=
JSON
.
parseObject
(
"{\n"
+
" \"person\": 0,\n"
+
" \"personState\": 0,\n"
+
" \"distance\": 50,\n"
+
" \"hr\": 80,\n"
+
" \"br\": 20,\n"
+
" \"bodymove\": 50,\n}"
);
platAlarmCheckDTO
.
setProperties
(
properties
);
offBedAlarm
.
checkConfig
(
platAlarmCheckDTO
);
offBedAlarm
.
checkConfig
(
platAlarmCheckDTO
);
}
}
}
}
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