|
@@ -137,7 +137,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
// 获得商品信息
|
|
// 获得商品信息
|
|
|
- List<ProductSpuDO> list = productSpuMapper.selectBatchIds(ids);
|
|
|
|
|
|
|
+ List<ProductSpuDO> list = productSpuMapper.selectByIds(ids);
|
|
|
Map<Long, ProductSpuDO> spuMap = CollectionUtils.convertMap(list, ProductSpuDO::getId);
|
|
Map<Long, ProductSpuDO> spuMap = CollectionUtils.convertMap(list, ProductSpuDO::getId);
|
|
|
// 校验
|
|
// 校验
|
|
|
ids.forEach(id -> {
|
|
ids.forEach(id -> {
|
|
@@ -202,7 +202,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
|
|
if (CollUtil.isEmpty(ids)) {
|
|
if (CollUtil.isEmpty(ids)) {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
- Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectBatchIds(ids), ProductSpuDO::getId);
|
|
|
|
|
|
|
+ Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectByIds(ids), ProductSpuDO::getId);
|
|
|
// 需要按照 ids 顺序返回。例如说:店铺装修选择了 [3, 1, 2] 三个商品,返回结果还是 [3, 1, 2] 这样的顺序
|
|
// 需要按照 ids 顺序返回。例如说:店铺装修选择了 [3, 1, 2] 三个商品,返回结果还是 [3, 1, 2] 这样的顺序
|
|
|
return convertList(ids, spuMap::get);
|
|
return convertList(ids, spuMap::get);
|
|
|
}
|
|
}
|