自动化立体仓库 - WCS系统
#
luxiaotao1123
2022-09-15 c5736834f88a5fd43abadaec50dd2b1e6dceb4ba
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -483,7 +483,7 @@
                if (steNo != null) {
                    // 小车行走到堆垛机待搬移点
                    if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) {
                        this.letCarBeReady(wrkMast, steNo);
                        this.letCarBeReady(wrkMast, steNo, wrkMast.getLocNo());
                    }
                    // 小车搬走
                    if (wrkMast.getWrkSts() == 3L) {
@@ -539,7 +539,7 @@
                if (steNo != null) {
                    // 小车行走到堆垛机待搬移点
                    if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) {
                        this.letCarBeReady(wrkMast, steNo);
                        this.letCarBeReady(wrkMast, steNo, wrkMast.getLocNo());
                    }
                    // 堆垛机将货放至小车上 3.小车待搬(小车不用搬运,已经在当前组库位) / 6.小车待入  ===>> 7.吊车入库中
                    if (wrkMast.getWrkSts() == 3L || wrkMast.getWrkSts() == 6L) {
@@ -587,7 +587,7 @@
                        SteThread steThread = queryIdleCar(wrkMast);
                        if (steThread != null) {
                            // 让小车等待搬运待续
                            this.letCarBeReady(wrkMast, steThread.getSlave().getId());
                            this.letCarBeReady(wrkMast, steThread.getSlave().getId(), wrkMast.getLocNo());
                        }
                    }
                    // 堆垛机搬运小车
@@ -681,7 +681,7 @@
                // 不是最外层库位,需要使用穿梭车搬运后,再堆垛机出库
                } else {
                    // 当前组库位是否有穿梭车
                    Integer steNo = this.hasCarOfIdle(wrkMast.getLocNo());
                    Integer steNo = this.hasCarOfIdle(wrkMast.getSourceLocNo());
                    // 有小车
                    if (steNo != null) {
                        if (wrkMast.getWrkSts() == 11L && wrkMast.getSteNo() == null) {
@@ -696,12 +696,8 @@
                                SteCommand steCommand = new SteCommand();
                                steCommand.setSteNo(steNo); // 穿梭车编号
                                steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号
                                steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式:  去近点 等待堆垛机叉取
                                steCommand.setTaskMode(SteTaskModeType.findOutByLoc(wrkMast.getSourceLocNo())); // 任务模式:  去近点 等待堆垛机叉取
                                SteABType ab = Utils.selectAB(steProtocol.getRow().intValue());
                                // todo:luxiaotao
                                if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                                    log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
                                } else {
@@ -757,7 +753,7 @@
                            SteThread steThread = queryIdleCar(wrkMast);
                            if (steThread != null) {
                                // 让小车等待搬运待续
                                this.letCarBeReady(wrkMast, steThread.getSlave().getId());
                                this.letCarBeReady(wrkMast, steThread.getSlave().getId(), wrkMast.getSourceLocNo());
                            }
                        }
                        // 堆垛机搬运小车
@@ -811,7 +807,7 @@
     * 让小车从 远点 ====>> 移动到近点
     *  等待堆垛机搬运
     */
    public void letCarBeReady(WrkMast wrkMast, Integer steNo) {
    public void letCarBeReady(WrkMast wrkMast, Integer steNo, String locNo) {
        // 获取穿梭车信息
        SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo);
        SteProtocol steProtocol = steThread.getSteProtocol();
@@ -822,7 +818,7 @@
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
            steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号
            steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式:  去近点 等待堆垛机叉取
            steCommand.setTaskMode(SteTaskModeType.findOriginByLoc(locNo)); // 任务模式:  去近点 等待堆垛机叉取
            steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue());
            steCommand.setBay(steProtocol.getBay());
@@ -1014,8 +1010,7 @@
                            SteCommand steCommand = new SteCommand();
                            steCommand.setSteNo(steNo); // 穿梭车编号
                            steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号
                            steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式:  去近点 等待堆垛机叉取
                            // todo:luxiaotao
                            steCommand.setTaskMode(SteTaskModeType.findInByLoc(wrkMast.getLocNo())); // 任务模式: 搬入库
                            if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                                log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
                            } else {
@@ -1087,8 +1082,7 @@
                        SteCommand steCommand = new SteCommand();
                        steCommand.setSteNo(steNo); // 穿梭车编号
                        steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号
                        steCommand.setTaskMode(SteTaskModeType.TO_B); // 任务模式:  去近点 等待堆垛机叉取
                        // todo:luxiaotao
                        steCommand.setTaskMode(SteTaskModeType.findOutByLoc(wrkMast.getSourceLocNo())); // 任务模式:  搬出库
                        if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) {
                            log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand));
                        } else {