Commit c65440f9 by huangjy

fix: 日报跌倒

parent d36fe34a
......@@ -332,11 +332,6 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
@Override
public List<String> failRecordListInternal(PlatElderReportDTO platElderIdDTO, LocalDateTime start, LocalDateTime end) {
String elderId = platElderIdDTO.getElderId();
List<PlatDevice> platDeviceList = platElderRealTimeService.getFallDevice(elderId, platElderIdDTO.getDeviceId());
if (CollectionUtils.isEmpty(platDeviceList)) {
return new ArrayList<>(10);
}
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
if (StringUtils.isNotEmpty(platElderIdDTO.getDeviceId())) {
......@@ -348,26 +343,17 @@ public class PlatElderDayReportDayServiceImpl implements PlatElderDayReportDaySe
List<String> voList = new ArrayList<>(10);
String finalElderId = elderId;
platDeviceList.forEach(e -> {
List<PlatAlarmRecord> recordList = platAlarmRecordService.list(new QueryWrapper<PlatAlarmRecord>().lambda()
.eq(PlatAlarmRecord::getAlarmType, PlatAlarmConfigEnum.AlarmTypeEnum.FALL.getValue())
.in(PlatAlarmRecord::getDeviceId, StreamUtil.mapId(platDeviceList, PlatDevice::getId))
.eq(PlatAlarmRecord::getElderIds, finalElderId)
.eq(PlatAlarmRecord::getMisinformationFlag, CommonEnum.NO.getValue())
.ge(PlatAlarmRecord::getAlarmDate, start)
.le(PlatAlarmRecord::getAlarmDate, end)
.orderByDesc(PlatAlarmRecord::getAlarmDate)
);
voList.addAll(StreamUtil.map(recordList, i -> i.getAlarmDate().format(dateTimeFormatter)));
/* List<DeviceInfoContentFall> fallList = iotProductDeviceService.getDeviceLogByTimeRangeFall(e.getOriDeviceId(), 2 * 24 * 3600, start, end);
fallList = StreamUtil.filter(fallList, i -> DeviceInfoContentFallEnum.PersonStateEnum.FALL.getValue().equals(i.getProperties().getPersonState()));
List<PlatAlarmRecord> recordList = platAlarmRecordService.list(new QueryWrapper<PlatAlarmRecord>().lambda()
.eq(PlatAlarmRecord::getAlarmType, PlatAlarmConfigEnum.AlarmTypeEnum.FALL.getValue())
.eq(PlatAlarmRecord::getElderIds, finalElderId)
.eq(PlatAlarmRecord::getMisinformationFlag, CommonEnum.NO.getValue())
.ge(PlatAlarmRecord::getAlarmDate, start)
.le(PlatAlarmRecord::getAlarmDate, end)
.orderByDesc(PlatAlarmRecord::getAlarmDate)
);
*/
});
voList.addAll(StreamUtil.map(recordList, i -> i.getAlarmDate().format(dateTimeFormatter)));
return voList.stream().distinct().collect(Collectors.toList());
}
......
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