#
Junjie
1 天以前 26784989e73fc36c6315e54939d1b13a50eb5020
src/main/java/com/zy/asrs/controller/StationController.java
@@ -133,6 +133,29 @@
        return R.ok();
    }
    @PostMapping("/command/clearPath")
    public R commandClearPath(@RequestBody StationCommandMoveParam param) {
        if (Cools.isEmpty(param) || Cools.isEmpty(param.getStationId()) || Cools.isEmpty(param.getTaskNo())) {
            return R.error("缺少参数");
        }
        StationObjModel finalStation = findStation(param.getStationId());
        if (finalStation == null) {
            return R.error("站点不存在");
        }
        StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, finalStation.getDeviceNo());
        if (stationThread == null) {
            return R.error("线程不存在");
        }
        boolean cleared = stationThread.clearPath(param.getTaskNo());
        if (!cleared) {
            return R.error("未匹配到可清理路径或清理失败");
        }
        return R.ok("清理路径成功");
    }
    private StationObjModel findStation(Integer stationId) {
        if (Cools.isEmpty(stationId)) {
            return null;