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
21882d5b
authored
Dec 25, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:bug修复
parent
8d009a5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderBreatheAnalysisServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderBreatheAnalysisServiceImpl.java
View file @
21882d5b
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DatePattern;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
...
...
@@ -93,7 +94,9 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
public
List
<
PlatElderBreatheAnalysis
>
elderHeartRespiratoryAnalysisTask
(
Integer
month
,
Integer
day
)
{
// 12-06,12-18 12-07、 12-12(70分)
LocalDate
nowDate
=
LocalDate
.
now
();
// LocalDate nowDate = LocalDate.of(2023, month, day);
if
(
month
!=
null
&&
day
!=
null
)
{
nowDate
=
LocalDate
.
of
(
2023
,
month
,
day
);
}
LocalDate
yesDate
=
nowDate
.
minusDays
(
1
);
LocalDateTime
yesStart
=
LocalDateTimeUtils
.
getDayStart
(
yesDate
);
...
...
@@ -120,6 +123,11 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
.
orderByDesc
(
BaseEntity:
:
getCreateBy
)
.
last
(
"limit 1"
));
Map
<
String
,
PlatElderBreatheAnalysis
>
analysisMap
=
StreamUtil
.
toMapDep
(
platElderBreatheAnalysisService
.
list
(
Wrappers
.<
PlatElderBreatheAnalysis
>
lambdaQuery
()
.
in
(
PlatElderBreatheAnalysis:
:
getElderId
,
elderIdList
)
.
eq
(
PlatElderBreatheAnalysis:
:
getHappenDate
,
yesDate
).
last
(
"limit 1"
)),
PlatElderBreatheAnalysis:
:
getElderId
);
// 呼吸率
int
breatheThresholdMin
=
Integer
.
parseInt
(
analysisModel
.
getBreatheThresholdMin
());
int
breatheThresholdMax
=
Integer
.
parseInt
(
analysisModel
.
getBreatheThresholdMax
());
...
...
@@ -443,9 +451,15 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
platElderBreatheAnalysis
.
setHappenDate
(
String
.
valueOf
(
yesDate
));
platElderBreatheAnalysis
.
setTenantId
(
platElder
.
getTenantId
());
platElderBreatheAnalysis
.
setBreatheEvaluate
(
diseaseReport
==
null
?
""
:
diseaseReport
.
getEvaluate
());
platElderBreatheAnalysisService
.
save
(
platElderBreatheAnalysis
);
// platElderBreatheAnalysis.setRemake(String.format("normalFlag:%s,hrFastFlag:%s,brStopFlag:%s,brFastFlag:%s,brSlowFlag:%s,hrSlowFlag:%s",
// normalFlag, hrFastFlag, brStopFlag, brFastFlag, brSlowFlag, hrSlowFlag));
// 修复数据
PlatElderBreatheAnalysis
breatheAnalysis
=
analysisMap
.
get
(
platElder
.
getId
());
if
(
breatheAnalysis
!=
null
)
{
platElderBreatheAnalysis
.
setId
(
breatheAnalysis
.
getId
());
platElderBreatheAnalysisService
.
updateById
(
platElderBreatheAnalysis
);
}
else
{
platElderBreatheAnalysisService
.
save
(
platElderBreatheAnalysis
);
}
result
.
add
(
platElderBreatheAnalysis
);
}
...
...
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