自动化立体仓库 - WMS系统
LSH
2023-07-24 485dabe1952c39eeb83291247e9ee1fe77a51df1
src/main/java/com/zy/asrs/utils/Utils.java
@@ -60,6 +60,29 @@
    }
    /**
     * 判断是否为左深库位
     */
    public static boolean isDeepLocLeft(SlaveProperties slaveProperties, Integer row){
        if (slaveProperties.isDoubleDeep()) {
            return slaveProperties.getDoubleLocsLeft().contains(row);
        } else {
            return false;
        }
    }
    /**
     * 判断是否为右深库位
     */
    public static boolean isDeepLocRight(SlaveProperties slaveProperties, Integer row){
        if (slaveProperties.isDoubleDeep()) {
            return slaveProperties.getDoubleLocsRight().contains(row);
        } else {
            return false;
        }
    }
    /**
     * 判断是否为浅库位
     */
    public static boolean isShallowLoc(SlaveProperties slaveProperties, String locNo){
@@ -88,14 +111,7 @@
    public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
        int row = getRow(deepLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int shallowRow;
        if (row==9 || row==15){
            shallowRow=row+1;
        }else if (row==12 || row==18){
            shallowRow=row-1;
        }else {
            throw new RuntimeException(row + "不是深库位,系统繁忙");
        }
        int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
        return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2);
    }
@@ -114,9 +130,9 @@
        int row = getRow(shallowLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int targetRow;
        if (row == 10 || row == 16) {
        if (remainder == 2) {
            targetRow = row - 1;
        } else if (row == 11 || row == 17) {
        } else if (remainder == 3) {
            targetRow = row + 1;
        } else {
            throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙");
@@ -133,10 +149,6 @@
        if (remainder == 2) {
            targetRow = shallowRow - 1;
        } else if (remainder == 3) {
            targetRow = shallowRow + 1;
        } else if (shallowRow == 10 || shallowRow == 16) {
            targetRow = shallowRow - 1;
        } else if (shallowRow == 11 || shallowRow == 17) {
            targetRow = shallowRow + 1;
        } else {
            throw new RuntimeException(shallowRow + "不是浅库位排,系统繁忙");