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
5876dfe0
authored
Sep 25, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:睡眠问题修复V1
parent
4086e9d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderSleepServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderSleepServiceImpl.java
View file @
5876dfe0
...
...
@@ -116,6 +116,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
int
sleepDeepActionThreshold
=
Integer
.
parseInt
(
analysisModel
.
getSleepDeepActionThreshold
());
int
sleepDeepActionTimeBegin
=
Integer
.
parseInt
(
analysisModel
.
getSleepDeepActionTimeBegin
());
int
sleepDeepBreatheMin
=
Integer
.
parseInt
(
analysisModel
.
getSleepDeepBreatheMin
());
int
sleepDeepBreatheMax
=
Integer
.
parseInt
(
analysisModel
.
getSleepDeepBreatheMax
());
...
...
@@ -696,7 +697,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
String
startSleepMidTime
=
null
;
// 入睡时间开始
for
(
Map
.
Entry
<
String
,
AnalysisVO
>
entry
:
totalMap
.
entrySet
())
{
AnalysisVO
analysisVO
=
entry
.
getValue
();
if
(
analysisVO
.
getActionCount
()
<
sleep
DeepActionThreshold
&&
analysisVO
.
getTurnedCount
()
<
sleepDeep
ActionThreshold
)
{
if
(
analysisVO
.
getActionCount
()
<
sleep
ModerateActionThreshold
&&
analysisVO
.
getTurnedCount
()
<
sleepModerate
ActionThreshold
)
{
if
(
StringUtils
.
isEmpty
(
startSleepMidTime
))
{
startSleepMidTime
=
entry
.
getKey
();
}
...
...
@@ -706,7 +707,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
if
(
StringUtils
.
isEmpty
(
startSleepMidTime
)
&&
sleepMidMinute
==
0
)
{
continue
;
}
if
(
sleepMidMinute
>
sleep
Deep
ActionTimeBegin
)
{
if
(
sleepMidMinute
>
sleep
Moderate
ActionTimeBegin
)
{
sleepTimeAnalysisVO
=
new
SleepTimeAnalysisVO
();
sleepTimeAnalysisVO
.
setStartTime
(
startSleepMidTime
);
sleepTimeAnalysisVO
.
setEndTime
(
entry
.
getKey
());
...
...
@@ -966,7 +967,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
elderSleepAnalysis
.
setActionCount
(
totalActionCount
);
elderSleepAnalysis
.
setTurnedCount
(
totalTurnedCount
);
elderSleepAnalysis
.
setHappenDate
(
currentDate
);
elderSleepAnalysis
.
setSleepScore
(
sleepReport
.
getResult
(
));
elderSleepAnalysis
.
setSleepScore
(
String
.
valueOf
(
totalScore
));
elderSleepAnalysis
.
setSleepTime
(
String
.
valueOf
(
sleepTime
));
int
minuteDay
=
24
*
60
;
// TODO 休息时间 先用一天时间 - 睡觉时间
...
...
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