| | |
| | | if (basDevp == null || basDevp.getDevpNo() == null || stationId == null) { |
| | | return; |
| | | } |
| | | if (!isIdleRecoverCandidateStation(basDevp, stationId)) { |
| | | return; |
| | | } |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | | return; |
| | |
| | | return true; |
| | | } |
| | | |
| | | private 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 RerouteExecutionResult executeReroutePlanWithTaskLock(RerouteContext context, |
| | | RerouteCommandPlan plan, |
| | | StationProtocol stationProtocol, |