TRX 1 rok pred
rodič
commit
8b44e10d4c
53 zmenil súbory, kde vykonal 250 pridanie a 337 odobranie
  1. 1 1
      PaymentClient/src/main/java/com/zhongshu/payment/client/config/PaymentClientConfiguration.java
  2. 4 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/model/param/WalletQueryParam.java
  3. 0 14
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/OrderModel.java
  4. 0 20
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/RequestCreateOrder.java
  5. 0 23
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/create/BaseCreateOrderModel.java
  6. 0 19
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/create/UnionFrictionlessPayCreateOrderModel.java
  7. 1 5
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/OrderPayFeignService.java
  8. 0 20
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/PayService.java
  9. 1 1
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/WalletFeignService.java
  10. 3 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/DirectPayService.java
  11. 3 2
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/FrictionlessPay.java
  12. 3 7
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/WalletPayService.java
  13. 1 1
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/impl/UnionFrictionlessPayService.java
  14. 3 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/impl/WeChatDirectPayService.java
  15. 4 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/impl/WeChatWalletPayService.java
  16. 0 11
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/type/PayCallServiceType.java
  17. 0 36
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/type/PayProductType.java
  18. 0 26
      PaymentClient/src/main/java/com/zhongshu/payment/client/pay/type/PaymentType.java
  19. 27 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/balance/BalanceModel.java
  20. 33 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/balance/BalanceQueryParam.java
  21. 2 7
      PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/commn/CreateOrderParam.java
  22. 2 1
      PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/commn/PayOrderParam.java
  23. 11 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/ExtendPay.java
  24. 7 2
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/RechargeRecord.java
  25. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/ExecuteMethodInfo.java
  26. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/ShopOpenWithDraw.java
  27. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/ShopWithDrawRecord.java
  28. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/UnionUserOpenInfo.java
  29. 24 4
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/OrderPayService.java
  30. 2 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/SuperPayService.java
  31. 0 17
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/domain/BasePay.java
  32. 0 4
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/domain/ExtendPay.java
  33. 0 9
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/domain/UnionPay.java
  34. 46 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/CommonPayService.java
  35. 3 5
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/CooperatorService.java
  36. 29 17
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/UnionFrictionlessPayMainService.java
  37. 3 4
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/UnionRequestService.java
  38. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionBalanceConfig.java
  39. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionFrictionlessPayApiConfig.java
  40. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionFrictionlessPayConfig.java
  41. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionPaymentConfig.java
  42. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/WithdrawConfig.java
  43. 4 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/package-info.java
  44. 2 2
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wallet/WalletFeignServiceImpl.java
  45. 11 4
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wallet/WalletMainService.java
  46. 4 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wallet/package-info.java
  47. 3 3
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wxPaymentV3/WxPayNotifyService.java
  48. 3 4
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wxPaymentV3/WxPaymentMainService.java
  49. 1 1
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wxPaymentV3/WxTransferBatchService.java
  50. 0 33
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/service/PayServiceImpl.java
  51. 0 16
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/service/UnionFrictionlessPayServiceImpl.java
  52. 0 4
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/package-info.java
  53. 0 4
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wallet/package-info.java

+ 1 - 1
PaymentClient/src/main/java/com/zhongshu/payment/client/config/PaymentClientConfiguration.java

@@ -6,7 +6,7 @@ import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 
 @Configuration
-@EnableFeignClients("com.zhongshu.payment.client.service")
+@EnableFeignClients("com.zhongshu.payment.client")
 @ComponentScan({"com.zhongshu.payment.client"})
 public class PaymentClientConfiguration {
 }

+ 4 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/model/param/WalletQueryParam.java

@@ -1,5 +1,6 @@
 package com.zhongshu.payment.client.model.param;
 
+import com.github.microservice.models.type.PaymentType;
 import com.zhongshu.payment.client.types.WalletType;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.AllArgsConstructor;
@@ -17,6 +18,9 @@ import lombok.NoArgsConstructor;
 @Builder
 public class WalletQueryParam {
 
+    @Schema(description = "渠道类型")
+    private PaymentType paymentType;
+
     @Schema(description = "项目Oid")
     private String projectOid;
 

+ 0 - 14
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/OrderModel.java

@@ -1,14 +0,0 @@
-package com.zhongshu.payment.client.pay.model;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class OrderModel {
-    // 订单id
-    private String id;
-
-}

+ 0 - 20
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/RequestCreateOrder.java

@@ -1,20 +0,0 @@
-package com.zhongshu.payment.client.pay.model;
-
-import com.zhongshu.payment.client.pay.model.create.BaseCreateOrderModel;
-import com.zhongshu.payment.client.pay.type.PayProductType;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class RequestCreateOrder {
-
-    //支付产品类型
-    private PayProductType payProductType;
-
-    //创建订单的
-    private BaseCreateOrderModel orderModel;
-
-}

+ 0 - 23
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/create/BaseCreateOrderModel.java

@@ -1,23 +0,0 @@
-package com.zhongshu.payment.client.pay.model.create;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class BaseCreateOrderModel {
-
-    // 商务类型 project
-    private String businessType;
-
-    //
-    private String businessId;
-
-
-    //商品id
-    private String goodsId;
-
-
-}

+ 0 - 19
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/model/create/UnionFrictionlessPayCreateOrderModel.java

@@ -1,19 +0,0 @@
-package com.zhongshu.payment.client.pay.model.create;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class UnionFrictionlessPayCreateOrderModel extends BaseCreateOrderModel {
-
-    // 商户号
-    private String mchntNo;
-
-
-
-
-
-}

+ 1 - 5
PaymentClient/src/main/java/com/zhongshu/payment/client/service/OrderPayFeignService.java → PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/OrderPayFeignService.java

@@ -1,16 +1,12 @@
-package com.zhongshu.payment.client.service;
+package com.zhongshu.payment.client.pay.service;
 
 import com.github.microservice.net.ResultContent;
-import com.zhongshu.payment.client.model.WalletModel;
-import com.zhongshu.payment.client.model.param.AmountUpdateParam;
 import com.zhongshu.payment.client.payModel.commn.CreateOrderParam;
-import com.zhongshu.payment.client.types.WalletType;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.validation.Valid;
 

+ 0 - 20
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/PayService.java

@@ -1,20 +0,0 @@
-package com.zhongshu.payment.client.pay.service;
-
-import com.zhongshu.payment.client.pay.model.OrderModel;
-import com.zhongshu.payment.client.pay.model.RequestCreateOrder;
-import com.zhongshu.payment.client.pay.type.PayCallServiceType;
-import org.springframework.cloud.openfeign.FeignClient;
-
-import java.util.List;
-
-//@FeignClient
-public interface PayService {
-
-    //创建订单
-    OrderModel createOrder(RequestCreateOrder createOrder);
-
-
-
-
-
-}

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

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.client.service;
+package com.zhongshu.payment.client.pay.service;
 
 import com.github.microservice.net.ResultContent;
 import com.zhongshu.payment.client.model.WalletModel;

+ 3 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/DirectPayService.java

@@ -3,5 +3,8 @@ package com.zhongshu.payment.client.pay.service.impl;
 
 import com.zhongshu.payment.client.pay.service.BasePayService;
 
+/**
+ * 通用自营支付
+ */
 public interface DirectPayService extends BasePayService {
 }

+ 3 - 2
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/FrictionlessPay.java

@@ -1,7 +1,8 @@
 package com.zhongshu.payment.client.pay.service.impl;
 
-import com.zhongshu.payment.client.pay.model.create.BaseCreateOrderModel;
+import com.github.microservice.pay.model.create.BaseCreateOrderModel;
+import com.github.microservice.pay.params.BasePayParam;
 import com.zhongshu.payment.client.pay.service.BasePayService;
 
-public interface FrictionlessPay<T extends BaseCreateOrderModel> extends BasePayService<T> {
+public interface FrictionlessPay<T extends BasePayParam> extends BasePayService<T> {
 }

+ 3 - 7
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/WalletPayService.java

@@ -2,13 +2,9 @@ package com.zhongshu.payment.client.pay.service.impl;
 
 import com.zhongshu.payment.client.pay.service.BasePayService;
 
+/**
+ * 钱包支付
+ */
 public interface WalletPayService extends BasePayService {
 
-    public  void add();
-
-    public void sub();
-
-    void query();
-
-
 }

+ 1 - 1
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/impl/UnionFrictionlessPayService.java

@@ -1,6 +1,6 @@
 package com.zhongshu.payment.client.pay.service.impl.impl;
 
-import com.zhongshu.payment.client.pay.model.create.BaseCreateOrderModel;
+import com.github.microservice.pay.model.create.BaseCreateOrderModel;
 import com.zhongshu.payment.client.pay.service.impl.FrictionlessPay;
 
 public interface UnionFrictionlessPayService<T extends BaseCreateOrderModel> extends FrictionlessPay<T> {

+ 3 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/impl/WeChatDirectPayService.java

@@ -2,5 +2,8 @@ package com.zhongshu.payment.client.pay.service.impl.impl;
 
 import com.zhongshu.payment.client.pay.service.impl.DirectPayService;
 
+/**
+ * 微信支付 自营支付
+ */
 public interface WeChatDirectPayService extends DirectPayService {
 }

+ 4 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/service/impl/impl/WeChatWalletPayService.java

@@ -2,5 +2,9 @@ package com.zhongshu.payment.client.pay.service.impl.impl;
 
 import com.zhongshu.payment.client.pay.service.impl.WalletPayService;
 
+/**
+ * 微信 - 钱包支付
+ */
 public interface WeChatWalletPayService extends WalletPayService {
+
 }

+ 0 - 11
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/type/PayCallServiceType.java

@@ -1,11 +0,0 @@
-package com.zhongshu.payment.client.pay.type;
-
-public enum PayCallServiceType {
-
-    Add,
-    Sub,
-    Query,
-    CreateOrder
-
-
-}

+ 0 - 36
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/type/PayProductType.java

@@ -1,36 +0,0 @@
-package com.zhongshu.payment.client.pay.type;
-
-import com.zhongshu.payment.client.pay.service.BasePayService;
-import com.zhongshu.payment.client.pay.service.impl.impl.AliPayDirectPayService;
-import com.zhongshu.payment.client.pay.service.impl.impl.UnionFrictionlessPayService;
-import com.zhongshu.payment.client.pay.service.impl.impl.WeChatDirectPayService;
-import com.zhongshu.payment.client.pay.service.impl.impl.WeChatWalletPayService;
-import lombok.Getter;
-
-/**
- * 支付方式
- */
-public enum PayProductType {
-    WeChatWalletPay("微信充值钱包", PaymentType.WalletPay, WeChatWalletPayService.class),
-    UnionFrictionlessPay("银联无感支付", PaymentType.Frictionless, UnionFrictionlessPayService.class),
-    WeChatDirectPay("微信直营支付", PaymentType.DirectPay, WeChatDirectPayService.class),
-    ALiPayDirectPay("支付宝直营支付", PaymentType.DirectPay, AliPayDirectPayService.class),
-    ;
-
-    @Getter
-    private String remark;
-
-    // 支付结果是否是异步返回
-    @Getter
-    private PaymentType paymentType;
-
-    @Getter
-    private Class<? extends BasePayService> service;
-
-
-    PayProductType(String remark, PaymentType paymentType, Class<? extends BasePayService> service) {
-        this.remark = remark;
-        this.paymentType = paymentType;
-        this.service = service;
-    }
-}

+ 0 - 26
PaymentClient/src/main/java/com/zhongshu/payment/client/pay/type/PaymentType.java

@@ -1,26 +0,0 @@
-package com.zhongshu.payment.client.pay.type;
-
-import lombok.Getter;
-
-/**
- * 支付方式
- */
-public enum PaymentType {
-
-    // 无感支付
-    Frictionless,
-
-    //钱包支付
-    WalletPay,
-
-    // 直营支付,游客可以直接用微信支付宝支付
-    DirectPay,
-
-
-    ;
-
-    @Getter
-    private String remark;
-
-
-}

+ 27 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/balance/BalanceModel.java

@@ -0,0 +1,27 @@
+package com.zhongshu.payment.client.payModel.balance;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+/**
+ * 查询余额返回
+ *
+ * @author TRX
+ * @date 2024/9/23
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BalanceModel {
+
+    @Schema(description = "账户金额,单位:分")
+    private BigDecimal totalAmount = BigDecimal.ZERO;
+
+    @Schema(description = "可用金额,单位:分")
+    private BigDecimal amount = BigDecimal.ZERO;
+
+}

+ 33 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/balance/BalanceQueryParam.java

@@ -0,0 +1,33 @@
+package com.zhongshu.payment.client.payModel.balance;
+
+import com.github.microservice.pay.params.BasePayParam;
+import com.zhongshu.payment.client.types.WalletType;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * 查询余额
+ *
+ * @author TRX
+ * @date 2024/9/23
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BalanceQueryParam extends BasePayParam {
+
+    @Schema(description = "项目oid")
+    private String oid;
+
+    @Schema(description = "钱包类型")
+    private WalletType walletType;
+
+    @Schema(description = "商户oid")
+    private String shopId;
+
+    @Schema(description = "用户userId")
+    private String userId;
+}

+ 2 - 7
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/commn/CreateOrderParam.java

@@ -1,6 +1,7 @@
 package com.zhongshu.payment.client.payModel.commn;
 
 import com.github.microservice.models.type.PaymentType;
+import com.github.microservice.pay.params.BasePayParam;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotEmpty;
 import lombok.AllArgsConstructor;
@@ -20,13 +21,7 @@ import java.math.BigDecimal;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-public class CreateOrderParam {
-
-    @Schema(description = "支付方式")
-    private PaymentType paymentType;
-
-    @Schema(description = "项目oid")
-    private String projectOid;
+public class CreateOrderParam extends BasePayParam {
 
     @Schema(description = "用户id")
     private String userId;

+ 2 - 1
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/commn/PayOrderParam.java

@@ -1,5 +1,6 @@
 package com.zhongshu.payment.client.payModel.commn;
 
+import com.github.microservice.pay.params.BasePayParam;
 import lombok.Builder;
 import lombok.Data;
 
@@ -9,6 +10,6 @@ import lombok.Data;
  */
 @Data
 @Builder
-public class PayOrderParam {
+public class PayOrderParam extends BasePayParam {
     private String outTradeNo;
 }

+ 11 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/ExtendPay.java

@@ -0,0 +1,11 @@
+package com.zhongshu.payment.server.core.domain.pay;
+
+import com.zhongshu.payment.server.core.domain.base.SuperMain;
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+@Data
+@Document
+public class ExtendPay extends SuperMain {
+
+}

+ 7 - 2
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/wallet/RechargeRecord.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/RechargeRecord.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.domain.wallet;
+package com.zhongshu.payment.server.core.domain.pay;
 
 import com.github.microservice.components.data.mongo.mongo.domain.SuperEntity;
 import com.github.microservice.models.type.PaymentType;
@@ -9,6 +9,7 @@ import com.zhongshu.card.client.utils.DateUtils;
 import com.zhongshu.payment.client.model.PrePayModel;
 import com.zhongshu.payment.client.model.TransferModel;
 import com.zhongshu.payment.client.types.TradeType;
+import com.zhongshu.payment.server.core.domain.wallet.Wallet;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import org.springframework.data.mongodb.core.index.Indexed;
@@ -18,7 +19,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
 import java.math.BigDecimal;
 
 /**
- * 充值记录
+ * 订单
  *
  * @author wjf
  * @date 2024/7/25
@@ -51,6 +52,9 @@ public class RechargeRecord extends SuperEntity {
     @Indexed
     private String openid;
 
+    @Schema(description = "支付扩展信息")
+    private ExtendPay extendPay;
+
     @Schema(name = "钱包信息", description = "钱包信息")
     @DBRef(lazy = true)
     private Wallet wallet;
@@ -185,4 +189,5 @@ public class RechargeRecord extends SuperEntity {
     @Schema(description = "退款状态")
     private RefundStatus refundStatus;
 
+
 }

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/ExecuteMethodInfo.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/ExecuteMethodInfo.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.domain.unionFrictionlessPay;
+package com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay;
 
 import com.github.microservice.models.type.PaymentType;
 import com.zhongshu.payment.server.core.domain.base.SuperMain;

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/ShopOpenWithDraw.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/ShopOpenWithDraw.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.domain.unionFrictionlessPay;
+package com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay;
 
 import com.github.microservice.types.unionFrictionlessPayType.WithDrawOpenState;
 import com.zhongshu.payment.server.core.domain.base.SuperMain;

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/ShopWithDrawRecord.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/ShopWithDrawRecord.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.domain.unionFrictionlessPay;
+package com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay;
 
 import com.github.microservice.types.unionFrictionlessPayType.WithDrawState;
 import com.zhongshu.card.client.utils.DateUtils;

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/UnionUserOpenInfo.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/pay/unionFrictionlessPay/UnionUserOpenInfo.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.domain.unionFrictionlessPay;
+package com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay;
 
 import com.github.microservice.types.unionFrictionlessPayType.ContractState;
 import com.github.microservice.types.unionFrictionlessPayType.UnionUserOpenType;

+ 24 - 4
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/OrderPayService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/OrderPayService.java

@@ -1,18 +1,19 @@
-package com.zhongshu.payment.server.core.service.pay;
+package com.zhongshu.payment.server.core.pay;
 
 import com.github.microservice.core.helper.ApplicationContextHolder;
 import com.github.microservice.models.type.PaymentType;
 import com.github.microservice.net.ResultContent;
 import com.github.microservice.net.ResultMessage;
+import com.zhongshu.payment.client.pay.service.BasePayService;
 import com.zhongshu.payment.client.payModel.commn.CreateOrderParam;
-import com.zhongshu.payment.client.service.OrderPayFeignService;
+import com.zhongshu.payment.client.pay.service.OrderPayFeignService;
 import com.zhongshu.payment.server.core.dao.ExecuteMethodInfoDao;
-import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ExecuteMethodInfo;
+import com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay.ExecuteMethodInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
 import org.springframework.stereotype.Service;
-import org.springframework.web.bind.annotation.RequestBody;
 
 /**
  * @author TRX
@@ -25,6 +26,9 @@ public class OrderPayService implements OrderPayFeignService {
     @Autowired
     ExecuteMethodInfoDao executeMethodInfoDao;
 
+    @Autowired
+    private ApplicationContext applicationContext;
+
     @Override
     public ResultContent createAndPay(CreateOrderParam param) {
         PaymentType paymentType = param.getPaymentType();
@@ -39,4 +43,20 @@ public class OrderPayService implements OrderPayFeignService {
         return service.createAndPayOrder(param);
     }
 
+    private ResultContent<BasePayService> getServiceBean(PaymentType paymentType) {
+        if (paymentType == null) {
+            return ResultContent.buildFail("未指定支付方式");
+        }
+        Object beanObj = null;
+        try {
+            beanObj = applicationContext.getBean(paymentType.getServiceBeanName());
+        } catch (Exception e) {
+            log.error("createOrder", e.getMessage());
+        }
+        if (beanObj == null) {
+            return ResultContent.buildFail("");
+        }
+        BasePayService basePayService = (BasePayService) beanObj;
+        return ResultContent.buildSuccess(basePayService);
+    }
 }

+ 2 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/SuperPayService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/SuperPayService.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay;
+package com.zhongshu.payment.server.core.pay;
 
 import com.github.microservice.auth.security.helper.AuthHelper;
 import com.github.microservice.core.util.net.IPUtil;
@@ -67,4 +67,5 @@ public abstract class SuperPayService {
     public OperationLogsAddParam initLog(String userId) {
         return CommonUtil.initLog(request, userId);
     }
+
 }

+ 0 - 17
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/domain/BasePay.java

@@ -1,17 +0,0 @@
-package com.zhongshu.payment.server.core.pay.domain;
-
-import com.zhongshu.payment.client.pay.type.PaymentType;
-import com.zhongshu.payment.server.core.domain.base.SuperMain;
-import org.springframework.data.mongodb.core.mapping.DBRef;
-import org.springframework.data.mongodb.core.mapping.Document;
-
-@Document
-public class BasePay  extends SuperMain {
-
-
-    private PaymentType paymentType;
-
-    @DBRef(lazy = true)
-    private ExtendPay basePay;
-
-}

+ 0 - 4
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/domain/ExtendPay.java

@@ -1,4 +0,0 @@
-package com.zhongshu.payment.server.core.pay.domain;
-
-public class ExtendPay {
-}

+ 0 - 9
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/domain/UnionPay.java

@@ -1,9 +0,0 @@
-package com.zhongshu.payment.server.core.pay.domain;
-
-import org.springframework.data.mongodb.core.mapping.DBRef;
-
-public class UnionPay extends ExtendPay {
-
-
-
-}

+ 46 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/CommonPayService.java

@@ -0,0 +1,46 @@
+package com.zhongshu.payment.server.core.pay.impl;
+
+import com.github.microservice.auth.security.helper.AuthHelper;
+import com.zhongshu.card.client.model.operLogs.OperationLogsAddParam;
+import com.zhongshu.payment.server.core.utils.CommonUtil;
+import jakarta.servlet.http.HttpServletRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 支付支撑 服务
+ * @author TRX
+ * @date 2024/9/23
+ */
+@Slf4j
+@Service
+public class CommonPayService {
+
+    @Autowired
+    private AuthHelper authHelper;
+
+    @Autowired
+    private HttpServletRequest request;
+
+    // 得到当前的用户ID
+    public String getCurrentUserId() {
+        try {
+            if (authHelper != null && authHelper.getCurrentUser() != null) {
+                return authHelper.getCurrentUser().getUserId();
+            }
+        } catch (Exception e) {
+            log.error("getCurrentUserId error {}", e.getMessage());
+        }
+        return null;
+    }
+
+    public OperationLogsAddParam initLog() {
+        return CommonUtil.initLog(request, getCurrentUserId());
+    }
+
+    public OperationLogsAddParam initLog(String userId) {
+        return CommonUtil.initLog(request, userId);
+    }
+
+}

+ 3 - 5
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/CooperatorService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/CooperatorService.java

@@ -1,8 +1,7 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay;
 
 import com.github.microservice.components.data.base.util.PageEntityUtil;
 import com.github.microservice.net.ResultContent;
-import com.github.microservice.net.ResultState;
 import com.github.microservice.types.unionFrictionlessPayType.WithDrawState;
 import com.zhongshu.card.client.service.feign.OrganizationFeignService;
 import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopOpenWithDrawModel;
@@ -10,9 +9,8 @@ import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopWithDraw
 import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopWithDrawRecordSearch;
 import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.ShopOpenWithDrawDao;
 import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.ShopWithDrawRecordDao;
-import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopOpenWithDraw;
-import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopWithDrawRecord;
-import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.UnionUserOpenInfo;
+import com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay.ShopOpenWithDraw;
+import com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay.ShopWithDrawRecord;
 import com.zhongshu.payment.server.core.service.base.SuperService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;

+ 29 - 17
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/UnionFrictionlessPayMainService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/UnionFrictionlessPayMainService.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.json.JSONObject;
@@ -13,6 +13,8 @@ import com.github.microservice.stream.model.OrderStateModel;
 import com.github.microservice.stream.model.SignModel;
 import com.github.microservice.types.OrderState;
 import com.github.microservice.types.RefundStatus;
+import com.github.microservice.types.unionFrictionlessPayType.ContractState;
+import com.github.microservice.types.unionFrictionlessPayType.UnionUserOpenType;
 import com.github.microservice.types.unionFrictionlessPayType.WithDrawOpenState;
 import com.github.microservice.types.unionFrictionlessPayType.WithDrawState;
 import com.zhongshu.card.client.model.org.OrgUserDetailParam;
@@ -26,17 +28,20 @@ import com.zhongshu.payment.client.annotation.PayAnnotationService;
 import com.zhongshu.payment.client.model.WalletModel;
 import com.zhongshu.payment.client.model.param.OrderParam;
 import com.zhongshu.payment.client.model.param.WalletQueryParam;
+import com.zhongshu.payment.client.pay.service.impl.impl.UnionFrictionlessPayService;
+import com.zhongshu.payment.client.payModel.balance.BalanceModel;
+import com.zhongshu.payment.client.payModel.balance.BalanceQueryParam;
 import com.zhongshu.payment.client.payModel.commn.ClosePayOrderParam;
 import com.zhongshu.payment.client.payModel.commn.CreateOrderParam;
 import com.zhongshu.payment.client.payModel.commn.PayNotifyParam;
 import com.zhongshu.payment.client.payModel.commn.PayOrderParam;
-import com.zhongshu.payment.client.payModel.cooperator.*;
+import com.zhongshu.payment.client.payModel.cooperator.ShopIdParam;
+import com.zhongshu.payment.client.payModel.cooperator.ShopProcessWithdrawParam;
+import com.zhongshu.payment.client.payModel.cooperator.WithDrawOpenParam;
 import com.zhongshu.payment.client.payModel.cooperator.model.*;
 import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopBalanceModel;
 import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopOpenWithDrawModel;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.*;
-import com.github.microservice.types.unionFrictionlessPayType.ContractState;
-import com.github.microservice.types.unionFrictionlessPayType.UnionUserOpenType;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.SignInParam;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.UserRescissionParam;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.UserSignQueryParam;
@@ -46,16 +51,16 @@ import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.ShopOpenWithDra
 import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.ShopWithDrawRecordDao;
 import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.UnionUserOpenInfoDao;
 import com.zhongshu.payment.server.core.dataConfig.TimeConfig;
-import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopOpenWithDraw;
-import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopWithDrawRecord;
-import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.UnionUserOpenInfo;
-import com.zhongshu.payment.server.core.domain.wallet.RechargeRecord;
+import com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay.ShopOpenWithDraw;
+import com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay.ShopWithDrawRecord;
+import com.zhongshu.payment.server.core.domain.pay.unionFrictionlessPay.UnionUserOpenInfo;
+import com.zhongshu.payment.server.core.domain.pay.RechargeRecord;
 import com.zhongshu.payment.server.core.service.org.CollectionIdService;
-import com.zhongshu.payment.server.core.service.pay.SuperPayService;
-import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayApiConfig;
-import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayConfig;
-import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionPaymentConfig;
-import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.WithdrawConfig;
+import com.zhongshu.payment.server.core.pay.impl.CommonPayService;
+import com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayApiConfig;
+import com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayConfig;
+import com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config.UnionPaymentConfig;
+import com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config.WithdrawConfig;
 import com.zhongshu.payment.server.core.utils.AesUtils;
 import com.zhongshu.payment.server.core.utils.CommonUtil;
 import jakarta.servlet.ServletInputStream;
@@ -69,7 +74,6 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.bouncycastle.jce.spec.ECNamedCurveParameterSpec;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StopWatch;
 
@@ -89,7 +93,7 @@ import java.util.stream.Collectors;
 @Slf4j
 @Service
 @PayAnnotationService(paymentType = PaymentType.UnionFrictionlessPay, remark = "银联无感支付")
-public class UnionFrictionlessPayMainService extends SuperPayService {
+public class UnionFrictionlessPayMainService implements UnionFrictionlessPayService {
 
     @Autowired
     UnionRequestService unionRequestService;
@@ -130,6 +134,9 @@ public class UnionFrictionlessPayMainService extends SuperPayService {
     @Autowired
     CooperatorService cooperatorService;
 
+    @Autowired
+    CommonPayService commonPayService;
+
     /**
      * 发起签约
      *
@@ -139,7 +146,7 @@ public class UnionFrictionlessPayMainService extends SuperPayService {
     public ResultContent sign(SignInParam param) {
         String userId = param.getUserId();
         if (StringUtils.isEmpty(userId)) {
-            userId = getCurrentUserId();
+            userId = commonPayService.getCurrentUserId();
         }
         String shopOid = param.getShopOid();
         ResultContent<UserCountModel> resultContent = userFeignService.getUserDetailByUserId(userId);
@@ -724,6 +731,11 @@ public class UnionFrictionlessPayMainService extends SuperPayService {
         return ResultContent.buildFail("无感支付不支持查询账户信息");
     }
 
+    @Override
+    public ResultContent<BalanceModel> queryBalance(BalanceQueryParam param) {
+        return null;
+    }
+
     @Override
     public ResultContent closePayOrder(ClosePayOrderParam param) {
         return ResultContent.buildFail("暂未实现");
@@ -795,7 +807,7 @@ public class UnionFrictionlessPayMainService extends SuperPayService {
         drawRecord.setShopId(shopId);
         drawRecord.setShopName(shopInfo.getName());
         drawRecord.setMchntNo(getMchntNo(shopId));
-        drawRecord.setUserId(getCurrentUserId());
+        drawRecord.setUserId(commonPayService.getCurrentUserId());
         drawRecord.setWithDrawState(WithDrawState.WithDrawing);
         drawRecord.setSysOrderId(sysOrderId);
         drawRecord.setWithdrawAmt(withdrawAmt);

+ 3 - 4
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/UnionRequestService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/UnionRequestService.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -19,9 +19,8 @@ import com.zhongshu.card.client.utils.DateUtils;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.ApiConfParam;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionSuperParam;
 import com.zhongshu.payment.server.core.service.base.SuperService;
-import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayConfig;
-import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.UnionPaymentConfig;
-import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config.WithdrawConfig;
+import com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config.UnionFrictionlessPayConfig;
+import com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config.WithdrawConfig;
 import com.zhongshu.payment.server.core.utils.AesUtils;
 import com.zhongshu.payment.server.core.utils.CommonUtil;
 import lombok.SneakyThrows;

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/UnionBalanceConfig.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionBalanceConfig.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config;
 
 /**
  * 悦融益接口测试环境参数

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/UnionFrictionlessPayApiConfig.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionFrictionlessPayApiConfig.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config;
 
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionPayApi;
 import org.apache.commons.lang3.StringUtils;

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/UnionFrictionlessPayConfig.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionFrictionlessPayConfig.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/UnionPaymentConfig.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/UnionPaymentConfig.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/config/WithdrawConfig.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/config/WithdrawConfig.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.config;
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay.config;
 
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;

+ 4 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/unionFrictionlessPay/package-info.java

@@ -0,0 +1,4 @@
+package com.zhongshu.payment.server.core.pay.impl.unionFrictionlessPay;
+/**
+ * 银联无感支付
+ */

+ 2 - 2
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wallet/WalletFeignServiceImpl.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wallet/WalletFeignServiceImpl.java

@@ -1,10 +1,10 @@
-package com.zhongshu.payment.server.core.service.pay.impl.wallet;
+package com.zhongshu.payment.server.core.pay.impl.wallet;
 
 import com.github.microservice.net.ResultContent;
 import com.zhongshu.payment.client.model.WalletModel;
 import com.zhongshu.payment.client.model.param.AmountUpdateParam;
 import com.zhongshu.payment.client.model.param.WalletQueryParam;
-import com.zhongshu.payment.client.service.WalletFeignService;
+import com.zhongshu.payment.client.pay.service.WalletFeignService;
 import com.zhongshu.payment.client.types.TradeType;
 import com.zhongshu.payment.client.types.WalletType;
 import com.zhongshu.payment.server.core.dao.WalletDao;

+ 11 - 4
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wallet/WalletMainService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wallet/WalletMainService.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.wallet;
+package com.zhongshu.payment.server.core.pay.impl.wallet;
 
 import ch.qos.logback.core.util.StringUtil;
 import com.github.microservice.auth.security.helper.AuthHelper;
@@ -20,6 +20,9 @@ import com.zhongshu.payment.client.model.WalletOrderModel;
 import com.zhongshu.payment.client.model.param.GetWalletParam;
 import com.zhongshu.payment.client.model.param.OrderParam;
 import com.zhongshu.payment.client.model.param.WalletQueryParam;
+import com.zhongshu.payment.client.pay.service.impl.impl.WeChatWalletPayService;
+import com.zhongshu.payment.client.payModel.balance.BalanceModel;
+import com.zhongshu.payment.client.payModel.balance.BalanceQueryParam;
 import com.zhongshu.payment.client.payModel.commn.ClosePayOrderParam;
 import com.zhongshu.payment.client.payModel.commn.CreateOrderParam;
 import com.zhongshu.payment.client.payModel.commn.PayNotifyParam;
@@ -31,11 +34,10 @@ import com.zhongshu.payment.server.core.dao.RechargeRecordDao;
 import com.zhongshu.payment.server.core.dao.WalletDao;
 import com.zhongshu.payment.server.core.dao.WalletFlowDao;
 import com.zhongshu.payment.server.core.dataConfig.TimeConfig;
-import com.zhongshu.payment.server.core.domain.wallet.RechargeRecord;
+import com.zhongshu.payment.server.core.domain.pay.RechargeRecord;
 import com.zhongshu.payment.server.core.domain.wallet.Wallet;
 import com.zhongshu.payment.server.core.domain.wallet.WalletFlow;
 import com.zhongshu.payment.server.core.service.RechargeService;
-import com.zhongshu.payment.server.core.service.pay.SuperPayService;
 import com.zhongshu.payment.server.core.utils.BeanUtils;
 import com.zhongshu.payment.server.core.utils.CommonUtil;
 import groovy.util.logging.Slf4j;
@@ -58,7 +60,7 @@ import java.util.concurrent.CompletableFuture;
 @Slf4j
 @Service
 @PayAnnotationService(paymentType = PaymentType.UserWallet, remark = "个人钱包")
-public class WalletMainService extends SuperPayService {
+public class WalletMainService implements WeChatWalletPayService {
 
     @Autowired
     WalletDao walletDao;
@@ -245,6 +247,11 @@ public class WalletMainService extends SuperPayService {
         return ResultContent.buildContent(toModel(findWallet(param)));
     }
 
+    @Override
+    public ResultContent<BalanceModel> queryBalance(BalanceQueryParam param) {
+        return null;
+    }
+
     @Override
     public ResultContent closePayOrder(ClosePayOrderParam param) {
         return ResultContent.buildFail("暂未实现");

+ 4 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wallet/package-info.java

@@ -0,0 +1,4 @@
+package com.zhongshu.payment.server.core.pay.impl.wallet;
+/**
+ * 个人钱包
+ */

+ 3 - 3
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wxPaymentV3/WxPayNotifyService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wxPaymentV3/WxPayNotifyService.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.wxPaymentV3;
+package com.zhongshu.payment.server.core.pay.impl.wxPaymentV3;
 
 import com.github.microservice.core.util.JsonUtil;
 import com.github.microservice.net.ResultContent;
@@ -16,8 +16,8 @@ import com.zhongshu.card.client.service.feign.ProjectPaySettingFeignService;
 import com.zhongshu.card.client.utils.DateUtils;
 import com.zhongshu.payment.client.model.param.AmountUpdateParam;
 import com.zhongshu.payment.server.core.dao.RechargeRecordDao;
-import com.zhongshu.payment.server.core.domain.wallet.RechargeRecord;
-import com.zhongshu.payment.server.core.service.pay.impl.wallet.WalletFeignServiceImpl;
+import com.zhongshu.payment.server.core.domain.pay.RechargeRecord;
+import com.zhongshu.payment.server.core.pay.impl.wallet.WalletFeignServiceImpl;
 import jakarta.servlet.ServletInputStream;
 import jakarta.servlet.http.HttpServletRequest;
 import jline.internal.Log;

+ 3 - 4
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wxPaymentV3/WxPaymentMainService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wxPaymentV3/WxPaymentMainService.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.wxPaymentV3;
+package com.zhongshu.payment.server.core.pay.impl.wxPaymentV3;
 
 import com.github.microservice.models.type.PaymentType;
 import com.github.microservice.net.ResultContent;
@@ -28,8 +28,8 @@ import com.zhongshu.payment.client.payModel.commn.CreateOrderParam;
 import com.zhongshu.payment.client.payModel.commn.PayNotifyParam;
 import com.zhongshu.payment.client.payModel.commn.PayOrderParam;
 import com.zhongshu.payment.server.core.dao.RechargeRecordDao;
-import com.zhongshu.payment.server.core.domain.wallet.RechargeRecord;
-import com.zhongshu.payment.server.core.service.pay.SuperPayService;
+import com.zhongshu.payment.server.core.domain.pay.RechargeRecord;
+import com.zhongshu.payment.server.core.pay.SuperPayService;
 import com.zhongshu.payment.server.core.utils.wx.WechatCUtil;
 import io.netty.util.internal.StringUtil;
 import jakarta.servlet.http.HttpServletRequest;
@@ -72,7 +72,6 @@ public class WxPaymentMainService extends SuperPayService {
 
     public static com.wechat.pay.java.service.payments.jsapi.JsapiService service;
 
-
     //--------------------------通用方法 start -------------------------
 
     /**

+ 1 - 1
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wxPaymentV3/WxTransferBatchService.java → PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/impl/wxPaymentV3/WxTransferBatchService.java

@@ -1,4 +1,4 @@
-package com.zhongshu.payment.server.core.service.pay.impl.wxPaymentV3;
+package com.zhongshu.payment.server.core.pay.impl.wxPaymentV3;
 
 import com.wechat.pay.java.core.Config;
 import com.wechat.pay.java.core.RSAAutoCertificateConfig;

+ 0 - 33
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/service/PayServiceImpl.java

@@ -1,33 +0,0 @@
-package com.zhongshu.payment.server.core.pay.service;
-
-import com.zhongshu.payment.client.pay.model.OrderModel;
-import com.zhongshu.payment.client.pay.model.RequestCreateOrder;
-import com.zhongshu.payment.client.pay.service.BasePayService;
-import com.zhongshu.payment.client.pay.service.PayService;
-import com.zhongshu.payment.client.pay.type.PayCallServiceType;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
-import org.springframework.context.ApplicationContext;
-import org.springframework.stereotype.Service;
-import org.springframework.util.Assert;
-
-@Service
-public class PayServiceImpl implements PayService {
-
-    @Autowired
-    private ApplicationContext applicationContext;
-
-    @Override
-    public OrderModel createOrder(RequestCreateOrder createOrder) {
-        final BasePayService basePayService = applicationContext.getBean(createOrder.getPayProductType().getService());
-        Assert.notNull(basePayService, "不支持的支付类型");
-
-        // todo 如果报错,需要进行类型转换
-        OrderModel orderModel = basePayService.createOrder(createOrder.getOrderModel());
-
-
-        return null;
-    }
-
-
-}

+ 0 - 16
PaymentServer/src/main/java/com/zhongshu/payment/server/core/pay/service/UnionFrictionlessPayServiceImpl.java

@@ -1,16 +0,0 @@
-package com.zhongshu.payment.server.core.pay.service;
-
-import com.zhongshu.payment.client.pay.model.OrderModel;
-import com.zhongshu.payment.client.pay.model.create.UnionFrictionlessPayCreateOrderModel;
-import com.zhongshu.payment.client.pay.service.impl.impl.UnionFrictionlessPayService;
-import org.springframework.stereotype.Service;
-
-@Service
-public class UnionFrictionlessPayServiceImpl implements UnionFrictionlessPayService<UnionFrictionlessPayCreateOrderModel> {
-
-
-    @Override
-    public OrderModel createOrder(UnionFrictionlessPayCreateOrderModel createOrderModel) {
-        return null;
-    }
-}

+ 0 - 4
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/package-info.java

@@ -1,4 +0,0 @@
-package com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay;
-/**
- * 银联无感支付
- */

+ 0 - 4
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/wallet/package-info.java

@@ -1,4 +0,0 @@
-package com.zhongshu.payment.server.core.service.pay.impl.wallet;
-/**
- * 个人钱包
- */