| | |
| | | |
| | | @PostMapping("/command/clearPath") |
| | | public R commandClearPath(@RequestBody StationCommandMoveParam param) { |
| | | if (Cools.isEmpty(param) || Cools.isEmpty(param.getStationId()) || Cools.isEmpty(param.getTaskNo())) { |
| | | if (param == null || Cools.isEmpty(param.getStationId()) || param.getTaskNo() == null) { |
| | | return R.error("缺少参数"); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public boolean clearPath(Integer taskNo) { |
| | | if (taskNo == null || taskNo <= 0) { |
| | | if (taskNo == null) { |
| | | return false; |
| | | } |
| | | if (zyStationConnectDriver == null) { |
| | |
| | | continue; |
| | | } |
| | | found = true; |
| | | Integer clearedTaskNo = item.getTaskNo(); |
| | | if (!zyStationConnectDriver.clearTaskBufferSlot(stationId, item.getSlotIdx())) { |
| | | success = false; |
| | | log.warn("输送站缓存区残留路径清理失败。stationId={}, slotIdx={}, taskNo={}", |
| | | stationId, item.getSlotIdx(), item.getTaskNo()); |
| | | stationId, item.getSlotIdx(), clearedTaskNo); |
| | | continue; |
| | | }else { |
| | | item.setTaskNo(0); |
| | | item.setTargetStaNo(0); |
| | | success = true; |
| | | log.warn("输送站缓存区残留路径清理成功。stationId={}, slotIdx={}, taskNo={}", |
| | | stationId, item.getSlotIdx(), item.getTaskNo()); |
| | | } |
| | | item.setTaskNo(0); |
| | | item.setTargetStaNo(0); |
| | | log.warn("输送站缓存区残留路径清理成功。stationId={}, slotIdx={}, taskNo={}", |
| | | stationId, item.getSlotIdx(), clearedTaskNo); |
| | | } |
| | | } |
| | | return found && success; |