自动化立体仓库 - WMS系统
#
luxiaotao1123
2023-02-14 9005c4de52890ee0e49c3f71759f5c3dccaf1f50
src/main/java/com/zy/asrs/utils/Utils.java
@@ -234,17 +234,17 @@
    public static List<String> getGroupOuterLoc(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 (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
            for (Integer integer : CommonService.SECOND_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);
        } else if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
            List<Integer> clone = Arrays.asList(new Integer[CommonService.FIRST_GROUP_ROW_LIST.size()]);
            Collections.copy(clone, CommonService.FIRST_GROUP_ROW_LIST);
            Collections.reverse(clone);
            for (Integer integer : clone) {
                if (integer > row) {
@@ -259,13 +259,17 @@
        return result;
    }
    public static void main(String[] args) {
        System.out.println(JSON.toJSONString(getGroupOuterLoc("0200101")));
    }
    // 内侧方向的货位  优先入库方向/优先出库方向 ===>> 反之
    public static List<String> getGroupInsideLoc(String locNo){
        int row = getRow(locNo);
        List<String> result = new ArrayList<>();
        if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
            List<Integer> clone = Arrays.asList(new Integer[CommonService.FIRST_GROUP_ROW_LIST.size()]);
            Collections.copy(clone, CommonService.FIRST_GROUP_ROW_LIST);
        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) {
@@ -274,8 +278,8 @@
                    break;
                }
            }
        } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
            for (Integer integer : CommonService.SECOND_GROUP_ROW_LIST) {
        } else 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 {
@@ -295,17 +299,17 @@
    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 (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
            for (Integer integer : CommonService.SECOND_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);
        } else if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
            List<Integer> clone = Arrays.asList(new Integer[CommonService.FIRST_GROUP_ROW_LIST.size()]);
            Collections.copy(clone, CommonService.FIRST_GROUP_ROW_LIST);
            Collections.reverse(clone);
            for (Integer integer : clone) {
                if (integer > row) {
@@ -321,10 +325,6 @@
            Collections.reverse(result);
        }
        return result;
    }
    public static void main(String[] args) {
        System.out.println(JSON.toJSONString(getGroupOuterLoc("0500201")));
    }
}