自动化立体仓库 - WMS系统
18516761980
2021-12-09 2d9ee3c33e909a14f3a6729cacc114335e8023c8
src/main/java/com/zy/common/service/CommonService.java
@@ -157,7 +157,14 @@
        }
        // 靠近摆放规则 --- 空托
        if (emptyMk) {
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
//            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
            List<LocMast> locMasts = null;
            if(crnNo==1) {
                locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("row1", 1));
            } else {
                locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
            }
            if (locMasts.size() > 0) {
                for (LocMast loc : locMasts) {
                    if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) {
@@ -185,20 +192,26 @@
        if (null == locMast) {
            Shelves shelves = new Shelves(rowCount, crn_qty);
            if (whsType == 1) {
                for (int i = 0; i < shelves.group; i ++) {
                    curRow = shelves.start(curRow);
                    if (curRow < 0) {
                        throw new CoolException("检索库位失败,请联系管理员");
                    }
                    Integer crnNo1 = shelves.getCrnNo(curRow);
                    if (basCrnpService.checkSiteError(crnNo1, true)) {
                        crnNo = crnNo1;
                        if (curRow == 3 || curRow == 4) {
                            curRow = 3;
                        }
                        break;
                    }
                curRow = curRow + 1;
                if (curRow > eRow) {
                    curRow = sRow;
                }
                crnNo = whsType;
                basCrnpService.checkSiteStatus(crnNo, true);
//                for (int i = 0; i < shelves.group; i ++) {
//                    curRow = shelves.start(curRow);
//                    if (curRow < 0) {
//                        throw new CoolException("检索库位失败,请联系管理员");
//                    }
//                    Integer crnNo1 = shelves.getCrnNo(curRow);
//                    if (basCrnpService.checkSiteError(crnNo1, true)) {
//                        crnNo = crnNo1;
//                        if (curRow == 3 || curRow == 4) {
//                            curRow = 3;
//                        }
//                        break;
//                    }
//                }
            } else if (whsType == 2) {
                if (curRow == sRow) {
                    curRow = eRow;
@@ -245,14 +258,32 @@
                } else {
                    deepRow = curRow;
                }
                locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                if(emptyMk){
                    locMast = locMastService.queryFreeLocMastIncludeFirst(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                    if (Cools.isEmpty(locMast)){
                        locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                    }
                } else {
                    locMast = locMastService.queryFreeLocMastExceptFirst(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                }
//                locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                // 因库位移转、需预留空库位
                if (!locMastService.checkEmptyCount(locMast)) {
                    locMast = null;
                }
            }
            if (Cools.isEmpty(locMast)) {
                locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                if(emptyMk){
                    locMast = locMastService.queryFreeLocMastIncludeFirst(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                    if (Cools.isEmpty(locMast)){
                        locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                    }
                } else {
                    locMast = locMastService.queryFreeLocMastExceptFirst(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                }
//                locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
                // 因库位移转、需预留空库位
                if (!locMastService.checkEmptyCount(locMast)) {
                    locMast = null;