Pis发布信息不再直接转语音;修改查询进路路径逻辑以排除掉空列表;修改沙盘订阅路径
This commit is contained in:
parent
dce23dbff7
commit
1441e973f1
@ -111,6 +111,11 @@ public class IscsInteractiveService {
|
||||
}
|
||||
|
||||
public String pisPlay(Simulation simulation, PlayParamVO param) {
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
SimulationIscsDataRepository iscsRepository = simulation.getIscsRepository();
|
||||
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());
|
||||
@ -120,18 +125,12 @@ public class IscsInteractiveService {
|
||||
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) {
|
||||
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<Stand> stands = lcd.getStation().getNormalStand(right);
|
||||
for (Stand stand : stands) {
|
||||
Optional<StandPis> 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;
|
||||
}
|
||||
|
||||
|
@ -519,6 +519,8 @@ public class SimulationDataRepository {
|
||||
public List<RoutePath> queryRoutePathsByStart(Section start) {
|
||||
List<RoutePath> pathList = new ArrayList<>();
|
||||
for (List<RoutePath> 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<RoutePath> queryRoutePathsByEnd(Section end) {
|
||||
List<RoutePath> pathList = new ArrayList<>();
|
||||
for (List<RoutePath> list : routePathMap.values()) {
|
||||
if (CollectionUtils.isEmpty(list))
|
||||
continue;
|
||||
if (Objects.equals(list.get(0).getEnd(), end)) {
|
||||
pathList.addAll(list);
|
||||
}
|
||||
|
@ -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}"),
|
||||
|
Loading…
Reference in New Issue
Block a user