Commit ab17c79d by 汪志阳

fix:bug fix

parent 5cd0af06
......@@ -329,8 +329,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
allChildInfoList.addAll(childrenInfoList);
Set<String> phoneSet = childrenInfoList.stream().map(PlatElderChildrenInfo::getPhone).collect(Collectors.toSet());
//告警配置和租户告警 字典一致
List<SendTypeEnum> notifyChannelList = Arrays.asList(SendTypeEnum.SMS, SendTypeEnum.VOICE_SMS, SendTypeEnum.CHILD_WECHAT);
//告警配置和租户告警 字典一致 todo SendTypeEnum.CHILD_WECHAT 公众号模板未好
List<SendTypeEnum> notifyChannelList = Arrays.asList(SendTypeEnum.SMS, SendTypeEnum.VOICE_SMS);
List<MsgSendDTO.ReceiverInfo> receiverInfos = buildReceiverInfo(allChildInfoList, alarmRecord);
//发送消息
noticeByChannel(alarmConfig, alarmRecord, phoneSet, null, notifyChannelList, receiverInfos);
......
......@@ -122,6 +122,7 @@ public class DeviceLogServiceImpl implements DeviceLogService {
}
now = now.plusHours(1);
}
list.add(DateUtil.format(of1, DatePattern.NORM_DATETIME_MINUTE_PATTERN));
return list;
}
......
......@@ -218,7 +218,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
.orderByAsc(PlatElderSleep::getStartSleep)
);
setWakeUp(sleepList);
// setWakeUp(sleepList);
voList = StreamUtil.map(sleepList, e -> {
PlatElderSleepDiagramVO vo = new PlatElderSleepDiagramVO();
......@@ -243,29 +243,7 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
return voList;
}
private void setWakeUp(List<PlatElderSleep> sleepList) {
if (CollUtil.isEmpty(sleepList)) {
return;
}
List<PlatElderSleep> sleeps = sleepList.stream().filter(f -> f.getElderSleepType().equals(SleepTypeEnum.SLEEP.getType())).collect(Collectors.toList());
if (CollUtil.isEmpty(sleeps)) {
return;
}
List<PlatElderSleep> wakeUpList = sleepList.stream().filter(f -> f.getElderSleepType().equals(SleepTypeEnum.GETUP.getType())).collect(Collectors.toList());
sleeps.forEach(s -> {
List<PlatElderSleep> wakeList = wakeUpList.stream().filter(f -> f.getStartSleep().isAfter(s.getEndSleep())).collect(Collectors.toList());
if (CollUtil.isNotEmpty(wakeList)) {
final long[] minute = {24 * 60};
wakeList.forEach(w -> {
long between = Duration.between(s.getEndSleep(), w.getStartSleep()).toMinutes();
if (between < minute[0]) {
minute[0] = between;
s.setWakeUpTime(w.getStartSleep());
}
});
}
});
}
@Override
public PlatElderHeartRespiratoryEvaluationVO heartRespiratoryEvaluation(PlatElderReportDTO platElderIdDTO) {
......
......@@ -233,6 +233,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
double riseLeaveThreshold = Double.parseDouble(analysisModel.getRiseLeaveThreshold());
Integer totalActionCount = 0;
Integer totalTurnedCount = 0;
String lastKey = totalMap.lastKey();
for (Map.Entry<String, AnalysisVO> entry : totalMap.entrySet()) {
AnalysisVO analysisVO = entry.getValue();
......@@ -259,6 +260,12 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
isSleep = true;
}
getUpTime = sleepTimeAnalysisVO.getGetUpTime();
if (StrUtil.isBlank(getUpTime) && lastKey.equals(entry.getKey())) {
getUpTime = entry.getKey();
sleepTimeAnalysisVO.setGetUpTime(getUpTime);
sleepTimeAnalysisVO.setEndTime(getUpTime);
sleepTimeAnalysisVO.setRemark("最后一条数据算起床时间");
}
// 离床数据计算起床时间
if (isSleep && analysisVO.getIsMoveBed()) {
if (StrUtil.isBlank(getUpTime1)) {
......@@ -843,11 +850,9 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
}
}
if (CollUtil.isNotEmpty(elderSleepList)) {
elderSleepList.forEach(e -> {
platElderSleepService.remove(Wrappers.<PlatElderSleep>lambdaQuery()
.eq(PlatElderSleep::getHappenDate, currentDate).eq(PlatElderSleep::getElderId, e.getElderId()));
platElderSleepService.save(e);
});
.eq(PlatElderSleep::getHappenDate, currentDate).eq(PlatElderSleep::getElderId, platElderId));
elderSleepList.forEach(e -> platElderSleepService.save(e));
}
return elderSleepList;
}
......@@ -888,20 +893,20 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
PlatElder elder = platElderService.getOne(new QueryWrapper<PlatElder>().lambda()
.eq(PlatElder::getBedId, bedId));
// || !"1712648603580764161".equals(elder.getId())
if (elder == null) {
if (elder == null|| !"1712648603580764161".equals(elder.getId())) {
continue;
}
PlatDevice platDevice = platDeviceService.getById(platRoomBedDevice.getDeviceId());
// || !"218A00XE2669104".equals(platDevice.getOriDeviceId())
if (platDevice == null) {
if (platDevice == null|| !"218A00XE2669104".equals(platDevice.getOriDeviceId())) {
continue;
}
String tenantId = elder.getTenantId();
// dayHourRangeList = Lists.newArrayList("2024-01-29 23:38:00~2024-01-30 01:53:00");
// dayHourRangeList = Lists.newArrayList("2024-01-30 23:00:00~2024-01-31 00:32:00","2024-01-31 00:32:00~2024-01-31 01:32:00","2024-01-31 01:32:00~2024-01-31 02:40:00");
for (String hourRange : dayHourRangeList) {
String[] hourRangeArray = hourRange.split("~");
List<DeviceOperationLogEntity> deviceOperationLogEntities = productDeviceService.getDeviceLogByTimeRange(platDevice.getOriDeviceId(), "reportProperty", 5000, hourRangeArray[0], hourRangeArray[1]);
List<DeviceOperationLogEntity> deviceOperationLogEntities = productDeviceService.getDeviceLogByTimeRange(platDevice.getOriDeviceId(), "reportProperty", 10000, hourRangeArray[0], hourRangeArray[1]);
if (CollUtil.isEmpty(deviceOperationLogEntities)) {
continue;
}
......
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