From 0569ea589a76439470113c8453f3f3f17b4bbb55 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期三, 10 一月 2024 16:22:51 +0800 Subject: [PATCH] #文件读取优化 --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 94 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 66 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index 31c8325..492a301 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -2907,43 +2907,81 @@ ledCommand.setBarcode(barcode); if (ioType != 110 && ioType != 10) { List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", sourceLocNo)); - locDetls.forEach(locDetl -> { - Wrapper<WrkDetl> wrapper = new EntityWrapper<WrkDetl>().eq("matnr", locDetl.getMatnr()).eq("wrk_no", wrkNo); - Utils.wapperSetCondition(wrapper, "batch", locDetl.getBatch()); - Utils.wapperSetCondition(wrapper, "three_code", locDetl.getThreeCode()); - Utils.wapperSetCondition(wrapper, "dead_time", locDetl.getDeadTime()); - Utils.wapperSetCondition(wrapper, "supp_code", locDetl.getSuppCode());//鏂欑鐮� - List<WrkDetl> detl = wrkDetlService.selectList(wrapper); - if (Cools.isEmpty(detl)) { - String suppCode = ""; - if (locDetl.getSuppCode() != null) { - suppCode = locDetl.getSuppCode(); - } - ledCommand.getMatDtos().add(new MatDto(locDetl.getMatnr(), locDetl.getMaktx(), 0D, locDetl.getAnfme(), locDetl.getSpecs(), suppCode)); - } else { - //鍑哄簱鏁伴噺绱 - Double conut = 0.0; - for (WrkDetl wrkDetl : detl) { - conut = conut + wrkDetl.getAnfme(); - } - - for (WrkDetl wrkDetl : detl) { + if (ioType == 101) { + List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkNo)); + wrkDetls.forEach(wrkDetl -> { + ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), 0D, wrkDetl.getSpecs(), wrkDetl.getSuppCode())); + }); +// locDetls.forEach(locDetl -> { +// Wrapper<WrkDetl> wrapper = new EntityWrapper<WrkDetl>().eq("matnr", locDetl.getMatnr()).eq("wrk_no", wrkNo); +// Utils.wapperSetCondition(wrapper, "batch", locDetl.getBatch()); +// Utils.wapperSetCondition(wrapper, "three_code", locDetl.getThreeCode()); +// Utils.wapperSetCondition(wrapper, "dead_time", locDetl.getDeadTime()); +// Utils.wapperSetCondition(wrapper, "supp_code", locDetl.getSuppCode());//鏂欑鐮� +// List<WrkDetl> detl = wrkDetlService.selectList(wrapper); +// if (Cools.isEmpty(detl)) { +// String suppCode = ""; +// if (locDetl.getSuppCode() != null) { +// suppCode = locDetl.getSuppCode(); +// } +// ledCommand.getMatDtos().add(new MatDto(locDetl.getMatnr(), locDetl.getMaktx(), 0D, locDetl.getAnfme(), locDetl.getSpecs(), suppCode)); +// } else { +// //鍑哄簱鏁伴噺绱 +// Double conut = 0.0; +// for (WrkDetl wrkDetl : detl) { +// conut = conut + wrkDetl.getAnfme(); +// } +// +// for (WrkDetl wrkDetl : detl) { +// String suppCode = ""; +// if (wrkDetl.getSuppCode() != null) { +// suppCode = wrkDetl.getSuppCode(); +// } +// ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), (locDetl.getAnfme() - conut), wrkDetl.getSpecs(), suppCode, wrkDetl.getOrderNo())); +// } +// } +// +// }); + } else { + locDetls.forEach(locDetl -> { + Wrapper<WrkDetl> wrapper = new EntityWrapper<WrkDetl>().eq("matnr", locDetl.getMatnr()).eq("wrk_no", wrkNo); + Utils.wapperSetCondition(wrapper, "batch", locDetl.getBatch()); + Utils.wapperSetCondition(wrapper, "three_code", locDetl.getThreeCode()); + Utils.wapperSetCondition(wrapper, "dead_time", locDetl.getDeadTime()); + Utils.wapperSetCondition(wrapper, "supp_code", locDetl.getSuppCode());//鏂欑鐮� + List<WrkDetl> detl = wrkDetlService.selectList(wrapper); + if (Cools.isEmpty(detl)) { String suppCode = ""; - if (wrkDetl.getSuppCode() != null) { - suppCode = wrkDetl.getSuppCode(); + if (locDetl.getSuppCode() != null) { + suppCode = locDetl.getSuppCode(); } - ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), (locDetl.getAnfme() - conut), wrkDetl.getSpecs(), suppCode, wrkDetl.getOrderNo())); - } - } + ledCommand.getMatDtos().add(new MatDto(locDetl.getMatnr(), locDetl.getMaktx(), 0D, locDetl.getAnfme(), locDetl.getSpecs(), suppCode)); + } else { + //鍑哄簱鏁伴噺绱 + Double conut = 0.0; + for (WrkDetl wrkDetl : detl) { + conut = conut + wrkDetl.getAnfme(); + } - }); + for (WrkDetl wrkDetl : detl) { + String suppCode = ""; + if (wrkDetl.getSuppCode() != null) { + suppCode = wrkDetl.getSuppCode(); + } + ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), 0D, wrkDetl.getSpecs(), suppCode, wrkDetl.getOrderNo())); + } + } + + }); + } + if (ioType == 107) { locDetls = new ArrayList<>(); ledCommand.setMatDtos(new ArrayList<>()); } - if (locDetls.isEmpty()) { + if (locDetls.isEmpty() && ioType != 101) { List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkNo)); wrkDetls.forEach(wrkDetl -> { ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(), wrkDetl.getAnfme(), wrkDetl.getSpecs(), wrkDetl.getSuppCode())); -- Gitblit v1.9.1