diff --git a/src/main/java/club/joylink/rtss/services/MapService.java b/src/main/java/club/joylink/rtss/services/MapService.java index b895528d3..b74cb10aa 100644 --- a/src/main/java/club/joylink/rtss/services/MapService.java +++ b/src/main/java/club/joylink/rtss/services/MapService.java @@ -382,10 +382,10 @@ public class MapService implements IMapService { // 更新地图当前使用的地图数据版本 map.setVersion(mapData.getVersion()); mapInfoDAO.updateByPrimaryKey(map); - //更新系统默认交路及相关运行图基础数据 - createDefaultRouting(mapDataVO, map.getId()); // 保存站间运行数据 iCacheService.remove(BusinessConsts.CachePrefix.Map + map.getId()); //删除地图数据缓存 + //更新系统默认交路及相关运行图基础数据 + createDefaultRouting(mapDataVO, map.getId()); MapVO newMapVO = new MapVO(map); MapDataVO dataVO = new MapDataVO(mapData); newMapVO.setMapData(dataVO); diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java index 646b979dc..36ac91c46 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -873,7 +873,11 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { } // 找指定方向的站台轨 Signal signal = lastSection.getSignalOf(right); - this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); + if (signal == null) { + this.queryNormalStandTracksOnDirectionFromSection(lastSection, right, nstdList); + } else { + this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); + } // 站前折返情况处理 if (!CollectionUtils.isEmpty(nstdList) && end.isNormalStandTrack() && @@ -903,6 +907,21 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { } } + private void queryNormalStandTracksOnDirectionFromSection(Section lastSection, boolean right, List
nstdList) { + Signal signal = lastSection.getSignalOf(right); + if (signal != null) { + this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); + } else { + Section nextSection = lastSection.getSectionOf(right); + if (nextSection.isNormalStandTrack() && nextSection.getStandList().get(0).isRight() == right) { + nstdList.add(nextSection); + return; + } else { + this.queryNormalStandTracksOnDirectionFromSection(nextSection, right, nstdList); + } + } + } + private boolean canArriveOppositeStandTrack(Section start, Section end, boolean right) { Signal signal = start.getSignalOf(right); List
nstdList = new ArrayList<>(); @@ -1137,27 +1156,37 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { Set signals = new HashSet<>(); for (Route route : routeList) { boolean containOppositeStandTrack = false; + boolean contains = false; for (Section section : route.getSectionList()) { - if (section.isNormalStandTrack() && - !Objects.equals(section.getStandList().get(0).isRight(), standRight)) { - containOppositeStandTrack = true; + if (section.isNormalStandTrack()) { + if (!Objects.equals(section.getStandList().get(0).isRight(), standRight)) { + containOppositeStandTrack = true; + } else { + contains = true; + nstdList.add(section); + } break; } } if (containOppositeStandTrack) { continue; } - Section lastRouteSection = route.getLastRouteSection(); - if (lastRouteSection.isNormalStandTrack()) { - if (Objects.equals(lastRouteSection.getStandList().get(0).isRight(), standRight)) { - if (!nstdList.contains(lastRouteSection)) { - nstdList.add(lastRouteSection); - } - } + if (contains) { continue; } else { signals.add(route.getDestination()); } +// Section lastRouteSection = route.getLastRouteSection(); +// if (lastRouteSection.isNormalStandTrack()) { +// if (Objects.equals(lastRouteSection.getStandList().get(0).isRight(), standRight)) { +// if (!nstdList.contains(lastRouteSection)) { +// nstdList.add(lastRouteSection); +// } +// } +// continue; +// } else { +// signals.add(route.getDestination()); +// } } if (!CollectionUtils.isEmpty(signals)) { for (Signal end : signals) {