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
7e54fc62
authored
Dec 28, 2023
by
罗志长
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:入睡、清醒判断
parent
2ab24c2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
server-module/src/main/java/com/makeit/module/controller/elder/PlatElderSleepController.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderSleepServiceImpl.java
server-module/src/main/java/com/makeit/module/controller/elder/PlatElderSleepController.java
View file @
7e54fc62
...
...
@@ -90,6 +90,7 @@ public class PlatElderSleepController {
@ApiOperation
(
"测试"
)
@PostMapping
(
"test5"
)
@AuthIgnore
@TenantIdIgnore
public
ApiResponseEntity
<
Void
>
coordinateRecordTask
()
{
platElderCoordinateRecordService
.
coordinateRecordTask
();
return
ApiResponseUtils
.
success
();
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderSleepServiceImpl.java
View file @
7e54fc62
...
...
@@ -187,8 +187,8 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
boolean
isAction
=
false
;
// 每分钟是否动过
AnalysisVO
analysisVO
=
new
AnalysisVO
();
int
getUpBodymoveCount
=
0
;
boolean
isMoveBed
=
tru
e
;
boolean
awakeMinuteActionFlag
=
tru
e
;
// 清醒每分钟体动是否满足要求
boolean
isMoveBed
=
fals
e
;
boolean
awakeMinuteActionFlag
=
fals
e
;
// 清醒每分钟体动是否满足要求
int
noPersonCount
=
0
;
// 无人跳过计数
int
sleepDeepMinuteCount
=
0
;
// 深睡每分钟体动和翻身次数
...
...
@@ -201,8 +201,9 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
int
hr
=
breatheProperties
.
getHr
();
Integer
hasPerson
=
breatheProperties
.
getPerson
();
// 0无人,1有人
if
(
breatheProperties
.
getPerson
()
==
0
)
{
if
(
hasPerson
==
0
)
{
noPersonCount
++;
isMoveBed
=
true
;
continue
;
}
// 0和255直接跳过
...
...
@@ -222,7 +223,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
turnoverCount
++;
}
// 判断入睡时间的体动阈值
if
(
bodymove
>
sleepTimeActionThreshold
)
{
if
(
bodymove
>
=
sleepTimeActionThreshold
)
{
isAction
=
true
;
}
// 起床每分钟体动次数
...
...
@@ -230,15 +231,10 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
getUpBodymoveCount
++;
}
// 清醒
if
(
bodymove
<
awakeThreshold
||
hasPerson
==
1
)
{
awakeMinuteActionFlag
=
false
;
}
// 判断有没有离开床
if
(
hasPerson
==
1
)
{
isMoveBed
=
false
;
if
(
bodymove
>
awakeThreshold
)
{
awakeMinuteActionFlag
=
true
;
}
if
(
br
>
maxBr
)
{
maxBr
=
br
;
}
...
...
@@ -252,7 +248,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
if
(
hr
<
minHr
)
{
minHr
=
hr
;
}
if
(
breatheProperties
.
getPerson
()
==
1
)
{
if
(
hasPerson
==
1
)
{
totalBr
+=
br
;
totalHr
+=
hr
;
hrBrCount
++;
...
...
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