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
6626bf8b
authored
Jan 30, 2024
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:bug修改
parent
b6efebe9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 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 @
6626bf8b
...
...
@@ -128,16 +128,16 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
noPersonCount
++;
isMoveBed
=
true
;
awakeMinuteActionFlag
=
true
;
continue
;
//
continue;
}
// 0和255直接跳过
if
(
breatheProperties
.
getHr
()
==
255
||
breatheProperties
.
getHr
()
==
0
)
{
noPersonCount
++;
continue
;
//
continue;
}
if
(
breatheProperties
.
getBr
()
==
255
||
breatheProperties
.
getBr
()
==
0
)
{
noPersonCount
++;
continue
;
//
continue;
}
if
(
bodyMove
>
actionThreshold
)
{
bodymoveCount
++;
...
...
@@ -179,9 +179,9 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
hrBrCount
++;
}
}
if
(
reportSize
==
noPersonCount
)
{
continue
;
}
//
if (reportSize == noPersonCount) {
//
continue;
//
}
// 每分钟的数据
analysisVO
.
setTotalBr
(
totalBr
);
analysisVO
.
setAvgBr
(
totalBr
/
reportSize
);
...
...
@@ -461,6 +461,14 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
SleepCountDTO
sleepCountDTO
=
new
SleepCountDTO
();
sleepCountDTO
.
setDaySleepMap
(
daySleepMap
);
sleepCountDTO
.
setRestSleepMap
(
restSleepMap
);
TreeMap
<
String
,
TreeMap
<
String
,
AnalysisVO
>>
allSleepMap
=
new
TreeMap
<>();
if
(
CollUtil
.
isNotEmpty
(
daySleepMap
))
{
allSleepMap
.
putAll
(
daySleepMap
);
}
if
(
CollUtil
.
isNotEmpty
(
restSleepMap
))
{
allSleepMap
.
putAll
(
restSleepMap
);
}
sleepCountDTO
.
setAllSleepMap
(
allSleepMap
);
return
sleepCountDTO
;
}
...
...
@@ -778,17 +786,14 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
for
(
PlatRoomBedDevice
platRoomBedDevice
:
platRoomBedDeviceList
)
{
TreeMap
<
String
,
AnalysisVO
>
totalMap
=
new
TreeMap
<>();
// if (!"1732647368962203650".equals(platRoomBedDevice.getId())) {
// continue;
// }
String
bedId
=
platRoomBedDevice
.
getBedId
();
PlatElder
elder
=
platElderService
.
getOne
(
new
QueryWrapper
<
PlatElder
>().
lambda
()
.
eq
(
PlatElder:
:
getBedId
,
bedId
));
if
(
elder
==
null
)
{
if
(
elder
==
null
||
!
"1712648603580764161"
.
equals
(
elder
.
getId
())
)
{
continue
;
}
PlatDevice
platDevice
=
platDeviceService
.
getById
(
platRoomBedDevice
.
getDeviceId
());
if
(
platDevice
==
null
)
{
if
(
platDevice
==
null
||
!
"218A00XE2669104"
.
equals
(
platDevice
.
getOriDeviceId
())
)
{
continue
;
}
String
tenantId
=
elder
.
getTenantId
();
...
...
@@ -812,7 +817,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
TreeMap
<
String
,
AnalysisVO
>
statisticsMap
=
getPerMinuteData
(
minuteMap
,
analysisModel
);
if
(
CollUtil
.
isNotEmpty
(
statisticsMap
))
{
//测试环境数据 device_minute_info
// test
LogService.saveEntity(statisticsMap, platRoomBedDevice.getId());
// device
LogService.saveEntity(statisticsMap, platRoomBedDevice.getId());
totalMap
.
putAll
(
statisticsMap
);
}
}
...
...
@@ -831,7 +836,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
// 获取睡眠和小憩
SleepCountDTO
sleepCountDTO
=
deepSleepAndRestData
(
sleepTypeMap
,
analysisModel
,
sleepTimeAnalysisVOList
);
// 满足睡眠条件的map
TreeMap
<
String
,
TreeMap
<
String
,
AnalysisVO
>>
daySleepMap
=
sleepCountDTO
.
get
Day
SleepMap
();
TreeMap
<
String
,
TreeMap
<
String
,
AnalysisVO
>>
daySleepMap
=
sleepCountDTO
.
get
All
SleepMap
();
// 深度睡眠
deepSleepData
(
daySleepMap
,
analysisModel
,
sleepTimeAnalysisVOList
);
// 中度睡眠
...
...
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