自动化立体仓库 - WMS系统
lty
2025-05-11 c6fae49294b74658ce258d7dbb8442124e54fef5
src/main/java/com/zy/asrs/utils/Utils.java
@@ -122,7 +122,8 @@
    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 = remainder == 1 ? (row + 1) : (row - 1);
        int shallowRow = row;
        return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2);
    }
@@ -141,13 +142,14 @@
        int row = getRow(shallowLoc);
        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
        int targetRow;
        if (remainder == 2) {
            targetRow = row - 1;
        } else if (remainder == 3) {
            targetRow = row + 1;
        } else {
            throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙");
        }
//        if (remainder == 2) {
//            targetRow = row - 1;
//        } else if (remainder == 3) {
//            targetRow = row + 1;
//        } else {
//            throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙");
//        }
        targetRow = row;
        return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
    }
@@ -279,7 +281,7 @@
    //库位排号分配
    public static int[] LocNecessaryParameters(Integer whsType, Integer curRow, Integer crnNumber) {
        switch (whsType){
        switch (2){
            case 1://经典双伸库位
                return LocNecessaryParametersDoubleExtension(whsType, curRow, crnNumber); //已完善
            case 2://经典单伸库位(2排货架)
@@ -395,6 +397,7 @@
        RowLastnoService rowLastnoService = SpringUtils.getBean(RowLastnoService.class);
        RowLastno rowLastno = rowLastnoService.selectById(whsType);
        Integer sRow = rowLastno.getsRow();
        Integer eRow = rowLastno.geteRow();
        Integer sCrnNo = rowLastno.getsCrnNo();
        // 判断仓库类型是否满足要求
@@ -403,7 +406,7 @@
            // 计算最深库位排和最浅库位排
            int minRow = sRow;  // 起始排号
            int maxRow = sRow + 7;  // 终止排号 (8排)
            int maxRow = eRow;  //
            // 检查排号范围是否合法
            if (curRow < minRow || curRow > maxRow) {