diff --git a/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java b/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java index 0713d87e0..f9d2ccf26 100644 --- a/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java +++ b/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java @@ -111,27 +111,26 @@ public class IscsInteractiveService { } public String pisPlay(Simulation simulation, PlayParamVO param) { - AudioResourcesVO resourceVO; - if (!IscsSystemResourcesVO.Type.REAL_TIME.equals(param.getType())) { - resourceVO = simulation.getIscsRepository().getAudioResource(param.getResourceId()); - } else { - BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertHasText(param.getName(), "实时消息名称不能为空"); - BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertHasText(param.getContent(), "实时消息内容不能为空"); - String url = iVoiceService.synthesis(param.getContent()); - resourceVO = new AudioResourcesVO(param.getName(), param.getContent(), url); - } SimulationDataRepository repository = simulation.getRepository(); SimulationIscsDataRepository iscsRepository = simulation.getIscsRepository(); - boolean play = false; for (String code : param.getIscsDeviceCodes()) { MapElement element = repository.getByCode(code); if (element instanceof Audio) { + AudioResourcesVO resourceVO; + if (!IscsSystemResourcesVO.Type.REAL_TIME.equals(param.getType())) { + resourceVO = simulation.getIscsRepository().getAudioResource(param.getResourceId()); + } else { + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertHasText(param.getName(), "实时消息名称不能为空"); + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertHasText(param.getContent(), "实时消息内容不能为空"); + String url = iVoiceService.synthesis(param.getContent()); + resourceVO = new AudioResourcesVO(param.getName(), param.getContent(), url); + } Audio audio = (Audio) element; audio.updateResource(resourceVO); VirtualRealityAudio vrAudio = audio.getVrAudio(); vrAudio.updateUrl(resourceVO.getUrl()); vrAudio.control(VirtualRealityAudio.Command.PLAY); - play = true; + return resourceVO.getUrl(); } else if (element instanceof LED) { // LED led = (LED) element; // Station station = led.getStation(); @@ -151,14 +150,11 @@ public class IscsInteractiveService { List stands = lcd.getStation().getNormalStand(right); for (Stand stand : stands) { Optional standPisOptional = iscsRepository.findStandPisOptional(stand.getCode()); - standPisOptional.ifPresent(sp -> sp.setText(resourceVO.getDesc())); + standPisOptional.ifPresent(sp -> sp.setText(param.getContent())); } } } } - if (play) { - return resourceVO.getUrl(); - } return null; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java index 4e7c4a67c..ace7b7fb8 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java @@ -519,6 +519,8 @@ public class SimulationDataRepository { public List queryRoutePathsByStart(Section start) { List pathList = new ArrayList<>(); for (List list : routePathMap.values()) { + if (CollectionUtils.isEmpty(list)) + continue; if (Objects.equals(list.get(0).getStart(), start)) { pathList.addAll(list); } @@ -535,6 +537,8 @@ public class SimulationDataRepository { public List queryRoutePathsByEnd(Section end) { List pathList = new ArrayList<>(); for (List list : routePathMap.values()) { + if (CollectionUtils.isEmpty(list)) + continue; if (Objects.equals(list.get(0).getEnd(), end)) { pathList.addAll(list); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/message/SimulationSubscribeTopic.java b/src/main/java/club/joylink/rtss/simulation/cbtc/message/SimulationSubscribeTopic.java index 43be31392..f39f3a836 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/message/SimulationSubscribeTopic.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/message/SimulationSubscribeTopic.java @@ -11,7 +11,7 @@ import java.util.Properties; public enum SimulationSubscribeTopic { Main("/queue/simulation/{id}"), - SandBox("/queue/simulation/jl3d/{id}"), + SandBox("/queue/simulation/{id}/jl3d"), Drive("/queue/simulation/drive/{id}"), PassengerFlow("/queue/simulation/passenger/{id}"), WeChatMini("/topic/simulation/assistant/{id}"),