From 58ef8819fb6ef413b7f3ed005a718b2dbb50e361 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Mon, 18 Apr 2022 16:58:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E6=B8=85=E5=8D=95--=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=AA=8C=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DummyInventoryInfoEOServiceImpl.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java index a2fdbde13..1ea7bcd8f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java @@ -86,12 +86,34 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl dummyInventoryInfoEOS = this.list(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.in(BussDocumentLibraryEO::getId, Arrays.asList(dummyInventoryInfoEO.getIds().split(","))); List bussDocumentLibraryEOList = iBussDocumentLibraryEOService.list(wrapper); + List serialNumberList = new ArrayList<>(); + if(bussDocumentLibraryEOList.size() != 0){ + serialNumberList = bussDocumentLibraryEOList.stream().map(BussDocumentLibraryEO::getSerialNumber).collect(Collectors.toList()); + } + + //需要验重(验重--已添加过的不能再添加,提示该标准已存在清单中,不可添加) + if(dummyInventoryInfoEOS.size() != 0 && serialNumberList.size() != 0){ + List finalSerialNumberList = serialNumberList; + List collect = dummyInventoryInfoEOS.stream() + .filter(e -> finalSerialNumberList.contains(e.getSerialNumber())).collect(Collectors.toList()); + List serialNumberListTemp = collect.stream().map(DummyInventoryInfoEO::getSerialNumber).collect(Collectors.toList()); + if(serialNumberListTemp.size() > 0){ + if(CutEnum.CN.getValue().equals(dummyInventoryInfoEO.getCut())){ + throw new JeroBootException(StringUtils.join(serialNumberListTemp,",") + "已存在不能重复添加,请重新选择"); + }else{ + throw new JeroBootException(StringUtils.join(serialNumberListTemp,",") + "Already exists and cannot be added again"); + } + } + } + List list = new ArrayList<>(); for (BussDocumentLibraryEO bussDocumentLibraryEO : bussDocumentLibraryEOList) { DummyInventoryInfoEO dummyInventoryInfoEOTemp = new DummyInventoryInfoEO();