Junjie
2025-12-30 411ff551ae7641dfc5c9331e99bf8b6e5770e2fa
src/main/java/com/zy/asrs/controller/DualCrnController.java
@@ -65,6 +65,8 @@
            vo.setLiftPosTwo(p.getLiftPosTypeTwo() == null ? "-" : p.getLiftPosTypeTwo().desc);
            vo.setWalkPos(p.getWalkPos() != null && p.getWalkPos() == 0 ? "在定位" : "不在定位");
            vo.setWalkPosTwo(p.getWalkPosTwo() != null && p.getWalkPosTwo() == 0 ? "在定位" : "不在定位");
            vo.setTaskReceive(p.getTaskReceive() != null && p.getTaskReceive() == 1 ? "接收" : "无任务");
            vo.setTaskReceiveTwo(p.getTaskReceiveTwo() != null && p.getTaskReceiveTwo() == 1 ? "接收" : "无任务");
            vo.setXspeed(p.getXSpeed());
            vo.setYspeed(p.getYSpeed());
            vo.setZspeed(p.getZSpeed());
@@ -101,9 +103,46 @@
            return R.error("线程不存在");
        }
        DualCrnCommand command = crnThread.getPickAndPutCommand(sourceLocNo, targetLocNo, 9999, crnNo, station);
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(2, command));
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command));
        return R.ok();
    }
    @PostMapping("/dualcrn/command/pick")
    @ManagerAuth(memo = "双工位堆垛机取货命令")
    public R dualCrnCommandPick(@RequestBody DualCrnCommandParam param) {
        if (Cools.isEmpty(param)) {
            return R.error("缺少参数");
        }
        Integer crnNo = param.getCrnNo();
        String targetLocNo = param.getTargetLocNo();
        Integer station = param.getStation();
        DualCrnThread crnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, crnNo);
        if (crnThread == null) {
            return R.error("线程不存在");
        }
        DualCrnCommand command = crnThread.getPickCommand(targetLocNo, 9999, crnNo, station);
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command));
        return R.ok();
    }
    @PostMapping("/dualcrn/command/put")
    @ManagerAuth(memo = "双工位堆垛机放货命令")
    public R dualCrnCommandPut(@RequestBody DualCrnCommandParam param) {
        if (Cools.isEmpty(param)) {
            return R.error("缺少参数");
        }
        Integer crnNo = param.getCrnNo();
        String targetLocNo = param.getTargetLocNo();
        Integer station = param.getStation();
        DualCrnThread crnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, crnNo);
        if (crnThread == null) {
            return R.error("线程不存在");
        }
        DualCrnCommand command = crnThread.getPutCommand(targetLocNo, 9999, crnNo, station);
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command));
        return R.ok();
    }
    @PostMapping("/dualcrn/command/move")
    @ManagerAuth(memo = "双工位堆垛机移动命令")
@@ -122,7 +161,7 @@
        if (station != null) {
            command.setStation(station.shortValue());
        }
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(2, command));
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command));
        return R.ok();
    }
@@ -139,7 +178,7 @@
            return R.error("线程不存在");
        }
        DualCrnCommand command = crnThread.getResetCommand(crnNo, station);
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(2, command));
        MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command));
        return R.ok();
    }
}