Browse Source

1.修复仓库盘点任务明细导出

dist.1.3.0
zhenghaoyu 5 months ago
parent
commit
198a493888
  1. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java

9
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<QuestContrastPackageExcelVO> ls = new ArrayList();
List<QuestContrastPackageExcelVO> list = taskQuestService.exportPanDataWithPackage(questDetailDTO);
//提取出list中inventoryUser为空的元素
List<QuestContrastPackageExcelVO> inventoryUserEmptyList = list.stream()
.filter(item -> item.getInventoryUser() == null)
.collect(Collectors.toList());
//把list中所有元素通过inventoryUser进行分组
Map<Long, List<QuestContrastPackageExcelVO>> groupedByInventoryUser = list.stream()
Map<Long, List<QuestContrastPackageExcelVO>> groupedByInventoryUser = list.stream().filter(item -> !Objects.isNull(item.getInventoryUser()))
.collect(Collectors.groupingBy(QuestContrastPackageExcelVO::getInventoryUser));
groupedByInventoryUser.keySet().forEach(inventoryUser -> {
List<QuestContrastPackageExcelVO> 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);
}

Loading…
Cancel
Save