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; }