商品模块代码提交
This commit is contained in:
@@ -91,6 +91,9 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
|||||||
|
|
||||||
private List<MiniAppHomeProductInfoVo> buildProductList(QueryWrapper queryWrapper) {
|
private List<MiniAppHomeProductInfoVo> buildProductList(QueryWrapper queryWrapper) {
|
||||||
List<ProductDTO> dtoList = productMapper.selectListByQueryAs(queryWrapper, ProductDTO.class);
|
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<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);
|
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));
|
Map<Long, List<ProdSkuDTO>> collect = skuList.stream().collect(Collectors.groupingBy(ProdSkuDTO::getProductId));
|
||||||
|
|||||||
Reference in New Issue
Block a user