自动化立体仓库 - WMS系统
#
whycq
2023-01-30 2f932f2675b0e7cfa7c5466b058d93aec67d6f3c
src/main/java/com/zy/common/service/CommonService.java
@@ -115,16 +115,25 @@
        StartupDto startupDto = new StartupDto();
        int start;
        int end;
        Integer theCrnNo = null;
        switch (sourceStaNo) {
            case 103:
                whsType = 1;
                start = 1;
                end = 14;
                if (null != wrkMastService.selectPakoutOfStaNo(104)) {
                    start = 8;
                    theCrnNo = 2;
                }
                break;
            case 203:
                whsType = 2;
                start = 8;
                end = 21;
                if (null != wrkMastService.selectPakoutOfStaNo(204)) {
                    end = 14;
                    theCrnNo = 2;
                }
                break;
            default:
                throw new CoolException("检索库位失败,请联系管理员");
@@ -144,6 +153,17 @@
        int crnNo = 0;
        // 目标库位
        LocMast locMast = null;
        boolean inoutEveryday = false;
        if (!Cools.isEmpty(matNos)) {
            for (String matNo : matNos) {
                Mat mat = matService.selectByMatnr(matNo);
                if (mat.getInoutEveryday() != null && mat.getInoutEveryday()) {
                    inoutEveryday = true;
                    break;
                }
            }
        }
        // 靠近摆放规则 --- 同天同规格物料
        if (!Cools.isEmpty(matNos) && matNos.size() == 1) {
@@ -207,9 +227,17 @@
                    switch (curRow) {
                        case 1:
                            curRow = 1;
                            if (null != theCrnNo) {
                                curRow = 8;
                                crnNo1 = crnNo1 + 1;
                            }
                            break;
                        case 2:
                            curRow = 7;
                            if (null != theCrnNo) {
                                curRow = 14;
                                crnNo1 = crnNo1 + 1;
                            }
                            break;
                        case 3:
                            curRow = 8;
@@ -230,9 +258,17 @@
                            break;
                        case 3:
                            curRow = 15;
                            if (null != theCrnNo) {
                                curRow = 8;
                                crnNo1 = crnNo1 - 1;
                            }
                            break;
                        case 4:
                            curRow = 21;
                            if (null != theCrnNo) {
                                curRow = 14;
                                crnNo1 = crnNo1 - 1;
                            }
                            break;
                        default:
                            throw new CoolException("检索库位失败,请联系管理员");
@@ -275,12 +311,7 @@
        // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排
        if (locMast == null) {
            List<Integer> rows = Utils.getGroupLoc(curRow);
            Mat mat = matService.selectByMatnr(matNos.get(0));
            if (Cools.isEmpty(mat.getInoutEveryday())){
                mat.setInoutEveryday(false);
            }
            List<LocMast> locMasts = locMastService.queryFreeLocMast2(rows, rows.size(), locTypeDto.getLocType1(),mat.getInoutEveryday());
            List<LocMast> locMasts = locMastService.queryFreeLocMast0(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday);
            if (!Cools.isEmpty(locMasts)) {
                Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo());
                for (LocMast one : locMasts) {