| | |
| | | } |
| | | return result; |
| | | } |
| | | if (CommonService.FIRST_GROUP_ROW_LIST_SHORT.contains(row)) { |
| | | List<String> result = new ArrayList<>(); |
| | | for (Integer row0 : CommonService.FIRST_GROUP_ROW_LIST_SHORT) { |
| | | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); |
| | | } |
| | | return result; |
| | | } |
| | | if (CommonService.THIRD_GROUP_ROW_LIST.contains(row)) { |
| | | List<String> result = new ArrayList<>(); |
| | | for (Integer row0 : CommonService.THIRD_GROUP_ROW_LIST) { |
| | | result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2)); |
| | | } |
| | | return result; |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public static Integer getInnermostRow(String locNo){ |
| | | int row = getRow(locNo); |
| | | switch (row) { |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | return 1; |
| | | case 5: |
| | | case 6: |
| | | case 7: |
| | | case 8: |
| | | case 9: |
| | | case 10: |
| | | case 11: |
| | | return 11; |
| | | default: |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | } |
| | | |
| | | public static List<Integer> getGroupLoc(Integer row){ |
| | | if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) { |
| | | return CommonService.FIRST_GROUP_ROW_LIST; |
| | | } else if (CommonService.FIRST_GROUP_ROW_LIST_SHORT.contains(row)) { |
| | | return CommonService.FIRST_GROUP_ROW_LIST_SHORT; |
| | | } else if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) { |
| | | return CommonService.SECOND_GROUP_ROW_LIST; |
| | | } else if (CommonService.THIRD_GROUP_ROW_LIST.contains(row)) { |
| | | return CommonService.THIRD_GROUP_ROW_LIST; |
| | | } else { |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | // 外侧方向的货位 优先入库方向/优先出库方向 |
| | | public static List<String> getGroupOuterLocIoPri(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.FIRST_GROUP_ROW_LIST_SHORT.contains(row)){ |
| | | for (Integer integer : CommonService.FIRST_GROUP_ROW_LIST_SHORT) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } else 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.THIRD_GROUP_ROW_LIST.contains(row)){ |
| | | List<Integer> clone = Arrays.asList(new Integer[CommonService.THIRD_GROUP_ROW_LIST.size()]); |
| | | Collections.copy(clone, CommonService.THIRD_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; |
| | | } |
| | | } |
| | | } |
| | | 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.SECOND_GROUP_ROW_LIST.contains(row)) { |
| | | 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) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } else if (CommonService.FIRST_GROUP_ROW_LIST_SHORT.contains(row)) { |
| | | List<Integer> clone = Arrays.asList(new Integer[CommonService.FIRST_GROUP_ROW_LIST_SHORT.size()]); |
| | | Collections.copy(clone, CommonService.FIRST_GROUP_ROW_LIST_SHORT); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | 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); |
| | |
| | | break; |
| | | } |
| | | } |
| | | } else if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer integer : CommonService.FIRST_GROUP_ROW_LIST) { |
| | | } else if (CommonService.THIRD_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer integer : CommonService.THIRD_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | |
| | | public static List<String> getGroupOutsideLoc(String locNo){ |
| | | int row = getRow(locNo); |
| | | List<String> result = new ArrayList<>(); |
| | | if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer integer : CommonService.SECOND_GROUP_ROW_LIST) { |
| | | if (CommonService.THIRD_GROUP_ROW_LIST.contains(row)) { |
| | | for (Integer integer : CommonService.THIRD_GROUP_ROW_LIST) { |
| | | if (integer < row) { |
| | | result.add(zerofill(String.valueOf(integer), 2) + locNo.substring(2)); |
| | | } else { |
| | |
| | | break; |
| | | } |
| | | } |
| | | } else if (CommonService.FIRST_GROUP_ROW_LIST_SHORT.contains(row)) { |
| | | List<Integer> clone = Arrays.asList(new Integer[CommonService.FIRST_GROUP_ROW_LIST_SHORT.size()]); |
| | | Collections.copy(clone, CommonService.FIRST_GROUP_ROW_LIST_SHORT); |
| | | Collections.reverse(clone); |
| | | for (Integer integer : clone) { |
| | | 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("库位解析异常"); |
| | | } |