From a8d29cc95ab8a0bfdcbc4601789c0fee6e5bac9f Mon Sep 17 00:00:00 2001 From: DaxPay Dev Date: Thu, 16 Jul 2026 20:05:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(channel):=20=E9=80=9A=E9=81=93=E5=95=86?= =?UTF-8?q?=E6=88=B7=20mchName=20=E6=94=B9=E7=94=A8=20@Trans=20=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/channel/ChannelMerchantResult.java | 13 +++++++++++-- .../service/channel/ChannelMerchantService.java | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/result/channel/ChannelMerchantResult.java b/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/result/channel/ChannelMerchantResult.java index 1425b9230..2676377ba 100644 --- a/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/result/channel/ChannelMerchantResult.java +++ b/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/result/channel/ChannelMerchantResult.java @@ -1,19 +1,28 @@ package cn.daxpay.open.payment.merchant.result.channel; +import cn.daxpay.open.payment.common.result.MchBaseResult; import cn.daxpay.open.platform.core.enums.channel.ChannelMerchantSourceEnum; -import cn.daxpay.open.payment.common.result.MchTradeBaseResult; +import cn.daxpay.open.payment.merchant.entity.info.MerchantInfo; +import cn.daxpay.open.platform.core.annotation.Trans; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import lombok.experimental.FieldNameConstants; /// # 通道商户信息 /// @EqualsAndHashCode(callSuper = true) @Data +@FieldNameConstants @Accessors(chain = true) @Schema(title = "通道商户信息") -public class ChannelMerchantResult extends MchTradeBaseResult { +public class ChannelMerchantResult extends MchBaseResult { + + /// 商户名称(由 mchNo 翻译, 走系统 @Trans 机制) + @Trans(entity = MerchantInfo.class, source = MchBaseResult.Fields.mchNo, result = MerchantInfo.Fields.mchName) + @Schema(description = "商户名称") + private String mchName; /// 申请单ID @Schema(description = "申请单ID") diff --git a/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/service/channel/ChannelMerchantService.java b/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/service/channel/ChannelMerchantService.java index 6bc40b6be..07b6fd1db 100644 --- a/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/service/channel/ChannelMerchantService.java +++ b/daxpay-payment/daxpay-payment-core/src/main/java/cn/daxpay/open/payment/merchant/service/channel/ChannelMerchantService.java @@ -1,6 +1,7 @@ package cn.daxpay.open.payment.merchant.service.channel; import cn.daxpay.open.platform.common.mybatisplus.util.MpUtil; +import cn.daxpay.open.platform.common.translate.service.TransService; import cn.daxpay.open.platform.core.exception.DataNotExistException; import cn.daxpay.open.platform.core.rest.dto.LabelValue; import cn.daxpay.open.platform.core.rest.param.PageParam; @@ -33,6 +34,7 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class ChannelMerchantService { private final ChannelMerchantManager channelMerchantManager; + private final TransService transService; private final PayChannelService payChannelService; private final PayProductManager payProductManager; @@ -40,6 +42,8 @@ public class ChannelMerchantService { public PageResult page(PageParam pageParam, ChannelMerchantQuery query){ PageResult pageResult = MpUtil.toPageResult(channelMerchantManager.page(pageParam,query)); fillEnvStatus(pageResult.getRecords()); + // 翻译商户名称(mchNo -> mchName, 走系统 @Trans 机制) + transService.translate(pageResult); return pageResult; } @@ -50,6 +54,8 @@ public class ChannelMerchantService { // 通道: 通道商户不存在 .orElseThrow(() -> new DataNotExistException("error.payment.channel.channelMerchantNotExist")); fillEnvStatus(List.of(result)); + // 翻译商户名称 + transService.translate(result); return result; }