【修复】商城系统:店铺装修时,商品列表组件返回的商品信息,按照选择的顺序返回

This commit is contained in:
YunaiV 2024-05-01 19:09:12 +08:00
parent ab00986a1d
commit bbfff1bae3

View File

@ -192,7 +192,9 @@ public class ProductSpuServiceImpl implements ProductSpuService {
if (CollUtil.isEmpty(ids)) { if (CollUtil.isEmpty(ids)) {
return Collections.emptyList(); return Collections.emptyList();
} }
return productSpuMapper.selectBatchIds(ids); Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectBatchIds(ids), ProductSpuDO::getId);
// 需要按照 ids 顺序返回例如说店铺装修选择了 [3, 1, 2] 三个商品返回结果还是 [3, 1, 2] 这样的顺序
return convertList(ids, spuMap::get);
} }
@Override @Override