|
@@ -9,6 +9,7 @@ import cn.newfeifan.mall.module.product.controller.admin.spu.vo.*;
|
|
|
import cn.newfeifan.mall.module.product.convert.spu.ProductSpuConvert;
|
|
|
import cn.newfeifan.mall.module.product.dal.dataobject.sku.ProductSkuDO;
|
|
|
import cn.newfeifan.mall.module.product.dal.dataobject.spu.ProductSpuDO;
|
|
|
+import cn.newfeifan.mall.module.product.dal.mysql.spu.ProductSpuMapper;
|
|
|
import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
|
|
|
import cn.newfeifan.mall.module.product.service.sku.ProductSkuService;
|
|
|
import cn.newfeifan.mall.module.product.service.spu.ProductSpuService;
|
|
@@ -43,6 +44,10 @@ public class ProductSpuController {
|
|
|
@Resource
|
|
|
private ProductSkuService productSkuService;
|
|
|
|
|
|
+ //add by Ben
|
|
|
+ @Resource
|
|
|
+ private ProductSpuMapper productSpuMapper;
|
|
|
+
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建商品 SPU")
|
|
|
@PreAuthorize("@ss.hasPermission('product:spu:create')")
|
|
@@ -87,7 +92,12 @@ public class ProductSpuController {
|
|
|
}
|
|
|
// 查询商品 SKU
|
|
|
List<ProductSkuDO> skus = productSkuService.getSkuListBySpuId(spu.getId());
|
|
|
- return success(ProductSpuConvert.INSTANCE.convert(spu, skus));
|
|
|
+
|
|
|
+ String shopName = productSpuMapper.selectShopNameById(spu.getShopId());
|
|
|
+ CommonResult<ProductSpuRespVO> success = success(ProductSpuConvert.INSTANCE.convert(spu, skus));
|
|
|
+ success.getData().setShopName(shopName);
|
|
|
+
|
|
|
+ return success;
|
|
|
}
|
|
|
|
|
|
@GetMapping("/list-all-simple")
|