luxiaotao1123
2022-11-30 03991cb0fed2b67f327f7e242988e7a2a06d8238
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -173,7 +173,7 @@
                        param.setBarcode(barcode);
                        param.setIoType(1);
                        param.setSourceStaNo(inSta.getStaNo());
                        param.setLocType1(locTypeDto.getLocType1());
//                        param.setLocType1(locTypeDto.getLocType1());
                        String response = new HttpHandler.Builder()
                                .setUri(wmsUrl)
                                .setPath("/rpc/pakin/loc/v1")
@@ -643,7 +643,7 @@
                    }
                }
                // 库位移转
                this.locToLoc(crn, crnProtocol);
//                this.locToLoc(crn, crnProtocol);
            }
        }
    }
@@ -847,7 +847,7 @@
                    Integer steNo = this.hasCarOfIdle(wrkMast.getLocNo());
                    // 有小车
                    if (steNo != null) {
                        // 小车行走到堆垛机待搬移点
                        // 小车行走到待机位
                        if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) {
                            // 没有其他任务
                            if (null == wrkMastMapper.selectPakin(slave.getId(), steNo)) {
@@ -974,7 +974,7 @@
                wrkMastMapper.updateById(wrkMast);
                // 判断是否为穿梭库
                if (!locMastService.isShuttle(wrkMast.getLocNo())) {
                if (!locMastService.isShuttle(wrkMast.getSourceLocNo())) {
                    // 双深库位且浅库位有货,则需先对浅库位进行库位移转
                    if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) {
@@ -1174,6 +1174,7 @@
    /**
     * 库位移转
     */
    @Deprecated
    public void locToLoc(CrnSlave slave, CrnProtocol crnProtocol){
        // 获取工作档信息
        WrkMast wrkMast = wrkMastMapper.selectLocMove(slave.getId());
@@ -1326,6 +1327,7 @@
            SteProtocol steProtocol = steThread.getSteProtocol();
            if (steProtocol == null) { continue; }
            if (!steProtocol.isIdle()) { continue; }
            if (steProtocol.getRow() == 1) { continue; }
            String locNo = wrkMast.getWrkSts() < 10 ? wrkMast.getLocNo() : wrkMast.getSourceLocNo();
            LocMast locMast = locMastService.selectById(locNo);
            int lev = locMast.getLev1();
@@ -1346,8 +1348,7 @@
    }
    /**
     * 让小车从 远点 ====>> 待机
     *  等待堆垛机搬运
     * 让小车行走至待机位
     */
    public void letCarBeWaiting(WrkMast wrkMast, Integer steNo, String locNo) {
        // 获取穿梭车信息
@@ -1356,25 +1357,36 @@
        if (steProtocol == null) { return; }
        if (steProtocol.isIdle()) {
            // 命令下发区 --------------------------------------------------------------------------
            SteCommand steCommand = new SteCommand();
            steCommand.setSteNo(steNo); // 穿梭车编号
            steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号
            steCommand.setTaskMode(SteTaskModeType.findWaiting(steProtocol.getRow().intValue())); // 任务模式:  去近点 等待堆垛机叉取
            steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue(), true).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 {
            // 如果处于待机位
            if (steProtocol.locaType.equals(SteLocaType.A_WAITING) || steProtocol.locaType.equals(SteLocaType.B_WAITING)) {
                // 修改工作档状态 绑定穿梭车
                wrkMast.setWrkSts(3L);
                wrkMast.setSteNo(steNo);
                wrkMast.setModiTime(new Date());
                if (wrkMastMapper.updateById(wrkMast) == 0) {
                    log.error("修改工作档状态 绑定穿梭车 失败!!,工作号={}", wrkMast.getWrkNo());
                }
            } else {
                // 命令下发区 --------------------------------------------------------------------------
                SteCommand steCommand = new SteCommand();
                steCommand.setSteNo(steNo); // 穿梭车编号
                steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号
                steCommand.setTaskMode(SteTaskModeType.findWaiting(steProtocol.getRow().intValue())); // 任务模式:  行走至待机位
                steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue(), true).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());
                    }
                }
            }
        }
    }