From 5e9043203970b69f483c795f034f1e04ae149faf Mon Sep 17 00:00:00 2001 From: Diss <1157651603@qq.com> Date: Wed, 10 Jan 2024 17:48:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=A8=E5=BA=93=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AF=BC=E5=87=BA=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionStockArticleServiceImpl.java | 43 +++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index deb186be4..7a8ed85a5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -165,19 +165,36 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl list = baseMapper.exportDistributionStockArticle(paramMap, idArr); List excelList = new ArrayList<>(); - list.parallelStream().forEach(li -> { - li.setCreateUserName(userClient.userInfoById(li.getCreateUser()).getData().getName()); - DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(li); - DistributionStockArticleExcel excel = new DistributionStockArticleExcel(); - if (distributionStockArticleVO.getTotalNumber() != null && - distributionStockArticleVO.getHandQuantity() != null) { - distributionStockArticleVO.setUnreceivedQuantity( - distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getHandQuantity() - ); - } - BeanUtil.copyProperties(distributionStockArticleVO,excel); - excelList.add(excel); - }); + if (list.size()>61){ + list.parallelStream().forEach(li -> { + li.setCreateUserName(userClient.userInfoById(li.getCreateUser()).getData().getName()); + DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(li); + DistributionStockArticleExcel excel = new DistributionStockArticleExcel(); + if (distributionStockArticleVO.getTotalNumber() != null && + distributionStockArticleVO.getIncomingNum() != null) { + distributionStockArticleVO.setUnreceivedQuantity( + distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getIncomingNum() + ); + } + BeanUtil.copyProperties(distributionStockArticleVO,excel); + excelList.add(excel); + }); + }else { + list.forEach(li -> { + li.setCreateUserName(userClient.userInfoById(li.getCreateUser()).getData().getName()); + DistributionStockArticleVO distributionStockArticleVO = DistributionStockArticleWrapper.build().entityVO(li); + DistributionStockArticleExcel excel = new DistributionStockArticleExcel(); + if (distributionStockArticleVO.getTotalNumber() != null && + distributionStockArticleVO.getIncomingNum() != null) { + distributionStockArticleVO.setUnreceivedQuantity( + distributionStockArticleVO.getTotalNumber() - distributionStockArticleVO.getIncomingNum() + ); + } + BeanUtil.copyProperties(distributionStockArticleVO,excel); + excelList.add(excel); + }); + } + return excelList; }