Commit e38e0d05 by 汪志阳

fix:睡眠日报评语修改

parent b9813778
package com.makeit.module.iot.vo.analysis;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class SaasSleepEvaluateStandardReportVO {
@ApiModelProperty("深睡")
private Long deepScore;
@ApiModelProperty("浅睡")
private Long lightScore;
@ApiModelProperty("清醒")
private Long soberScore;
@ApiModelProperty("睡眠")
private Long sleepScore;
@ApiModelProperty("总得分")
private Long totalScore;
......
......@@ -176,6 +176,7 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
}
reportEndTime = entry.getKey();
deviceInfoContentBreathes = entry.getValue();
DeviceInfoContentBreathe.Properties breatheProperties;
......@@ -214,6 +215,10 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
if (hasPerson == 0) {
continue;
}
// 0和255设备误报直接跳过
if (hr == 255 || br == 255) {
continue;
}
// 判断呼吸暂停
if (br == 0) {
......@@ -227,7 +232,7 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
}
// 判断呼吸率阈值,记录发生时间和当前呼吸率
if (breatheThresholdMax < br && br != 255) {
if (breatheThresholdMax < br) {
if (brFast == 0) {
brFast = br;
}
......@@ -254,7 +259,7 @@ public class PlatElderBreatheAnalysisServiceImpl extends ServiceImpl<PlatElderBr
}
if (heartThresholdMax < hr && hr != 255) {
if (heartThresholdMax < hr) {
if (hrFast == 0) {
hrFast = br;
}
......
......@@ -7,16 +7,21 @@ import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.entity.platform.alarm.PlatAlarmRecord;
import com.makeit.entity.platform.alarm.PlatDayDurationRecord;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.platform.elder.*;
import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.entity.platform.elder.PlatElderBreatheAnalysis;
import com.makeit.entity.platform.elder.PlatElderSleep;
import com.makeit.entity.platform.elder.PlatElderSleepAnalysis;
import com.makeit.enums.CommonEnum;
import com.makeit.enums.platform.alarm.PlatAlarmConfigEnum;
import com.makeit.module.iot.service.IotProductDeviceService;
import com.makeit.module.iot.vo.analysis.EvaluateReportVO;
import com.makeit.module.iot.vo.breathe.DeviceInfoContentBreathe;
import com.makeit.module.iot.vo.fall.DeviceInfoContentFall;
import com.makeit.module.iot.vo.space.DeviceInfoContentSpace;
import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.service.platform.alarm.PlatDayDurationRecordService;
import com.makeit.service.platform.elder.*;
import com.makeit.service.saas.SaasSleepEvaluateReportService;
import com.makeit.utils.LongTimestampUtil;
import com.makeit.utils.data.convert.MathUtil;
import com.makeit.utils.data.convert.StreamUtil;
......@@ -62,7 +67,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
@Autowired
private PlatElderService platElderService;
@Autowired
private PlatElderCoordinateRecordService platElderCoordinateRecordService;
private SaasSleepEvaluateReportService sleepEvaluateReportService;
private static LocalDateTime dayStartNow(LocalDate now) {
return LocalDateTimeUtils.getDayStart(now);
......@@ -110,9 +115,11 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
return platElderSleepEvaluationVO;
}
EvaluateReportVO evaluateReport = sleepEvaluateReportService.getByScore(Long.parseLong(platElderSleepAnalysis.getSleepScore()));
platElderSleepEvaluationVO.setScore(Integer.valueOf(platElderSleepAnalysis.getSleepScore() + ""));
platElderSleepEvaluationVO.setResult(platElderSleepAnalysis.getSleepResult());
platElderSleepEvaluationVO.setEvaluation(platElderSleepAnalysis.getSleepEvaluate());
platElderSleepEvaluationVO.setEvaluation(evaluateReport.getEvaluate());
platElderSleepEvaluationVO.setSleepDuration(Integer.valueOf(platElderSleepAnalysis.getSleepTime() + ""));
platElderSleepEvaluationVO.setRestDuration(Integer.valueOf(platElderSleepAnalysis.getRestTime() + ""));
......
......@@ -754,14 +754,6 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
return time.atTime(0, 0, 0);
}
public static void main(String[] args) {
PlatElderSleepServiceImpl platElderSleepService1 = new PlatElderSleepServiceImpl();
List<String> lastDayHourRange = platElderSleepService1.getLastDayHourRange();
System.out.println();
}
@Override
public void test1() {
int days = 30;
......
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