From bbfff1bae329b23a8ea88d4a192e9422fde7949a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 1 May 2024 19:09:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E7=B3=BB=E7=BB=9F=EF=BC=9A=E5=BA=97=E9=93=BA=E8=A3=85?= =?UTF-8?q?=E4=BF=AE=E6=97=B6=EF=BC=8C=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=BF=94=E5=9B=9E=E7=9A=84=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=8C=89=E7=85=A7=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E9=A1=BA=E5=BA=8F=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/product/service/spu/ProductSpuServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java index 9986c7e61..c98d7f3ac 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java +++ b/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 { if (CollUtil.isEmpty(ids)) { return Collections.emptyList(); } - return productSpuMapper.selectBatchIds(ids); + Map spuMap = convertMap(productSpuMapper.selectBatchIds(ids), ProductSpuDO::getId); + // 需要按照 ids 顺序返回。例如说:店铺装修选择了 [3, 1, 2] 三个商品,返回结果还是 [3, 1, 2] 这样的顺序 + return convertList(ids, spuMap::get); } @Override