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,10 +68,11 @@ public interface CombinationActivityConvert { | ||
| 68 | List<ProductSpuRespDTO> spuList) { | 68 | List<ProductSpuRespDTO> spuList) { |
| 69 | PageResult<CombinationActivityPageItemRespVO> pageResult = convertPage(page); | 69 | PageResult<CombinationActivityPageItemRespVO> pageResult = convertPage(page); |
| 70 | Map<Long, ProductSpuRespDTO> spuMap = convertMap(spuList, ProductSpuRespDTO::getId); | 70 | Map<Long, ProductSpuRespDTO> spuMap = convertMap(spuList, ProductSpuRespDTO::getId); |
| 71 | + Map<Long, List<CombinationProductDO>> productMap = convertMultiMap(productList, CombinationProductDO::getActivityId); | ||
| 71 | pageResult.getList().forEach(item -> { | 72 | pageResult.getList().forEach(item -> { |
| 72 | MapUtils.findAndThen(spuMap, item.getSpuId(), spu -> item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()) | 73 | MapUtils.findAndThen(spuMap, item.getSpuId(), spu -> item.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()) |
| 73 | .setMarketPrice(spu.getMarketPrice())); | 74 | .setMarketPrice(spu.getMarketPrice())); |
| 74 | - item.setProducts(convertList2(productList)); | 75 | + item.setProducts(convertList2(productMap.get(item.getId()))); |
| 75 | // 设置统计字段 | 76 | // 设置统计字段 |
| 76 | item.setGroupCount(groupCountMap.getOrDefault(item.getId(), 0)) | 77 | item.setGroupCount(groupCountMap.getOrDefault(item.getId(), 0)) |
| 77 | .setGroupSuccessCount(groupSuccessCountMap.getOrDefault(item.getId(), 0)) | 78 | .setGroupSuccessCount(groupSuccessCountMap.getOrDefault(item.getId(), 0)) |