自动化立体仓库 - WCS系统
#
luxiaotao1123
2022-09-19 3b42d4d488cc983469e3729ff7f48c2d50c59b52
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -541,7 +541,7 @@
                if (steNo != null) {
                    // 小车行走到堆垛机待搬移点
                    if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) {
                        this.letCarBeReady(wrkMast, steNo, wrkMast.getLocNo());
                        this.letCarBeWaiting(wrkMast, steNo, wrkMast.getLocNo());
                    }
                    // 堆垛机将货放至小车上 3.小车待搬(小车不用搬运,已经在当前组库位) / 6.小车待入  ===>> 7.吊车入库中
                    if (wrkMast.getWrkSts() == 3L || wrkMast.getWrkSts() == 6L) {
@@ -806,6 +806,40 @@
    }
    /**
     * 让小车从 远点 ====>> 待机
     *  等待堆垛机搬运
     */
    public void letCarBeWaiting(WrkMast wrkMast, Integer steNo, String locNo) {
        // 获取穿梭车信息
        SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
        SteProtocol steProtocol = steThread.getSteProtocol();
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
            steCommand.setTaskNo(9999); // 工作号
            steCommand.setTaskMode(SteTaskModeType.findWaiting(steProtocol.getRow().intValue())); // 任务模式:  去近点 等待堆垛机叉取
            steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue());
            steCommand.setBay(steProtocol.getBay());
            steCommand.setLev(steProtocol.getLev());
            if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
            } else {
                // 修改工作档状态 绑定穿梭车
                wrkMast.setSteNo(steNo);
                wrkMast.setModiTime(new Date());
                if (wrkMastMapper.updateById(wrkMast) == 0) {
                    log.error("修改工作档状态 绑定穿梭车 失败!!,工作号={}", wrkMast.getWrkNo());
                }
            }
        }
    }
    /**
     * 让小车从 远点 ====>> 移动到近点
     *  等待堆垛机搬运
     */