| | |
| | | import com.zy.core.task.MainProcessLane; |
| | | import com.zy.core.task.MainProcessTaskSubmitter; |
| | | import com.zy.core.thread.StationThread; |
| | | import com.zy.core.utils.station.StationDispatchLoadSupport; |
| | | import com.zy.core.utils.station.StationOutboundDispatchProcessor; |
| | | import com.zy.core.utils.station.StationRegularDispatchProcessor; |
| | | import com.zy.core.utils.station.StationRerouteProcessor; |
| | | import com.zy.core.utils.station.*; |
| | | import com.zy.core.utils.station.model.RerouteCommandPlan; |
| | | import com.zy.core.utils.station.model.RerouteContext; |
| | | import com.zy.core.utils.station.model.RerouteDecision; |
| | |
| | | private StationRerouteProcessor stationRerouteProcessor; |
| | | @Autowired |
| | | private MainProcessTaskSubmitter mainProcessTaskSubmitter; |
| | | @Autowired |
| | | private StationOutboundDecisionSupport stationOutboundDecisionSupport; |
| | | |
| | | //执行输送站点入库任务 |
| | | public synchronized void stationInExecute() { |
| | |
| | | } |
| | | |
| | | // 检测任务转完成 |
| | | public synchronized void checkTaskToComplete() { |
| | | public void checkTaskToComplete() { |
| | | stationRegularDispatchProcessor.checkTaskToComplete(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //检测输送站点是否运行堵塞 |
| | | public synchronized void checkStationRunBlock() { |
| | | public void checkStationRunBlock() { |
| | | stationRerouteProcessor.checkStationRunBlock(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //检测输送站点任务停留超时后重新计算路径 |
| | | public synchronized void checkStationIdleRecover() { |
| | | public void checkStationIdleRecover() { |
| | | stationRerouteProcessor.checkStationIdleRecover(); |
| | | } |
| | | |
| | |
| | | return stationDispatchLoadSupport.countCurrentStationTask(); |
| | | } |
| | | |
| | | public synchronized int getCurrentOutboundTaskCountByTargetStation(Integer stationId) { |
| | | public int getCurrentOutboundTaskCountByTargetStation(Integer stationId) { |
| | | if (stationId == null) { |
| | | return 0; |
| | | } |
| | |
| | | public void submitCheckStationOutOrderTasks(MainProcessLane lane, long minIntervalMs) { |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | for (StationObjModel stationObjModel : basDevp.getOutOrderList$()) { |
| | | Integer stationId = stationObjModel == null ? null : stationObjModel.getStationId(); |
| | | if (stationId == null) { |
| | | continue; |
| | | } |
| | | Map<Integer, StationProtocol> statusMap = stationThread.getStatusMap(); |
| | | StationProtocol stationProtocol = statusMap.get(stationId); |
| | | if (stationProtocol == null |
| | | || !stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0 |
| | | || stationProtocol.isRunBlock() |
| | | || !stationProtocol.getStationId().equals(stationProtocol.getTargetStaNo())) { |
| | | continue; |
| | | } |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | |
| | | if (stationId == null) { |
| | | continue; |
| | | } |
| | | if (!stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0 |
| | | || !stationOutboundDecisionSupport.isWatchingCircleArrival(stationProtocol.getTaskNo(), stationProtocol.getStationId())) { |
| | | continue; |
| | | } |
| | | |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | stationId, |
| | |
| | | if (stationId == null) { |
| | | continue; |
| | | } |
| | | if (!stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0 |
| | | || !stationProtocol.isRunBlock()) { |
| | | continue; |
| | | } |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | stationId, |
| | |
| | | if (stationId == null) { |
| | | continue; |
| | | } |
| | | if (!stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0 |
| | | || stationProtocol.isRunBlock()) { |
| | | continue; |
| | | } |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | stationId, |