| | |
| | | if (basDevp == null || stationThread == null || stationProtocol == null || wrkMast == null) { |
| | | return; |
| | | } |
| | | if (isDirectReassignContextStale(stationProtocol, wrkMast)) { |
| | | return; |
| | | } |
| | | int currentTaskBufferCommandCount = countCurrentTaskBufferCommands( |
| | | stationProtocol.getTaskBufferItems(), |
| | | stationProtocol.getTaskNo() |
| | |
| | | false |
| | | ); |
| | | } |
| | | } |
| | | |
| | | private boolean isDirectReassignContextStale(StationProtocol stationProtocol, WrkMast wrkMast) { |
| | | if (stationProtocol == null || wrkMast == null || stationMoveCoordinator == null) { |
| | | return false; |
| | | } |
| | | Integer taskNo = wrkMast.getWrkNo(); |
| | | Integer triggerStationId = stationProtocol.getStationId(); |
| | | if (taskNo == null || taskNo <= 0 || triggerStationId == null) { |
| | | return false; |
| | | } |
| | | StationMoveSession session = stationMoveCoordinator.loadSession(taskNo); |
| | | if (session == null || !session.isActive()) { |
| | | return false; |
| | | } |
| | | Integer currentStationId = session.getCurrentStationId(); |
| | | if (currentStationId == null || Objects.equals(currentStationId, triggerStationId)) { |
| | | return false; |
| | | } |
| | | News.info("输送站点运行堵塞重分配已跳过,任务已离开触发站点。触发站点={},当前站点={},工作号={}", |
| | | triggerStationId, |
| | | currentStationId, |
| | | taskNo); |
| | | return true; |
| | | } |
| | | |
| | | private int countCurrentTaskBufferCommands(List<StationTaskBufferItem> taskBufferItems, Integer currentTaskNo) { |