From 78321b15c3275687ba1d84c7415a265f1f69335a Mon Sep 17 00:00:00 2001 From: hanrenchun Date: Mon, 26 Feb 2024 09:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E8=BD=A8=E8=BF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TransitVehicleRecordController.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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()