商品模块代码提交

This commit is contained in:
Tankaikai 2025-02-18 18:06:27 +08:00
parent 6a48c6b345
commit ceb5343542
1 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,9 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
private List<MiniAppHomeProductInfoVo> buildProductList(QueryWrapper queryWrapper) {
List<ProductDTO> dtoList = productMapper.selectListByQueryAs(queryWrapper, ProductDTO.class);
if (CollUtil.isEmpty(dtoList)) {
return Collections.emptyList();
}
List<Long> prodIdList = dtoList.stream().map(ProductDTO::getId).distinct().toList();
List<ProdSkuDTO> skuList = prodSkuMapper.selectListByQueryAs(query().in(ProdSku::getProductId, prodIdList).eq(ProdSku::getIsDel, DeleteEnum.NORMAL.value()), ProdSkuDTO.class);
Map<Long, List<ProdSkuDTO>> collect = skuList.stream().collect(Collectors.groupingBy(ProdSkuDTO::getProductId));