Commit a9dca663 by 杨伟程

老人报表更新

parent c304eff3
......@@ -6,12 +6,11 @@ import com.makeit.dto.platform.elder.PlatElderReportDTO;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.platform.elder.PlatElderBreatheAnalysis;
import com.makeit.entity.platform.elder.PlatElderBreatheDayStat;
import com.makeit.entity.platform.elder.PlatElderSleep;
import com.makeit.entity.platform.elder.PlatElderSleepAnalysis;
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.service.platform.elder.*;
import com.makeit.service.saas.SaasDiseaseReportService;
import com.makeit.service.saas.SaasElderReportConfigService;
import com.makeit.service.saas.SaasSleepEvaluateReportService;
import com.makeit.utils.data.convert.BeanDtoVoUtils;
......@@ -25,7 +24,6 @@ import com.makeit.vo.platform.elder.report.week.PlatElderComprehensiveEvaluation
import com.makeit.vo.platform.elder.report.week.PlatElderRealTimeHeartRespiratoryWeekVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import java.time.DayOfWeek;
import java.time.LocalDate;
......@@ -52,6 +50,9 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
private SaasSleepEvaluateReportService saasSleepEvaluateReportService;
@Autowired
private SaasDiseaseReportService saasDiseaseReportService;
@Autowired
private SaasElderReportConfigService saasElderReportConfigService;
@Autowired
......@@ -152,8 +153,8 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
List<PlatElderSleepAnalysis> sleepAnalysisList = platElderSleepAnalysisService.list(new QueryWrapper<PlatElderSleepAnalysis>().lambda()
.ge(PlatElderSleepAnalysis::getCurrentDate, dateTimeFormatter.format(weekStartDate))
.le(PlatElderSleepAnalysis::getCurrentDate, dateTimeFormatter.format(weekEndDate))
.ge(PlatElderSleepAnalysis::getHappenDate, dateTimeFormatter.format(weekStartDate))
.le(PlatElderSleepAnalysis::getHappenDate, dateTimeFormatter.format(weekEndDate))
);
int score = 0;
......@@ -192,8 +193,8 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
List<PlatElderBreatheAnalysis> breatheAnalyses = platElderBreatheAnalysisService.list(new QueryWrapper<PlatElderBreatheAnalysis>().lambda()
.ge(PlatElderBreatheAnalysis::getCurrentDate, dateTimeFormatter.format(weekStartDate))
.le(PlatElderBreatheAnalysis::getCurrentDate, dateTimeFormatter.format(weekEndDate))
.ge(PlatElderBreatheAnalysis::getHappenDate, dateTimeFormatter.format(weekStartDate))
.le(PlatElderBreatheAnalysis::getHappenDate, dateTimeFormatter.format(weekEndDate))
);
int score = 0;
......@@ -202,14 +203,16 @@ public class PlatElderDayReportWeekServiceImpl implements PlatElderDayReportWeek
score = StreamUtil.reduce(breatheAnalyses, e -> Integer.valueOf(e.getBreatheScore() + ""), 0, Integer::sum) / breatheAnalyses.size();
}
PlatElderHeartRespiratoryEvaluationVO platElderSleepEvaluationVO = new PlatElderHeartRespiratoryEvaluationVO();
platElderSleepEvaluationVO.setScore(score);
PlatElderHeartRespiratoryEvaluationVO platElderHeartRespiratoryEvaluationVO = new PlatElderHeartRespiratoryEvaluationVO();
platElderHeartRespiratoryEvaluationVO.setScore(score);
//TODO ywc 缺这两个
//platElderSleepEvaluationVO.setResult();
//platElderSleepEvaluationVO.setEvaluation();
EvaluateReportVO evaluateReportVO = saasDiseaseReportService.getByScore(platElderHeartRespiratoryEvaluationVO.getScore());
if (evaluateReportVO != null) {
platElderHeartRespiratoryEvaluationVO.setResult(evaluateReportVO.getResult());
platElderHeartRespiratoryEvaluationVO.setEvaluation(evaluateReportVO.getEvaluate());
}
return platElderSleepEvaluationVO;
return platElderHeartRespiratoryEvaluationVO;
}
......
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