| | |
| | | import com.zy.common.utils.NavigateUtils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.move.StationMoveCoordinator; |
| | | import com.zy.core.move.StationMoveDispatchMode; |
| | | import com.zy.core.move.StationMoveSession; |
| | | import com.zy.core.News; |
| | | import com.zy.core.cache.MessageQueue; |
| | |
| | | continue; |
| | | } |
| | | if (Objects.equals(stationProtocol.getStationId(), wrkMast.getStaNo())) { |
| | | continue; |
| | | } |
| | | if (shouldSkipOutOrderDispatchForExistingRoute(wrkMast.getWrkNo(), stationProtocol.getStationId())) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | return true; |
| | | } |
| | | |
| | | private boolean shouldSkipOutOrderDispatchForExistingRoute(Integer wrkNo, Integer stationId) { |
| | | if (stationMoveCoordinator == null || wrkNo == null || wrkNo <= 0 || stationId == null) { |
| | | return false; |
| | | } |
| | | StationMoveSession session = stationMoveCoordinator.loadSession(wrkNo); |
| | | if (session == null) { |
| | | return false; |
| | | } |
| | | boolean protectedStatus = session.isActive() || StationMoveSession.STATUS_BLOCKED.equals(session.getStatus()); |
| | | if (!protectedStatus || !session.containsStation(stationId)) { |
| | | return false; |
| | | } |
| | | if (StationMoveDispatchMode.CIRCLE == session.getDispatchMode()) { |
| | | return true; |
| | | } |
| | | return !Objects.equals(stationId, session.getCurrentRouteTargetStationId()); |
| | | } |
| | | |
| | | private boolean isWatchingCircleArrival(Integer wrkNo, Integer stationId) { |
| | | if (stationMoveCoordinator != null) { |
| | | StationMoveSession session = stationMoveCoordinator.loadSession(wrkNo); |