Commit 5876dfe0 by huangjy

fix:睡眠问题修复V1

parent 4086e9d9
......@@ -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() < sleepDeepActionThreshold && analysisVO.getTurnedCount() < sleepDeepActionThreshold) {
if (analysisVO.getActionCount() < sleepModerateActionThreshold && analysisVO.getTurnedCount() < sleepModerateActionThreshold) {
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 > sleepDeepActionTimeBegin) {
if (sleepMidMinute > sleepModerateActionTimeBegin) {
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 休息时间 先用一天时间 - 睡觉时间
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment