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
a691ab18
authored
Oct 12, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 无人直接返回0
parent
b8fa3031
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderRealTimeServiceImpl.java
View file @
a691ab18
...
...
@@ -360,10 +360,19 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
String
result
=
redisTemplate
.
opsForValue
().
get
(
DEVICE_BR_DATA
+
platDevice
.
getOriDeviceId
());
if
(
result
!=
null
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
vo
.
setTime
(
LocalDateTime
.
now
());
vo
.
setHeartRate
(
Integer
.
valueOf
(
jsonObject
.
getString
(
"hr"
)));
vo
.
setRespiratoryRate
(
Integer
.
valueOf
(
jsonObject
.
getString
(
"br"
)));
vo
.
setBody
(
Integer
.
valueOf
(
jsonObject
.
getString
(
"bodymove"
)));
String
person
=
jsonObject
.
getString
(
"person"
);
log
.
info
(
"当前人员人员状态:{}"
,
person
);
if
(
StringUtils
.
equals
(
person
,
"0"
))
{
vo
.
setTime
(
LocalDateTime
.
now
());
vo
.
setHeartRate
(
0
);
vo
.
setRespiratoryRate
(
0
);
vo
.
setBody
(
0
);
}
else
{
vo
.
setTime
(
LocalDateTime
.
now
());
vo
.
setHeartRate
(
Integer
.
valueOf
(
jsonObject
.
getString
(
"hr"
)));
vo
.
setRespiratoryRate
(
Integer
.
valueOf
(
jsonObject
.
getString
(
"br"
)));
vo
.
setBody
(
Integer
.
valueOf
(
jsonObject
.
getString
(
"bodymove"
)));
}
return
vo
;
}
...
...
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