商品数据 空指针

This commit is contained in:
2026-04-17 14:12:12 +08:00
parent 98468c4872
commit a759e8dea0

View File

@@ -119,7 +119,7 @@ public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticM
printDTO.setTotalProductCount(BigDecimal.ZERO); printDTO.setTotalProductCount(BigDecimal.ZERO);
printDTO.setTotalActualAmount(BigDecimal.ZERO); printDTO.setTotalActualAmount(BigDecimal.ZERO);
} }
if(CollUtil.isNotEmpty(prodStatisticList)){
// 4. 先按分类ID分组商品 // 4. 先按分类ID分组商品
Map<Long, List<ShopProdStatistic>> groupByCategory = prodStatisticList.stream() Map<Long, List<ShopProdStatistic>> groupByCategory = prodStatisticList.stream()
.collect(Collectors.groupingBy(ShopProdStatistic::getCategoryId)); .collect(Collectors.groupingBy(ShopProdStatistic::getCategoryId));
@@ -164,8 +164,8 @@ public class ShopProdStatisticServiceImpl extends ServiceImpl<ShopProdStatisticM
categoryItems.add(categoryItem); categoryItems.add(categoryItem);
} }
printDTO.setItems(categoryItems); printDTO.setItems(categoryItems);
}
rabbitPublisher.sendOtherPrintMsg(param.getShopId(), printDTO, "PRODUCT_REPORT"); rabbitPublisher.sendOtherPrintMsg(param.getShopId(), printDTO, "PRODUCT_REPORT");
} }