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);