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
2d7409d4
authored
Sep 27, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改bug
parent
f347682c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 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 @
2d7409d4
...
...
@@ -211,18 +211,18 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
return
;
}
Integer
sleepTimeActionDuration
=
Integer
.
valueOf
(
analysisModel
.
getSleepTimeActionDuration
()
+
""
);
Integer
sleepTimeActionThreshold
=
Integer
.
valueOf
(
analysisModel
.
getSleepTimeActionThreshold
()
+
""
);
BigDecimal
sleepTimeActionDuration
=
new
BigDecimal
(
analysisModel
.
getSleepTimeActionDuration
()
+
""
);
BigDecimal
sleepTimeActionThreshold
=
new
BigDecimal
(
analysisModel
.
getSleepTimeActionThreshold
()
+
""
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
start
=
now
.
minus
Hours
(
sleepTimeActionDuration
);
LocalDateTime
start
=
now
.
minus
Minutes
(
sleepTimeActionDuration
.
multiply
(
new
BigDecimal
(
60
).
setScale
(
0
,
RoundingMode
.
HALF_UP
)).
intValue
()
);
PlatDevice
platDevice
=
getBreathDevice
(
platElderIdDTO
.
getElderId
(),
platElderIdDTO
.
getDeviceId
());
List
<
DeviceInfoContentBreathe
>
breatheList
=
iotProductDeviceService
.
getDeviceLogByTimeRangeBreathe
(
platDevice
.
getOriDeviceId
(),
2
*
24
*
3600
,
start
,
now
);
if
(
CollectionUtils
.
isNotEmpty
(
breatheList
))
{
if
(
StreamUtil
.
allMatch
(
breatheList
,
e
->
e
.
getProperties
().
getBodymove
()
<
sleepTimeActionThreshold
))
{
if
(
StreamUtil
.
allMatch
(
breatheList
,
e
->
new
BigDecimal
(
e
.
getProperties
().
getBodymove
()).
compareTo
(
sleepTimeActionThreshold
)
<=
0
))
{
platElderRealTimeNowVO
.
setStatus
(
PlatElderRealtimeReportEnum
.
NowStatus
.
SLEEP
.
getValue
());
}
}
...
...
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