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 f9d2ccf26..74eb41654 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 @@ -9,7 +9,6 @@ import club.joylink.rtss.simulation.cbtc.data.SimulationIscsDataRepository; import club.joylink.rtss.simulation.cbtc.data.info.StandPis; import club.joylink.rtss.simulation.cbtc.data.iscs.Audio; import club.joylink.rtss.simulation.cbtc.data.iscs.LCD; -import club.joylink.rtss.simulation.cbtc.data.iscs.LED; import club.joylink.rtss.simulation.cbtc.data.map.MapElement; import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityAudio; @@ -72,7 +71,7 @@ public class IscsInteractiveService { List infos = iscsRepository.getTimedPlayInfos(timedPlayParamVO.getStationCode()); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL .assertTrue(infos.stream().noneMatch(info -> info.getDesc().equals(timedPlayParamVO.getDesc())), - "描述不能相同"); + "描述不能相同"); iscsRepository.addTimedPlayParamVO(timedPlayParamVO); } @@ -115,28 +114,13 @@ public class IscsInteractiveService { SimulationIscsDataRepository iscsRepository = simulation.getIscsRepository(); for (String code : param.getIscsDeviceCodes()) { MapElement element = repository.getByCode(code); - if (element instanceof Audio) { - AudioResourcesVO resourceVO; + if (element instanceof LCD) { + String content; if (!IscsSystemResourcesVO.Type.REAL_TIME.equals(param.getType())) { - resourceVO = simulation.getIscsRepository().getAudioResource(param.getResourceId()); + content = simulation.getIscsRepository().getAudioResource(param.getResourceId()).getDesc(); } 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); + content = param.getContent(); } - Audio audio = (Audio) element; - audio.updateResource(resourceVO); - VirtualRealityAudio vrAudio = audio.getVrAudio(); - vrAudio.updateUrl(resourceVO.getUrl()); - vrAudio.control(VirtualRealityAudio.Command.PLAY); - return resourceVO.getUrl(); - } else if (element instanceof LED) { -// LED led = (LED) element; -// Station station = led.getStation(); -// Stream standPisStream = iscsRepository.getStandPisStream(station); -// standPisStream.forEach(sp -> sp.setText(resourceVO.getDesc())); - } else if (element instanceof LCD) { LCD lcd = (LCD) element; IscsDeviceVO.Position position = lcd.getPosition(); Boolean up = null; @@ -150,7 +134,7 @@ public class IscsInteractiveService { List stands = lcd.getStation().getNormalStand(right); for (Stand stand : stands) { Optional standPisOptional = iscsRepository.findStandPisOptional(stand.getCode()); - standPisOptional.ifPresent(sp -> sp.setText(param.getContent())); + standPisOptional.ifPresent(sp -> sp.setText(content)); } } }