|
@@ -74,14 +74,20 @@ public class IotWarnlogServiceImpl implements IIotWarnlogService {
|
|
|
}
|
|
}
|
|
|
// 查询告警设备信息
|
|
// 查询告警设备信息
|
|
|
List<IotDevice> iotDeviceList = iotDeviceMapper.selectIotDeviceByDevBids(devBids, SecurityUtils.getTid());
|
|
List<IotDevice> iotDeviceList = iotDeviceMapper.selectIotDeviceByDevBids(devBids, SecurityUtils.getTid());
|
|
|
- Map<String,String> iotDeviceMap = iotDeviceList.stream().collect(Collectors.toMap(IotDevice::getDevBid,IotDevice::getDevCode));
|
|
|
|
|
|
|
+ Map<String,IotDevice> iotDeviceMap = iotDeviceList.stream().collect(Collectors.toMap(IotDevice::getDevBid,item->item));
|
|
|
// 查询告警设备类型信息
|
|
// 查询告警设备类型信息
|
|
|
List<TosDevicetype> tosDevicetypes = tosDevicetypeMapper.selectTosDevicetypeByDevtypeBids(devTypeBids);
|
|
List<TosDevicetype> tosDevicetypes = tosDevicetypeMapper.selectTosDevicetypeByDevtypeBids(devTypeBids);
|
|
|
Map<String,String> tosDeviceTypeMap = tosDevicetypes.stream().collect(Collectors.toMap(TosDevicetype::getDevtypeBid,TosDevicetype::getDevtypeName));
|
|
Map<String,String> tosDeviceTypeMap = tosDevicetypes.stream().collect(Collectors.toMap(TosDevicetype::getDevtypeBid,TosDevicetype::getDevtypeName));
|
|
|
// 遍历结果进行赋值
|
|
// 遍历结果进行赋值
|
|
|
for(IotWarnlogResVo iotWarnlogResVo : iotWarnLogResVoList){
|
|
for(IotWarnlogResVo iotWarnlogResVo : iotWarnLogResVoList){
|
|
|
- // 设置设备编号
|
|
|
|
|
- iotWarnlogResVo.setDevCode(iotDeviceMap.get(iotWarnlogResVo.getDevBid()));
|
|
|
|
|
|
|
+ IotDevice iotDevice = iotDeviceMap.get(iotWarnlogResVo.getDevBid());
|
|
|
|
|
+ if(null != iotDevice){
|
|
|
|
|
+ // 设置设备编号
|
|
|
|
|
+ iotWarnlogResVo.setDevCode(iotDevice.getDevCode());
|
|
|
|
|
+ // 设置设备名称
|
|
|
|
|
+ iotWarnlogResVo.setDevName(iotDevice.getDevName());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 设置设备类型名称
|
|
// 设置设备类型名称
|
|
|
iotWarnlogResVo.setDevTypeName(tosDeviceTypeMap.get(iotWarnlogResVo.getDevtypeBid()));
|
|
iotWarnlogResVo.setDevTypeName(tosDeviceTypeMap.get(iotWarnlogResVo.getDevtypeBid()));
|
|
|
// 获取设备触发类型,并进行赋值
|
|
// 获取设备触发类型,并进行赋值
|