|
|
|
@ -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); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|