Commit a9dca663 by 杨伟程

老人报表更新

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