自动化立体仓库 - WMS系统
lty
2025-05-14 ea63cc4745ace568fe5570e18f7ff5b21a811826
src/main/java/com/zy/common/service/CommonService.java
@@ -165,11 +165,7 @@
        if (!Cools.isEmpty(moveCrnNo) && moveCrnNo!=0){
            crnNumber = moveCrnNo;
            if (times==0){
                curRow = moveCrnNo*2-1;
            }else {
                curRow = moveCrnNo*2-1;
            }
            curRow = eRow;
        }
        //此程序用于优化堆垛机异常时的运行时间
@@ -333,71 +329,49 @@
                    .eq("row1", nearRow)
                    .eq("loc_sts", "O")
                    .orderBy("lev1",true).orderBy("bay1",true));
            for (LocMast locMast1 : locMasts) {
                if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
                    continue;
                }
                if (Utils.BooleanWhsTypeStaIoType(whsType)){
//                    String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
                    LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                            .eq("loc_sts", "O"));
                    if (!Cools.isEmpty(locMast2)) {
                        locMast = locMast2;
                        break;
                    }
                } else {
                    if (!Cools.isEmpty(locMast1)) {
                        locMast = locMast1;
                        break;
                    }
                }
            }
//            for (LocMast locMast1 : locMasts) {
//                if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
//                    continue;
//                }
//                if (Utils.BooleanWhsTypeStaIoType(whsType)){
////                    String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
//                    LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
//                            .eq("loc_sts", "O"));
//                    if (!Cools.isEmpty(locMast2)) {
//                        locMast = locMast2;
//                        break;
//                    }
//                } else {
//                    if (!Cools.isEmpty(locMast1)) {
//                        locMast = locMast1;
//                        break;
//                    }
//                }
//            }
            if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(whsType)){
                for (LocMast locMast1 : locMasts) {
                    if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
                        continue;
                    }
                    if (Utils.BooleanWhsTypeStaIoType(whsType)){
                        String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
                        LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                .eq("loc_no", shallowLoc).eq("loc_sts", "O"));
                        if (!Cools.isEmpty(locMast2)) {
                            locMast = locMast2;
                            break;
                        } else {
                            locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                    .eq("loc_no", shallowLoc).eq("loc_sts", "F"));
                            if (!Cools.isEmpty(locMast2)) {
                                locMast = locMast2;
                                break;
                            } else {
                                locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                        .eq("loc_no", shallowLoc).eq("loc_sts", "D"));
                                if (!Cools.isEmpty(locMast2)) {
                                    locMast = locMast2;
                                    break;
                                }
                            }
                        }
                    } else {
                        if (!Cools.isEmpty(locMast1)) {
                            locMast = locMast1;
                            break;
                        }
                    }
                }
            }
        }
        if (!Cools.isEmpty(locMast) && !basCrnpService.checkSiteError(crnNo, true)) {
        if (!basCrnpService.checkSiteError(crnNo, true)) {
            locMast = null;
        }
        // 递归查询
        if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("O")) {
            // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归
            if (times < rowCount*2) {
            if (times < 1) {
                times = times + 1;
                return getLocNoRun(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo+1, locTypeDto, times);
            }