ytfl
3 天以前 04806e6ef049cd644023731fd48202d36355375b
src/main/java/com/zy/asrs/utils/Utils.java
@@ -122,7 +122,25 @@
        }
        return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
    }
    /**
     * 获取 浅库位对应的深库位号,如果没有深库位,则返回为空
     */
    public static String getDeepLoc2(SlaveProperties slaveProperties, String shallowLoc) {
        int row = getRow(shallowLoc);
        boolean deepLoc = isDeepLoc(slaveProperties, row);//判断是否为深库位
        if (deepLoc) {
            return null;
        }
        if (row == 1 || row == 6) {
            return null;
        }
        //2,8,11,15,19,23
        if (row == 5 || row == 8 || row == 12 || row == 16 || row == 20 || row == 24) {
            return zerofill(String.valueOf(row - 1), 2) + shallowLoc.substring(2);
        } else {
            return zerofill(String.valueOf(row + 1), 2) + shallowLoc.substring(2);
        }
    }
    /**
     * 获取 浅库位排对应的深库位排
     */
@@ -164,6 +182,24 @@
    }
    /**
     * 通过库位号获取所在巷道
     */
    public static int getLaneByLocNo(String locNo) {
        int row = Utils.getRow(locNo);
        switch (row) {
            case 1:
            case 2:
            case 3:
                return 1;
            case 4:
            case 5:
            case 6:
                return 2;
        }
        return 0;
    }
    public static void main(String[] args) {
        SlaveProperties slaveProperties = new SlaveProperties();
        slaveProperties.setDoubleDeep(true);