Commit 2d7409d4 by 杨伟程

修改bug

parent f347682c
......@@ -211,18 +211,18 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
return;
}
Integer sleepTimeActionDuration = Integer.valueOf(analysisModel.getSleepTimeActionDuration() + "");
Integer sleepTimeActionThreshold = Integer.valueOf(analysisModel.getSleepTimeActionThreshold() + "");
BigDecimal sleepTimeActionDuration = new BigDecimal(analysisModel.getSleepTimeActionDuration() + "");
BigDecimal sleepTimeActionThreshold = new BigDecimal(analysisModel.getSleepTimeActionThreshold() + "");
LocalDateTime now = LocalDateTime.now();
LocalDateTime start = now.minusHours(sleepTimeActionDuration);
LocalDateTime start = now.minusMinutes(sleepTimeActionDuration.multiply(new BigDecimal(60).setScale(0, RoundingMode.HALF_UP)).intValue());
PlatDevice platDevice = getBreathDevice(platElderIdDTO.getElderId(), platElderIdDTO.getDeviceId());
List<DeviceInfoContentBreathe> breatheList = iotProductDeviceService.getDeviceLogByTimeRangeBreathe(platDevice.getOriDeviceId(), 2 * 24 * 3600, start, now);
if (CollectionUtils.isNotEmpty(breatheList)) {
if (StreamUtil.allMatch(breatheList, e -> e.getProperties().getBodymove() < sleepTimeActionThreshold)) {
if (StreamUtil.allMatch(breatheList, e -> new BigDecimal(e.getProperties().getBodymove()).compareTo(sleepTimeActionThreshold) <= 0)) {
platElderRealTimeNowVO.setStatus(PlatElderRealtimeReportEnum.NowStatus.SLEEP.getValue());
}
}
......
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