Commit 2d55be4a by 罗志长

feat: 实时告警分页返回设备类型

parent 1a551633
...@@ -452,6 +452,9 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -452,6 +452,9 @@ public class DataScreenServiceImpl implements DataScreenService {
.isNotNull(PlatAlarmRecord::getElderIds) .isNotNull(PlatAlarmRecord::getElderIds)
.orderByDesc(PlatAlarmRecord::getAlarmDate)); .orderByDesc(PlatAlarmRecord::getAlarmDate));
List<PlatAlarmRecord> alarmRecords = pages.getRecords(); List<PlatAlarmRecord> alarmRecords = pages.getRecords();
List<String> deviceIds = StreamUtil.map(alarmRecords, PlatAlarmRecord::getDeviceId);
List<PlatDevice> platDevices = platDeviceService.list(new QueryWrapper<PlatDevice>().lambda().in(PlatDevice::getId, deviceIds));
Map<String, String> deviceMap = StreamUtil.toMap(platDevices, PlatDevice::getId, PlatDevice::getCategory);
List<PlatElder> platElders = platElderService.list(new QueryWrapper<PlatElder>().lambda() List<PlatElder> platElders = platElderService.list(new QueryWrapper<PlatElder>().lambda()
.in(PlatElder::getOrgId, dto.getOrgIds())); .in(PlatElder::getOrgId, dto.getOrgIds()));
Map<String,String> elderNameMap = platElders.stream().collect(Collectors.toMap(PlatElder::getId,PlatElder::getName)); Map<String,String> elderNameMap = platElders.stream().collect(Collectors.toMap(PlatElder::getId,PlatElder::getName));
...@@ -494,6 +497,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -494,6 +497,7 @@ public class DataScreenServiceImpl implements DataScreenService {
listVo.setAlarmDate(record.getAlarmDate().format(df)); listVo.setAlarmDate(record.getAlarmDate().format(df));
listVo.setAlarmTime(record.getAlarmDate().format(dft)); listVo.setAlarmTime(record.getAlarmDate().format(dft));
listVo.setAlarmRecordId(record.getId()); listVo.setAlarmRecordId(record.getId());
listVo.setDeviceCategory(deviceMap.get(record.getDeviceId()));
list.add(listVo); list.add(listVo);
} }
......
...@@ -30,4 +30,6 @@ public class PlatAlarmStatisticsListVo { ...@@ -30,4 +30,6 @@ public class PlatAlarmStatisticsListVo {
private String path; private String path;
@ApiModelProperty(value = "告警id") @ApiModelProperty(value = "告警id")
private String alarmRecordId; private String alarmRecordId;
@ApiModelProperty(value = "设备类型 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达")
private String deviceCategory;
} }
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