自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-10-20 8578dec9ec5be0281acc87cb5cbb10458a5f0d9f
#
2个文件已修改
107 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -99,18 +99,6 @@
        } else {
            rows = locNos.stream().map(item -> Integer.parseInt(item.substring(0, 2))).distinct().collect(Collectors.toList());
        }
//        if (!rows.retainAll(new ArrayList<Integer>() {{ add(1);add(2);add(3);}})
//                || !rows.retainAll(new ArrayList<Integer>() {{ add(8);add(9);add(10);add(11);}})
//                || !rows.retainAll(new ArrayList<Integer>() {{ add(15);add(16);add(17);add(18);}})
//        ) {
//            locNos.sort(Comparator.comparingInt(o -> Integer.parseInt(o.substring(0, 2))));
//        } else if (!rows.retainAll(new ArrayList<Integer>() {{ add(4);add(5);add(6);add(7);}})
//                || !rows.retainAll(new ArrayList<Integer>() {{ add(12);add(13);add(14);}})
//                || !rows.retainAll(new ArrayList<Integer>() {{ add(19);add(20);add(21);}})
//        ) {
//            locNos.sort((o1, o2) -> Integer.parseInt(o2.substring(0, 2)) - Integer.parseInt(o1.substring(0, 2)));
//        }
        for (String locNo : locNos) {
            LocMast locMast = this.selectById(locNo);
            if (locMast.getLocSts().equals("O")) {
src/main/java/com/zy/asrs/utils/Utils.java
@@ -3,6 +3,7 @@
import com.core.common.Arith;
import com.core.common.Cools;
import com.zy.common.properties.SlaveProperties;
import com.zy.common.service.CommonService;
import java.text.DecimalFormat;
import java.util.ArrayList;
@@ -226,69 +227,6 @@
            case 20:
            case 21:
                return 21;
            default:
                throw new RuntimeException("库位解析异常");
        }
    }
    public static List<String> getGroupLoc(String locNo){
        int row = getRow(locNo);
        switch (row) {
            case 1:
            case 2:
            case 3:
                return new ArrayList<String>() {{
                    add(zerofill(String.valueOf(1), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(2), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(3), 2) + locNo.substring(2));
                }};
            case 4:
            case 5:
            case 6:
            case 7:
                return new ArrayList<String>() {{
                    add(zerofill(String.valueOf(4), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(5), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(6), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(7), 2) + locNo.substring(2));
                }};
            case 8:
            case 9:
            case 10:
            case 11:
                return new ArrayList<String>() {{
                    add(zerofill(String.valueOf(8), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(9), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(10), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(11), 2) + locNo.substring(2));
                }};
            case 12:
            case 13:
            case 14:
                return new ArrayList<String>() {{
                    add(zerofill(String.valueOf(12), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(13), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(14), 2) + locNo.substring(2));
                }};
            case 15:
            case 16:
            case 17:
            case 18:
                return new ArrayList<String>() {{
                    add(zerofill(String.valueOf(15), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(16), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(17), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(18), 2) + locNo.substring(2));
                }};
            case 19:
            case 20:
            case 21:
                return new ArrayList<String>() {{
                    add(zerofill(String.valueOf(19), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(20), 2) + locNo.substring(2));
                    add(zerofill(String.valueOf(21), 2) + locNo.substring(2));
                }};
            default:
                throw new RuntimeException("库位解析异常");
        }
@@ -531,4 +469,35 @@
        }
    }
    public static Integer getGroupRow(String locNo, Boolean pakin){
        int row = getRow(locNo);
        if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
            return pakin?17:2;
        }
        if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
            return pakin?30:18;
        }
        throw new RuntimeException("库位解析异常");
    }
    public static List<String> getGroupLoc(String locNo){
        int row = getRow(locNo);
        if (CommonService.FIRST_GROUP_ROW_LIST.contains(row)) {
            List<String> result = new ArrayList<>();
            for (Integer row0 : CommonService.FIRST_GROUP_ROW_LIST) {
                result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2));
            }
            return result;
        }
        if (CommonService.SECOND_GROUP_ROW_LIST.contains(row)) {
            List<String> result = new ArrayList<>();
            for (Integer row0 : CommonService.SECOND_GROUP_ROW_LIST) {
                result.add(zerofill(String.valueOf(row0), 2) + locNo.substring(2));
            }
            return result;
        }
        throw new RuntimeException("库位解析异常");
    }
}