| | |
| | | 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); |
| | | // } |
| | | } |
| | | |
| | | } |