From b0bc56dd813ad36d98f65ee88cc6cb60c31d8d35 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 16 Jun 2021 13:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9AIBP=E7=9B=98bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/services/VirtualRealityIbpService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java index 2a5ed39ec..06733ce32 100644 --- a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java +++ b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java @@ -21,6 +21,8 @@ import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.vo.client.ibp.IbpData; +import club.joylink.rtss.vo.client.ibp.IbpQueryVO; +import club.joylink.rtss.vo.client.ibp.IbpVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; @@ -199,8 +201,11 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { VirtualRealityIbp ibp = station.getVrIbp(); if (ibp == null) continue; + List buttons = ibp.queryByType(VirtualRealityIbp.Mean.PRERESET_Z); + if (CollectionUtils.isEmpty(buttons)) + continue; VirtualRealityIbp.SquareButton preResetButton = - (VirtualRealityIbp.SquareButton) ibp.queryByType(VirtualRealityIbp.Mean.PRERESET_Z).get(0); + (VirtualRealityIbp.SquareButton) buttons.get(0); if (!preResetButton.isDown()) continue; LocalDateTime now = LocalDateTime.now(); @@ -223,7 +228,7 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { throw new SimulationException(SimulationExceptionType.System_Fault, "车辆段没有IBP盘"); } if (station.getVrIbp() == null) { - Ibp ibp = ibpService.queryEntityBy(simulation.getBuildParams().getMap().getId(), station.getCode()); + IbpVO ibp = ibpService.getBy(new IbpQueryVO(simulation.getBuildParams().getMap().getId(), station.getCode())); IbpData ibpData = JsonUtils.read(ibp.getData(), IbpData.class); VirtualRealityIbp vrIbp = new VirtualRealityIbp(ibpData); station.setVrIbp(vrIbp);