自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-12-09 7fcabeeaf596291872949b7cb534a34f323f4ada
src/main/java/com/zy/asrs/utils/Utils.java
@@ -196,7 +196,8 @@
            } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
                return 18;
            } else {
                throw new RuntimeException("库位解析异常");
                return -1;
//                throw new RuntimeException("库位解析异常");
            }
        // 出库
        } else {
@@ -205,7 +206,8 @@
            } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
                return 30;
            } else {
                throw new RuntimeException("库位解析异常");
                return -1;
//                throw new RuntimeException("库位解析异常");
            }
        }
    }
@@ -245,13 +247,9 @@
                }
            }
        } else {
            throw new RuntimeException("库位解析异常");
//            throw new RuntimeException("库位解析异常");
        }
        return result;
    }
    public static void main(String[] args) {
        System.out.println(JSON.toJSONString(getGroupInsideLoc("2300101")));
    }
    // 内侧方向的货位  优先入库方向/优先出库方向 ===>> 反之
@@ -278,7 +276,7 @@
                }
            }
        } else {
            throw new RuntimeException("库位解析异常");
//            throw new RuntimeException("库位解析异常");
        }
        if (!Cools.isEmpty(result)) {
            Collections.reverse(result);
@@ -286,4 +284,40 @@
        return result;
    }
    // 外侧方向的货位  优先入库方向/优先出库方向 ===>> 反之
    public static List<String> getGroupOutsideLoc(String locNo){
        int row = getRow(locNo);
        List<String> result = new ArrayList<>();
        if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
            for (Integer integer : CommonService.FIRST_GROUP_ROW_LIST) {
                if (integer < row) {
                    result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2));
                } else {
                    break;
                }
            }
        } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
            List<Integer> clone = Arrays.asList(new Integer[CommonService.SECOND_GROUP_ROW_LIST.size()]);
            Collections.copy(clone, CommonService.SECOND_GROUP_ROW_LIST);
            Collections.reverse(clone);
            for (Integer integer : clone) {
                if (integer > row) {
                    result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2));
                } else {
                    break;
                }
            }
        } else {
//            throw new RuntimeException("库位解析异常");
        }
        if (!Cools.isEmpty(result)) {
            Collections.reverse(result);
        }
        return result;
    }
    public static void main(String[] args) {
        System.out.println(JSON.toJSONString(getGroupOuterLoc("0500201")));
    }
}