From 198a4938883041f9a1a492094bd0cdc1b8c3eed0 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 21 Aug 2024 09:52:14 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E4=BB=93=E5=BA=93=E7=9B=98?= =?UTF-8?q?=E7=82=B9=E4=BB=BB=E5=8A=A1=E6=98=8E=E7=BB=86=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/warehouse/controller/TaskQuestController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java index 7404df82e..29e548249 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java @@ -235,8 +235,13 @@ public class TaskQuestController extends BladeController { String questNum = questDetailDTO.getQuestNum(); List ls = new ArrayList(); List list = taskQuestService.exportPanDataWithPackage(questDetailDTO); + //提取出list中inventoryUser为空的元素 + List inventoryUserEmptyList = list.stream() + .filter(item -> item.getInventoryUser() == null) + .collect(Collectors.toList()); + //把list中所有元素通过inventoryUser进行分组 - Map> groupedByInventoryUser = list.stream() + Map> groupedByInventoryUser = list.stream().filter(item -> !Objects.isNull(item.getInventoryUser())) .collect(Collectors.groupingBy(QuestContrastPackageExcelVO::getInventoryUser)); groupedByInventoryUser.keySet().forEach(inventoryUser -> { List questContrastPackageExcelVOS = groupedByInventoryUser.get(inventoryUser); @@ -249,6 +254,8 @@ public class TaskQuestController extends BladeController { ls.addAll(questContrastPackageExcelVOS); }); + ls.addAll(inventoryUserEmptyList); + ExcelUtil.export(response, "盘点任务【"+questNum+"】数据" + DateUtil.time(), "盘点明细数据表", ls, QuestContrastPackageExcelVO.class); }