自动化立体仓库 - WMS系统
Junjie
2024-02-19 f3603d9f0eb85d2a42edbcadd0950889af2c24d2
src/main/java/com/zy/common/model/OutLocDto.java
@@ -69,4 +69,69 @@
        return sameNumber == locDetls.size();
    }
    public void sortLocDetlDtos() {
        ArrayList<LocDetlDto> list = new ArrayList<>();
        EntityWrapper<LocDetl> wrapper = new EntityWrapper<>();
        wrapper.eq("loc_no", locNo);
        LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class);
        List<LocDetl> locDetls = locDetlService.selectList(wrapper);
        for (LocDetl locDetl : locDetls) {
            boolean flag = true;
            for (LocDetlDto locDetlDto : locDetlDtos) {
                LocDetl detl = locDetlDto.getLocDetl();
                if (!Cools.isEmpty(locDetl.getMatnr())) {
                    if (!locDetl.getMatnr().equals(detl.getMatnr())) {
                        continue;
                    }
                }
                if (!Cools.isEmpty(locDetl.getBatch())) {
                    if (!locDetl.getBatch().equals(detl.getBatch())) {
                        continue;
                    }
                }
                if (!Cools.isEmpty(locDetl.getSuppCode())) {
                    if (!locDetl.getSuppCode().equals(detl.getSuppCode())) {
                        continue;
                    }
                }
                flag = false;
                break;
            }
            if (flag) {
                LocDetlDto dto = new LocDetlDto(locDetl, 0D);
                list.add(dto);
            }
        }
        locDetlDtos.addAll(list);
//        ArrayList<String> matnr = new ArrayList<>();
//        ArrayList<String> batch = new ArrayList<>();
//        ArrayList<String> suppCode = new ArrayList<>();
//        for (LocDetlDto locDetlDto : locDetlDtos) {
//            LocDetl locDetl = locDetlDto.getLocDetl();
//            if (!Cools.isEmpty(locDetl.getMatnr())) {
//                matnr.add(locDetl.getMatnr());
//            }
//            if (!Cools.isEmpty(locDetl.getBatch())) {
//                batch.add(locDetl.getBatch());
//            }
//            if (!Cools.isEmpty(locDetl.getSuppCode())) {
//                suppCode.add(locDetl.getSuppCode());
//            }
//        }
//
//        EntityWrapper<LocDetl> wrapper = new EntityWrapper<>();
//        wrapper.eq("loc_no", locNo);
//        wrapper.notIn("matnr", matnr);
//        wrapper.notIn("batch", batch);
//        wrapper.notIn("supp_code", suppCode);
//        LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class);
//        List<LocDetl> locDetls = locDetlService.selectList(wrapper);
//        for (LocDetl locDetl : locDetls) {
//            LocDetlDto dto = new LocDetlDto(locDetl, 0D);
//            locDetlDtos.add(dto);
//        }
    }
}