瀏覽代碼

Merge branch 'dev/2024/0420/update-business' of Harper/feifan-backend-zx-business into master

修改商品多规格没有shopId和merId
Yangzw 11 月之前
父節點
當前提交
513305f1e9

+ 5 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuServiceImpl.java

@@ -127,6 +127,11 @@ public class ProductSpuServiceImpl implements ProductSpuService {
         // 更新 SPU
         ProductSpuDO updateObj = BeanUtils.toBean(updateReqVO, ProductSpuDO.class);
         initSpuFromSkus(updateObj, skuSaveReqList);
+
+        for (ProductSkuSaveReqVO productSkuSaveReqVO : skuSaveReqList) {
+            productSkuSaveReqVO.setShopId(updateReqVO.getShopId());
+            productSkuSaveReqVO.setMerchantId(updateReqVO.getMerchantId());
+        }
         productSpuMapper.updateById(updateObj);
         // 批量更新 SKU
         productSkuService.updateSkuList(updateObj.getId(), updateReqVO.getSkus());