TRX 1 an în urmă
părinte
comite
201173193e

+ 1 - 1
PaymentClient/src/main/java/com/zhongshu/payment/client/service/WalletFeignService.java

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
  * @author wjf
  * @date 2024/7/26
  */
-@FeignClient("paymentserver/manager/wallet")
+@FeignClient("paymentserver-trx/manager/wallet")
 public interface WalletFeignService {
 
     /** 获取钱包信息 */

+ 6 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/wallet/Wallet.java

@@ -43,6 +43,12 @@ public class Wallet extends SuperEntity {
     @Indexed
     private String shopId;
 
+    @Schema(description = "钱包所属名称")
+    private String unitName;
+
+    @Schema(description = "电话")
+    private String phone;
+
     @Schema(description = "可用金额,单位:分")
     private BigDecimal amount = BigDecimal.ZERO;
 

+ 24 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wallet/WalletMainService.java

@@ -5,9 +5,12 @@ import com.github.microservice.auth.security.helper.AuthHelper;
 import com.github.microservice.models.type.PaymentType;
 import com.github.microservice.net.ResultContent;
 import com.zhongshu.card.client.model.feign.ProjectWxPayParam;
+import com.zhongshu.card.client.model.org.OrganizationSimpleModel;
+import com.zhongshu.card.client.model.org.UserCountModel;
 import com.zhongshu.card.client.model.payment.paySetting.WxPayConfigModel;
 import com.zhongshu.card.client.service.feign.OrganizationFeignService;
 import com.zhongshu.card.client.service.feign.ProjectPaySettingFeignService;
+import com.zhongshu.card.client.service.feign.UserFeignService;
 import com.zhongshu.payment.client.annotation.PayAnnotationService;
 import com.zhongshu.payment.client.model.WalletModel;
 import com.zhongshu.payment.client.model.WalletOrderModel;
@@ -25,6 +28,7 @@ import com.zhongshu.payment.server.core.service.pay.SuperPayService;
 import com.zhongshu.payment.server.core.utils.BeanUtils;
 import groovy.util.logging.Slf4j;
 import jakarta.servlet.http.HttpServletRequest;
+import org.apache.commons.lang3.ObjectUtils;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -57,6 +61,9 @@ public class WalletMainService extends SuperPayService {
     @Autowired
     RechargeRecordDao rechargeRecordDao;
 
+    @Autowired
+    UserFeignService userFeignService;
+
     /**
      * 创建渠道支付订单
      *
@@ -164,8 +171,25 @@ public class WalletMainService extends SuperPayService {
         wallet.setShopId(shopId);
         wallet.setWalletType(walletType);
         if (walletType == WalletType.User) {
+            ResultContent<UserCountModel> resultContent = userFeignService.getUserDetailByUserId(userId);
+            if (resultContent.isSuccess()) {
+                UserCountModel countModel = resultContent.getContent();
+                if (ObjectUtils.isNotEmpty(countModel)) {
+                    wallet.setUnitName(countModel.getName());
+                    wallet.setPhone(countModel.getPhone());
+                }
+            }
             wallet.setWalletDataId(userId);
         } else if (walletType == WalletType.Shop) {
+            ResultContent<OrganizationSimpleModel> resultContent = organizationFeignService.getDetail(shopId);
+            if (resultContent.isSuccess()) {
+                OrganizationSimpleModel simpleModel = resultContent.getContent();
+                if (ObjectUtils.isNotEmpty(simpleModel)) {
+                    wallet.setUnitName(simpleModel.getName());
+                    wallet.setPhone(simpleModel.getContactPhone());
+                }
+            }
+            organizationFeignService.getOidAboutOrgInfo(shopId);
             wallet.setWalletDataId(shopId);
         }
         walletDao.save(wallet);