| | |
| | | |
| | | boolean complete = false; |
| | | Integer targetDeviceNo = null; |
| | | StationThread stationThread = null; |
| | | BasStation basStation = basStationService.getOne(new QueryWrapper<BasStation>().eq("station_id", targetStaNo)); |
| | | if (basStation != null) { |
| | | targetDeviceNo = basStation.getDeviceNo(); |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basStation.getDeviceNo()); |
| | | stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basStation.getDeviceNo()); |
| | | if (stationThread != null) { |
| | | Map<Integer, StationProtocol> statusMap = stationThread.getStatusMap(); |
| | | StationProtocol stationProtocol = statusMap.get(basStation.getStationId()); |
| | |
| | | } |
| | | |
| | | if (complete) { |
| | | attemptClearTaskPath(stationThread, wrkNo); |
| | | completeStationRunTask(wrkMast, targetDeviceNo); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private void attemptClearTaskPath(StationThread stationThread, Integer taskNo) { |
| | | if (stationThread == null || taskNo == null || taskNo <= 0) { |
| | | return; |
| | | } |
| | | try { |
| | | boolean cleared = stationThread.clearPath(taskNo); |
| | | if (cleared) { |
| | | News.info("输送站点任务运行完成后清理残留路径,工作号={}", taskNo); |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("输送站点任务运行完成后清理残留路径异常,工作号={}", taskNo, e); |
| | | } |
| | | } |
| | | |
| | | private void completeStationRunTask(WrkMast wrkMast, Integer deviceNo) { |
| | | if (wrkMast == null || wrkMast.getWrkNo() == null) { |
| | | return; |