| | |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.StationCommand; |
| | | import com.zy.core.model.protocol.StationProtocol; |
| | | import com.zy.core.model.protocol.StationTaskBufferItem; |
| | | import com.zy.core.service.StationTaskLoopService; |
| | | import com.zy.core.thread.StationThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | if (lock != null) { |
| | | return; |
| | | } |
| | | int taskBufferCommandCount = countTaskBufferCommands(stationProtocol.getTaskBufferItems()); |
| | | if (taskBufferCommandCount > 0) { |
| | | News.info("输送站点任务停留超时,但缓存区仍有命令,已跳过重算。站点号={},工作号={},缓存命令数={}", |
| | | stationProtocol.getStationId(), |
| | | stationProtocol.getTaskNo(), |
| | | taskBufferCommandCount); |
| | | return; |
| | | } |
| | | |
| | | Double pathLenFactor = resolveOutboundPathLenFactor(wrkMast); |
| | | OutOrderDispatchDecision dispatchDecision = null; |
| | |
| | | redisUtil.del(key); |
| | | } |
| | | |
| | | private int countTaskBufferCommands(List<StationTaskBufferItem> taskBufferItems) { |
| | | if (taskBufferItems == null || taskBufferItems.isEmpty()) { |
| | | return 0; |
| | | } |
| | | int count = 0; |
| | | for (StationTaskBufferItem item : taskBufferItems) { |
| | | if (item == null) { |
| | | continue; |
| | | } |
| | | Integer taskNo = item.getTaskNo(); |
| | | Integer targetStaNo = item.getTargetStaNo(); |
| | | if ((taskNo != null && taskNo != 0) || (targetStaNo != null && targetStaNo != 0)) { |
| | | count++; |
| | | } |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | private int clearIssuedMoveCommandsDuringIdleStay(StationTaskIdleTrack idleTrack, |
| | | Integer taskNo, |
| | | Integer stationId) { |