diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java index c8172d157..ea9e97c81 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java @@ -2,12 +2,10 @@ package cn.iocoder.yudao.module.product.service.sku; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyCreateReqVO; import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyRespVO; -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuBaseVO; -import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateReqVO; +import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO; import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuPageReqVO; import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuUpdateReqVO; import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; @@ -90,7 +88,7 @@ public class ProductSkuServiceImpl implements ProductSkuService { } @Override - public void validateSkus(List list) { + public void validateSkus(List list) { List skuPropertyList = list.stream().flatMap(p -> Optional.of(p.getProperties()).orElse(new ArrayList<>()).stream()).collect(Collectors.toList()); // 校验规格属性以及规格值是否存在 List propertyIds = skuPropertyList.stream().map(ProductSkuBaseVO.Property::getPropertyId).collect(Collectors.toList()); 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 1ff0a0340..4fad20bbd 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 @@ -56,7 +56,7 @@ public class ProductSpuServiceImpl implements ProductSpuService { // 校验分类 categoryService.validateProductCategory(createReqVO.getCategoryId()); // 校验SKU - List skuCreateReqList = createReqVO.getSkus(); + List skuCreateReqList = createReqVO.getSkus(); if(createReqVO.getSpecType() == 1) { productSkuService.validateSkus(skuCreateReqList); } @@ -78,7 +78,7 @@ public class ProductSpuServiceImpl implements ProductSpuService { // 校验分类 categoryService.validateProductCategory(updateReqVO.getCategoryId()); // 校验SKU - List skuCreateReqList = updateReqVO.getSkus(); + List skuCreateReqList = updateReqVO.getSkus(); if(updateReqVO.getSpecType() == 1) { productSkuService.validateSkus(skuCreateReqList); }