自动化立体仓库 - WMS系统
#
18516761980
2023-04-02 513226395524df174afda0f59dd5586926d457c5
#
2个文件已修改
31 ■■■■ 已修改文件
src/main/java/com/zy/asrs/utils/Utils.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java
@@ -88,7 +88,14 @@
    public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
        int row = getRow(deepLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
        int shallowRow ;
        if (row == 15 || row == 9) {
            shallowRow = row + 1;
        } else if (row == 12 || row==18) {
            shallowRow = row - 1;
        } else {
            throw new RuntimeException(row + "不是浅库位,系统繁忙");
        }
        return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2);
    }
@@ -107,12 +114,12 @@
        int row = getRow(shallowLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int targetRow;
        if (remainder == 2) {
        if (row == 10 || row == 16) {
            targetRow = row - 1;
        } else if (remainder == 3) {
        } else if (row == 11 || row == 17) {
            targetRow = row + 1;
        } else {
            throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙");
            throw new RuntimeException(row + "不是浅库位排,系统繁忙");
        }
        return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
    }
@@ -123,11 +130,7 @@
    public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) {
        int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount());
        int targetRow;
        if (remainder == 2) {
            targetRow = shallowRow - 1;
        } else if (remainder == 3) {
            targetRow = shallowRow + 1;
        } else if (shallowRow == 10 || shallowRow == 16) {
        if (shallowRow == 10 || shallowRow == 16) {
            targetRow = shallowRow - 1;
        } else if (shallowRow == 11 || shallowRow == 17) {
            targetRow = shallowRow + 1;
src/main/java/com/zy/common/service/CommonService.java
@@ -146,7 +146,7 @@
        LocMast locMast = null;
        // 靠近摆放规则 --- 同天同规格物料
        if (!Cools.isEmpty(matNos)) {
        if (!Cools.isEmpty(matNos) && (whsType==2 || whsType==4)) {
            List<String> locNos = locDetlService.getSameDetlToday(matNos.get(0), sRow, eRow);
            for (String locNo : locNos) {
                if (Utils.isShallowLoc(slaveProperties, locNo)) {
@@ -168,7 +168,7 @@
        }
        // 靠近摆放规则 --- 空托
        if (staDescId == 10) {
        if (staDescId == 10  && (whsType==2 || whsType==4)) {
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
            if (locMasts.size() > 0) {
                for (LocMast loc : locMasts) {
@@ -257,7 +257,7 @@
        // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排
        if (locMast == null) {
            if (Utils.isShallowLoc(slaveProperties, curRow)) {
            if ((whsType==2 || whsType==4) && Utils.isShallowLoc(slaveProperties, curRow)) {
                Integer deepRow = Utils.getDeepRow(slaveProperties, curRow);
                locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1());
                // todo:luxiaotao 如果用浅排找到的深库位,那么则需要判断这个深库位对应的浅库位是否有货(F、X、D)
@@ -273,14 +273,14 @@
                    locMast = null;
                }
                // 目标库位 ===>> 浅库位, 则校验其深库位是否为 F D X
                if (null != locMast && Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) {
                if ((whsType==2 || whsType==4) && null != locMast && Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) {
                    LocMast deepLoc = locMastService.selectById(Utils.getDeepLoc(slaveProperties, locMast.getLocNo()));
                    if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) {
                        locMast = null;
                    }
                }
                // 目标库位 ===>> 深库位, 则校验其浅库位是否为 O
                if (null != locMast && Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) {
                if ((whsType==2 || whsType==4) && null != locMast && Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) {
                    LocMast shallowLoc = locMastService.selectById(Utils.getShallowLoc(slaveProperties, locMast.getLocNo()));
                    if (!shallowLoc.getLocSts().equals("O")) {
                        locMast = null;