| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Component |
| | | public class StationOperateProcessUtils { |
| | |
| | | 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); |
| | | } |