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
820ffaaa
authored
Sep 25, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:log
parent
6e9fb814
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderSleepServiceImpl.java
server-service/src/main/java/com/makeit/task/IotSyncTask.java
server-web/src/main/resources/logback-spring.xml
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderSleepServiceImpl.java
View file @
820ffaaa
...
...
@@ -143,6 +143,8 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
continue
;
}
String
tenantId
=
elder
.
getTenantId
();
String
reportStartTime
=
""
;
String
reportEndTime
=
""
;
for
(
String
hourRange
:
dayHourRangeList
)
{
String
[]
hourRangeArray
=
hourRange
.
split
(
"~"
);
List
<
DeviceOperationLogEntity
>
deviceOperationLogEntities
=
productDeviceService
.
getDeviceLogByTimeRange
(
platRoomBedDevice
.
getDeviceId
(),
"reportProperty"
,
5000
,
hourRangeArray
[
0
],
hourRangeArray
[
1
]);
...
...
@@ -163,7 +165,13 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
List
<
DeviceInfoContentBreathe
>
deviceInfoContentBreathes
;
// 统计每小时的体动和翻身
Map
<
String
,
AnalysisVO
>
statisticsMap
=
Maps
.
newHashMap
();
for
(
Map
.
Entry
<
String
,
List
<
DeviceInfoContentBreathe
>>
entry
:
minuteMap
.
entrySet
())
{
if
(
StringUtils
.
isEmpty
(
reportStartTime
))
{
reportStartTime
=
entry
.
getKey
();
}
reportEndTime
=
entry
.
getKey
();
deviceInfoContentBreathes
=
entry
.
getValue
();
DeviceInfoContentBreathe
.
Properties
breatheProperties
;
Integer
bodymove
;
...
...
@@ -453,12 +461,19 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
}
int
timeHourRange
=
24
;
if
(
StringUtils
.
isNotEmpty
(
reportStartTime
)
&&
StringUtils
.
isNotEmpty
(
reportEndTime
))
{
Long
durationRange
=
getDurationRange
(
reportStartTime
,
reportEndTime
);
timeHourRange
=
(
int
)
(
durationRange
/
60
);
}
// 判断是否满足配置的呼吸心率异常类型
BigDecimal
dayBrStopRate
=
brStopCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
24
).
divide
(
new
BigDecimal
(
brStopCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayBrSlowRate
=
brSlowCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
24
).
divide
(
new
BigDecimal
(
brSlowCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayBrFastRate
=
brFastCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
24
).
divide
(
new
BigDecimal
(
brFastCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayHrFastRate
=
hrFastCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
24
).
divide
(
new
BigDecimal
(
hrFastCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayHrSlowRate
=
hrSlowCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
24
).
divide
(
new
BigDecimal
(
hrSlowCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayBrStopRate
=
brStopCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
timeHourRange
).
divide
(
new
BigDecimal
(
brStopCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayBrSlowRate
=
brSlowCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
timeHourRange
).
divide
(
new
BigDecimal
(
brSlowCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayBrFastRate
=
brFastCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
timeHourRange
).
divide
(
new
BigDecimal
(
brFastCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayHrFastRate
=
hrFastCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
timeHourRange
).
divide
(
new
BigDecimal
(
hrFastCount
),
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
dayHrSlowRate
=
hrSlowCount
==
0
?
BigDecimal
.
ZERO
:
new
BigDecimal
(
timeHourRange
).
divide
(
new
BigDecimal
(
hrSlowCount
),
2
,
RoundingMode
.
HALF_UP
);
boolean
brStopFlag
=
false
;
boolean
brFastFlag
=
false
;
...
...
@@ -537,8 +552,8 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
// 插入呼吸分析表
PlatElderBreatheAnalysis
platElderBreatheAnalysis
=
new
PlatElderBreatheAnalysis
();
platElderBreatheAnalysis
.
setElderId
(
elder
.
getId
());
platElderBreatheAnalysis
.
setAvgBreatheRate
(
String
.
valueOf
(
dayTotalBr
/
86400
));
platElderBreatheAnalysis
.
setAvgHeartRate
(
String
.
valueOf
(
dayTotalHr
/
86400
));
platElderBreatheAnalysis
.
setAvgBreatheRate
(
String
.
valueOf
(
dayTotalBr
/
(
timeHourRange
*
60
*
60
)
));
platElderBreatheAnalysis
.
setAvgHeartRate
(
String
.
valueOf
(
dayTotalHr
/
(
timeHourRange
*
60
*
60
)
));
platElderBreatheAnalysis
.
setBreatheScore
(
finalReport
.
getScore
());
platElderBreatheAnalysis
.
setHappenDate
(
currentDate
);
platElderBreatheAnalysis
.
setTenantId
(
tenantId
);
...
...
server-service/src/main/java/com/makeit/task/IotSyncTask.java
View file @
820ffaaa
...
...
@@ -91,15 +91,6 @@ public class IotSyncTask {
}
@Scheduled
(
cron
=
"0 0 */1 * * ?"
)
public
void
syncDeviceLog
()
{
log
.
info
(
"开始同步设备日志"
);
log
.
info
(
"同步设备日志结束"
);
}
private
Collection
<
PlatDevice
>
convertToPlatDevice
(
List
<
DeviceInstanceEntity
>
iotDeviceList
,
List
<
PlatDevice
>
deviceList
,
String
tenantId
,
Map
<
String
,
String
>
dicNameIdMap
)
{
Map
<
String
,
PlatDevice
>
deviceMap
=
deviceList
.
stream
().
collect
(
Collectors
.
toMap
(
PlatDevice:
:
getOriDeviceId
,
v
->
v
,
(
a
,
b
)
->
a
));
iotDeviceList
.
forEach
(
iotDevice
->
{
...
...
server-web/src/main/resources/logback-spring.xml
View file @
820ffaaa
This diff is collapsed.
Click to expand it.
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