diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/model/vo/PromotionFeeVO.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/model/vo/PromotionFeeVO.java index df5df57e..905f23fd 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/model/vo/PromotionFeeVO.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/model/vo/PromotionFeeVO.java @@ -56,6 +56,18 @@ public class PromotionFeeVO { @Schema(description = "商品ID(可选)", example = "1") private Long productId; + /** + * 商品名称 + */ + @Schema(description = "商品名称", example = "iPhone 15 Pro") + private String productName; + + /** + * 商品编码 + */ + @Schema(description = "商品编码", example = "IPHONE15PRO001") + private String productCode; + /** * 推广活动名称 */ diff --git a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/service/impl/PromotionFeeServiceImpl.java b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/service/impl/PromotionFeeServiceImpl.java index 43eaa3ee..7b92534d 100644 --- a/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/service/impl/PromotionFeeServiceImpl.java +++ b/ecom-dmb-backend/src/main/java/top/xyquan/ecomdmbbackend/modules/ecom/promotion/service/impl/PromotionFeeServiceImpl.java @@ -19,6 +19,8 @@ import top.xyquan.ecomdmbbackend.modules.ecom.promotion.model.vo.PromotionFeeVO; import top.xyquan.ecomdmbbackend.modules.ecom.promotion.service.PromotionFeeService; import top.xyquan.ecomdmbbackend.modules.ecom.promotion.service.PromotionFeeTypeService; import top.xyquan.ecomdmbbackend.modules.ecom.platform.service.PlatformService; +import top.xyquan.ecomdmbbackend.modules.ecom.product.model.po.ProductPO; +import top.xyquan.ecomdmbbackend.modules.ecom.product.service.ProductService; import top.xyquan.ecomdmbbackend.modules.ecom.shop.service.ShopService; import top.xyquan.ecomdmbbackend.utils.CurrentUserContext; @@ -36,6 +38,7 @@ public class PromotionFeeServiceImpl implements PromotionFeeService { private final CurrentUserContext currentUserContext; private final ShopService shopService; private final PromotionFeeTypeService promotionFeeTypeService; + private final ProductService productService; /** @@ -179,6 +182,18 @@ public class PromotionFeeServiceImpl implements PromotionFeeService { } } + // 填充商品名称和编码 + if (po.getProductId() != null) { + try { + ProductPO product = productService.getById(po.getProductId()); + if (product != null) { + vo.setProductName(product.getName()); + vo.setProductCode(product.getProductCode()); + } + } catch (Exception ignored) { + } + } + return vo; } } \ No newline at end of file diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/promotion-fee/types/types.vo.ts b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/promotion-fee/types/types.vo.ts index 85af65c4..8d0acbf7 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/promotion-fee/types/types.vo.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/promotion-fee/types/types.vo.ts @@ -19,6 +19,10 @@ export namespace PromotionFeeVO { feeTypeName?: string; /** 商品ID(可选) */ productId?: number; + /** 商品名称 */ + productName?: string; + /** 商品编码 */ + productCode?: string; /** 推广活动名称 */ campaignName?: string; /** 推广费金额 */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/promotion-fee/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/promotion-fee/index.vue index 806e3311..1f1e7bfb 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/promotion-fee/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/promotion-fee/index.vue @@ -92,16 +92,17 @@ const gridOptions: VxeGridProps = { title: '序号', }, { - field: 'productId', - title: '商品ID', + field: 'shopName', + title: '店铺', minWidth: 'auto', showOverflow: 'tooltip' as const, }, { - field: 'shopName', - title: '店铺名称', - minWidth: 'auto', + field: 'productName', + title: '商品', + minWidth: 180, showOverflow: 'tooltip' as const, + slots: { default: 'product' }, }, { field: 'feeTypeName', @@ -333,6 +334,15 @@ const formatAmount = (amount: number) => `¥${amount.toFixed(2)}`; + +