自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-09-20 0fc40840534f1010147982db2c3df6908f19aa00
#
1个文件已修改
54 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -64,17 +64,53 @@
    @Override
    public LocMast findOutMost(List<String> locNos) {
        List<Integer> 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);}})
        ) {
        if (!rows.retainAll(new ArrayList<Integer>() {{ add(1);add(2);add(3);}})) {
            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)));
        } else {
            rows = locNos.stream().map(item -> Integer.parseInt(item.substring(0, 2))).distinct().collect(Collectors.toList());
        }
        if (!rows.retainAll(new ArrayList<Integer>() {{ add(8);add(9);add(10);add(11);}})) {
            locNos.sort(Comparator.comparingInt(o -> Integer.parseInt(o.substring(0, 2))));
        } else {
            rows = locNos.stream().map(item -> Integer.parseInt(item.substring(0, 2))).distinct().collect(Collectors.toList());
        }
        if (!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 {
            rows = locNos.stream().map(item -> Integer.parseInt(item.substring(0, 2))).distinct().collect(Collectors.toList());
        }
        if (!rows.retainAll(new ArrayList<Integer>() {{ add(4);add(5);add(6);add(7);}})) {
            locNos.sort((o1, o2) -> Integer.parseInt(o2.substring(0, 2)) - Integer.parseInt(o1.substring(0, 2)));
        } else {
            rows = locNos.stream().map(item -> Integer.parseInt(item.substring(0, 2))).distinct().collect(Collectors.toList());
        }
        if (!rows.retainAll(new ArrayList<Integer>() {{ add(12);add(13);add(14);}})) {
            locNos.sort((o1, o2) -> Integer.parseInt(o2.substring(0, 2)) - Integer.parseInt(o1.substring(0, 2)));
        } else {
            rows = locNos.stream().map(item -> Integer.parseInt(item.substring(0, 2))).distinct().collect(Collectors.toList());
        }
        if (!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)));
        } 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")) {