| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Component |
| | | public class StationOperateProcessUtils { |
| | |
| | | stationOutboundDispatchProcessor.dualCrnStationOutExecute(); |
| | | } |
| | | |
| | | //检测输送站点出库任务执行完成 |
| | | public synchronized void stationOutExecuteFinish() { |
| | | stationRegularDispatchProcessor.stationOutExecuteFinish(); |
| | | } |
| | | |
| | | // 检测单个出库任务是否到达目标站台 |
| | | public void stationOutExecuteFinish(WrkMast wrkMast) { |
| | | stationRegularDispatchProcessor.stationOutExecuteFinish(wrkMast); |
| | | public void stationOutExecuteFinish(StationObjModel stationObjModel) { |
| | | stationRegularDispatchProcessor.stationOutExecuteFinish(stationObjModel); |
| | | } |
| | | |
| | | // 检测单个入库任务是否到达目标站台 |
| | |
| | | if (stationProtocol == null |
| | | || !stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0) { |
| | | || stationProtocol.getTaskNo() <= 0 |
| | | || !stationProtocol.isInEnable() |
| | | ) { |
| | | continue; |
| | | } |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | |
| | | } |
| | | |
| | | public void submitStationOutExecuteFinishTasks(MainProcessLane lane, long minIntervalMs) { |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("wrk_sts", WrkStsType.STATION_RUN.sts) |
| | | .isNotNull("sta_no")); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | wrkMast.getStaNo(), |
| | | "stationOutExecuteFinish", |
| | | minIntervalMs, |
| | | () -> stationOutExecuteFinish(wrkMast) |
| | | ); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | for (StationObjModel stationObjModel : basDevp.getOutStationList$()) { |
| | | mainProcessTaskSubmitter.submitKeyedSerialTask( |
| | | lane, |
| | | stationObjModel.getStationId(), |
| | | "stationOutExecuteFinish", |
| | | minIntervalMs, |
| | | () -> stationOutExecuteFinish(stationObjModel) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | if (stationId == null) { |
| | | continue; |
| | | } |
| | | if (!isIdleRecoverCandidateStation(basDevp, stationId)) { |
| | | continue; |
| | | } |
| | | if (!stationProtocol.isAutoing() |
| | | || !stationProtocol.isLoading() |
| | | || stationProtocol.getTaskNo() <= 0 |
| | |
| | | return stationRerouteProcessor.shouldUseRunBlockDirectReassign(wrkMast, stationId, runBlockReassignLocStationList); |
| | | } |
| | | |
| | | public boolean isIdleRecoverCandidateStation(BasDevp basDevp, Integer stationId) { |
| | | if (basDevp == null || stationId == null) { |
| | | return false; |
| | | } |
| | | return !containsStation(basDevp.getBarcodeStationList$(), stationId) |
| | | && !containsStation(basDevp.getInStationList$(), stationId) |
| | | && !containsStation(basDevp.getOutStationList$(), stationId); |
| | | } |
| | | |
| | | private boolean containsStation(List<StationObjModel> stationList, Integer stationId) { |
| | | if (stationList == null || stationList.isEmpty() || stationId == null) { |
| | | return false; |
| | | } |
| | | for (StationObjModel stationObjModel : stationList) { |
| | | if (stationObjModel != null && Objects.equals(stationObjModel.getStationId(), stationId)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean shouldSkipIdleRecoverForRecentDispatch(Integer taskNo, Integer stationId) { |
| | | return stationRerouteProcessor.shouldSkipIdleRecoverForRecentDispatch(taskNo, stationId); |
| | | } |
| | | |
| | | public void attemptClearTaskPath(StationThread stationThread, Integer taskNo) { |
| | | stationRegularDispatchProcessor.attemptClearTaskPath(stationThread, taskNo); |
| | | } |
| | | } |