Commit bbfff1bae329b23a8ea88d4a192e9422fde7949a
1 parent
ab00986a
【修复】商城系统:店铺装修时,商品列表组件返回的商品信息,按照选择的顺序返回
Showing
1 changed file
with
3 additions
and
1 deletions
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java
| @@ -192,7 +192,9 @@ public class ProductSpuServiceImpl implements ProductSpuService { | @@ -192,7 +192,9 @@ public class ProductSpuServiceImpl implements ProductSpuService { | ||
| 192 | if (CollUtil.isEmpty(ids)) { | 192 | if (CollUtil.isEmpty(ids)) { |
| 193 | return Collections.emptyList(); | 193 | return Collections.emptyList(); |
| 194 | } | 194 | } |
| 195 | - return productSpuMapper.selectBatchIds(ids); | 195 | + Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectBatchIds(ids), ProductSpuDO::getId); |
| 196 | + // 需要按照 ids 顺序返回。例如说:店铺装修选择了 [3, 1, 2] 三个商品,返回结果还是 [3, 1, 2] 这样的顺序 | ||
| 197 | + return convertList(ids, spuMap::get); | ||
| 196 | } | 198 | } |
| 197 | 199 | ||
| 198 | @Override | 200 | @Override |