Commit 4959479ac619256dc75ebe068ed1ce445fcd6735
1 parent
743383fa
【代码修复】MALL:拼团活动的商品拼接不正确的问题
Showing
1 changed file
with
2 additions
and
1 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java
| ... | ... | @@ -68,10 +68,11 @@ public interface CombinationActivityConvert { |
| 68 | 68 | List<ProductSpuRespDTO> spuList) { |
| 69 | 69 | PageResult<CombinationActivityPageItemRespVO> pageResult = convertPage(page); |
| 70 | 70 | Map<Long, ProductSpuRespDTO> spuMap = convertMap(spuList, ProductSpuRespDTO::getId); |
| 71 | + Map<Long, List<CombinationProductDO>> productMap = convertMultiMap(productList, CombinationProductDO::getActivityId); | |
| 71 | 72 | pageResult.getList().forEach(item -> { |
| 72 | 73 | MapUtils.findAndThen(spuMap, item.getSpuId(), spu -> item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()) |
| 73 | 74 | .setMarketPrice(spu.getMarketPrice())); |
| 74 | - item.setProducts(convertList2(productList)); | |
| 75 | + item.setProducts(convertList2(productMap.get(item.getId()))); | |
| 75 | 76 | // 设置统计字段 |
| 76 | 77 | item.setGroupCount(groupCountMap.getOrDefault(item.getId(), 0)) |
| 77 | 78 | .setGroupSuccessCount(groupSuccessCountMap.getOrDefault(item.getId(), 0)) | ... | ... |