Просмотр исходного кода

Merge branch 'dev-xcq' into dev

xucaiqin 2 лет назад
Родитель
Сommit
e29c136c84

+ 4 - 1
sckw-common/sckw-common-bom/pom.xml

@@ -9,7 +9,10 @@
     <version>1.0.0</version>
     <packaging>pom</packaging>
     <description>common依赖项</description>
-
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+    </properties>
     <dependencyManagement>
         <dependencies>
             <!-- 核心模块 -->

+ 16 - 2
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/dubbo/PayCenterDubboService.java

@@ -2,14 +2,28 @@ package com.sckw.payment.api.dubbo;
 
 import com.sckw.payment.api.model.constant.ChannelEnum;
 import com.sckw.payment.api.model.dto.MemberDetail;
+import com.sckw.payment.api.model.dto.R;
+import com.sckw.payment.api.model.dto.WalletDto;
+
+import java.util.List;
 
 public interface PayCenterDubboService {
     /**
      * 获取会员详情
      *
-     * @param uid     中台用户id
+     * @param entId   企业id
      * @param channel 渠道
      * @return
      */
-    MemberDetail memberDetail(String uid, ChannelEnum channel);
+    R<MemberDetail> memberDetail(Long entId, ChannelEnum channel);
+
+    /**
+     * 钱包清单
+     *
+     * @param payEntId     付款方企业id
+     * @param channel 支付渠道
+     * @param receiveEntId  收款方企业id
+     * @return
+     */
+    R<List<WalletDto>> wallet(Long payEntId, ChannelEnum channel, Long receiveEntId);
 }

+ 5 - 5
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/dto/MemberDetail.java

@@ -1,14 +1,14 @@
 package com.sckw.payment.api.model.dto;
 
-import lombok.Getter;
-import lombok.Setter;
+import lombok.Data;
+
+import java.io.Serializable;
 
 /**
  * 会员详情
  */
-@Getter
-@Setter
-public class MemberDetail {
+@Data
+public class MemberDetail implements Serializable {
     private Boolean register;
     private String uid;
     private String channel;

+ 78 - 0
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/dto/R.java

@@ -0,0 +1,78 @@
+package com.sckw.payment.api.model.dto;
+
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author xcq
+ * @date 2022年06月14日 13:41
+ */
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+public class R<T> implements Serializable {
+    @Serial
+    private static final long serialVersionUID = -2087972616778698265L;
+    /**
+     * 1-成功 0-失败
+     */
+    @Getter
+    @Setter
+    private int code;
+
+    @Getter
+    @Setter
+    private String msg;
+
+    @Getter
+    @Setter
+    private T data;
+    @Getter
+    @Setter
+    private Boolean status;
+
+    public static <T> R<T> ok() {
+        return restResult(null, 1, null, true);
+    }
+
+    public static <T> R<T> ok(T data) {
+        return restResult(data, 1, null, true);
+    }
+
+    public static <T> R<T> ok(T data, String msg) {
+        return restResult(data, 1, msg, true);
+    }
+
+    public static <T> R<T> failed() {
+        return restResult(null, 0, null, false);
+    }
+
+    public static <T> R<T> failed(String msg) {
+        return restResult(null, 0, msg, false);
+    }
+
+    public static <T> R<T> failed(T data) {
+        return restResult(data, 0, null, false);
+    }
+
+    public static <T> R<T> failed(T data, String msg) {
+        return restResult(data, 0, msg, false);
+    }
+
+    public static <T> R<T> failed(T data, String msg, int code) {
+        return restResult(data, code, msg, false);
+    }
+
+    private static <T> R<T> restResult(T data, int code, String msg, Boolean status) {
+        R<T> apiResult = new R<>();
+        apiResult.setCode(code);
+        apiResult.setData(data);
+        apiResult.setMsg(msg);
+        apiResult.setStatus(status);
+        return apiResult;
+    }
+}

+ 54 - 0
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/dto/WalletDto.java

@@ -0,0 +1,54 @@
+package com.sckw.payment.api.model.dto;
+
+import com.alibaba.fastjson2.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 钱包清单
+ */
+@Data
+public class WalletDto implements Serializable {
+    /**
+     * 钱包名称
+     */
+    private String name;
+    /**
+     * uid对应的企业名称
+     */
+    @JSONField(name = "member_name")
+    private String memberName;
+
+    private String uid;
+    /**
+     * 渠道
+     */
+    private String channel;
+
+    @JSONField(name = "create_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    private String filter;
+    /**
+     * 冻结金额(分)
+     */
+    private Long freeze;
+    /**
+     * 预付金额(分)
+     */
+    @JSONField(name = "ap_money")
+    private Long apMoney;
+    /**
+     * 总金额(分)
+     */
+    @JSONField(name = "total_money")
+    private Long totalMoney;
+    /**
+     * 线上可用余额(分)
+     */
+    private Long money;
+}