diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java index 2deaea2..56e8f9b 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java @@ -99,12 +99,15 @@ public class TransitVehicleRecordController extends BaseController { for (TransitVehicleRecord transitVehicleRecord1 : list){ TransitVehicleRecordVO transitVehicleRecordVO = new TransitVehicleRecordVO(); BeanUtils.copyProperties(transitVehicleRecord1,transitVehicleRecordVO); - DevopsDeviceInfo deviceInfo = devopsDeviceInfoService.lambdaQuery() - .eq(DevopsDeviceInfo::getGbsChannelNo, transitVehicleRecord1.getDoorwayCode()).list().get(0); - if (deviceInfo != null){ - transitVehicleRecordVO.setLongitude(deviceInfo.getLongitude()); - transitVehicleRecordVO.setLatitude(deviceInfo.getLatitude()); - transitVehicleRecordVOS.add(transitVehicleRecordVO); + List list1 = devopsDeviceInfoService.lambdaQuery() + .eq(DevopsDeviceInfo::getGbsChannelNo, transitVehicleRecord1.getDoorwayCode()).list(); + if (list1.size() > 0){ + DevopsDeviceInfo deviceInfo = list1.get(0); + if (deviceInfo != null){ + transitVehicleRecordVO.setLongitude(deviceInfo.getLongitude()); + transitVehicleRecordVO.setLatitude(deviceInfo.getLatitude()); + transitVehicleRecordVOS.add(transitVehicleRecordVO); + } } } List collect = transitVehicleRecordVOS.stream()