TRX 1 năm trước cách đây
mục cha
commit
16c4f58e21
12 tập tin đã thay đổi với 731 bổ sung0 xóa
  1. 79 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/cooperator/platmatModel/ShopOpenWithDrawModel.java
  2. 87 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/cooperator/platmatModel/ShopWithDrawRecordModel.java
  3. 52 0
      PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/cooperator/platmatModel/ShopWithDrawRecordSearch.java
  4. 42 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/controller/unionFrictionlessPay/CooperatorController.java
  5. 22 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/ShopOpenWithDrawDao.java
  6. 23 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/ShopWithDrawRecordDao.java
  7. 19 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/extend/ShopWithDrawRecordDaoExtend.java
  8. 86 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/impl/ShopWithDrawRecordDaoImpl.java
  9. 79 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/ShopOpenWithDraw.java
  10. 124 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/ShopWithDrawRecord.java
  11. 114 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/CooperatorService.java
  12. 4 0
      PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/UnionFrictionlessPayMainService.java

+ 79 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/cooperator/platmatModel/ShopOpenWithDrawModel.java

@@ -0,0 +1,79 @@
+package com.zhongshu.payment.client.payModel.cooperator.platmatModel;
+
+import com.zhongshu.card.client.model.base.SuperModel;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author TRX
+ * @date 2024/9/5
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ShopOpenWithDrawModel extends SuperModel {
+
+    @Schema(description = "商户oid")
+    private String shopId;
+
+    @Schema(description = "商户名称")
+    private String shopName;
+
+    @Schema(description = "商户号")
+    private String mchntNo;
+
+    @Schema(description = "是否满足开通D0标记 00:不满90天 01:满足开通条件02:商户异常")
+    private String status;
+
+    @Schema(description = "是否允许开通")
+    private Boolean isAllow = Boolean.FALSE;
+
+    public Boolean getIsAllow() {
+        if (status != null && "01".equals(status)) {
+            return Boolean.TRUE;
+        }
+        return Boolean.FALSE;
+    }
+
+    private String statusStr;
+
+    public String getStatusStr() {
+        if (status != null) {
+            if ("00".equals(status)) {
+                return "不满90天";
+            } else if ("01".equals(status)) {
+                return "满足开通条件";
+            } else if ("02".equals(status)) {
+                return "不许开通";
+            }
+        }
+        return "";
+    }
+
+    @Schema(description = "划付类型 D0A:D0A划付-自由提现 D0B:D0B划付-自动划付 T0A:T0A划付-自由提现")
+    private String type;
+
+    private String typeStr;
+
+    public String getType() {
+        if (type != null) {
+            if ("D0A".equals(type)) {
+                return "D0A划付-自由提现";
+            } else if ("D0B".equals(type)) {
+                return "D0B划付-自动划付";
+            } else if ("T0A".equals(type)) {
+                return "T0A划付-自由提现";
+            }
+        }
+        return "";
+    }
+
+    @Schema(description = "申请的参数")
+    private Object requestParam;
+
+    @Schema(description = "响应的数据")
+    private Object response;
+
+}

+ 87 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/cooperator/platmatModel/ShopWithDrawRecordModel.java

@@ -0,0 +1,87 @@
+package com.zhongshu.payment.client.payModel.cooperator.platmatModel;
+
+import com.github.microservice.types.unionFrictionlessPayType.WithDrawState;
+import com.zhongshu.card.client.model.base.SuperModel;
+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/5
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ShopWithDrawRecordModel extends SuperModel {
+    @Schema(description = "商户oid")
+    private String shopId;
+
+    @Schema(description = "商户名称")
+    private String shopName;
+
+    @Schema(description = "商户号")
+    private String mchntNo;
+
+    @Schema(description = "提现状态")
+    private WithDrawState withDrawState;
+
+    @Schema(description = "系统订单号, 外部平台需保证各自系统上传的该字段的唯一性")
+    private String sysOrderId;
+
+    @Schema(description = "提现类型  0 - D0 1 - D1(对公对私是TN内部维护)")
+    private String withdrawType = "0";
+
+    @Schema(description = "提现金额 单位分")
+    private BigDecimal withdrawAmt;
+
+    @Schema(description = "流水号")
+    private String ssn;
+
+    @Schema(description = "提现时间 格式:YYYY-MM-DD HH:MM:SS")
+    private String transTime;
+
+    @Schema(description = "提现结果 -1:数据问题 0:处理中 1:已记账未支付;2:已支付,状态未知;3:处理成功;4:支付失败;5:支付失败,余额已退回6:已手工重新发起支付")
+    private String status;
+
+    private String statusStr;
+
+    public String getStatusStr() {
+        if (status != null) {
+            switch (status) {
+                case "-1":
+                    return "数据问题";
+                case "0":
+                    return "处理中";
+                case "1":
+                    return "已记账未支付";
+                case "2":
+                    return "已支付,状态未知";
+                case "3":
+                    return "处理成功";
+                case "4":
+                    return "支付失败";
+                case "5":
+                    return "支付失败,余额已退回";
+                case "6":
+                    return "已手工重新发起支付";
+            }
+        }
+        return "";
+    }
+
+    @Schema(description = "提现结果描述")
+    private String desc;
+
+    @Schema(description = "申请的参数")
+    private Object requestParam;
+
+    @Schema(description = "响应的数据")
+    private Object response;
+
+    @Schema(description = "提现的状态")
+    private Object withResponse;
+}

+ 52 - 0
PaymentClient/src/main/java/com/zhongshu/payment/client/payModel/cooperator/platmatModel/ShopWithDrawRecordSearch.java

@@ -0,0 +1,52 @@
+package com.zhongshu.payment.client.payModel.cooperator.platmatModel;
+
+import com.github.microservice.types.unionFrictionlessPayType.WithDrawState;
+import com.zhongshu.card.client.model.base.SuperSearch;
+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/5
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ShopWithDrawRecordSearch extends SuperSearch {
+    @Schema(description = "商户oid")
+    private String shopId;
+
+    @Schema(description = "商户名称")
+    private String shopName;
+
+    @Schema(description = "商户号")
+    private String mchntNo;
+
+    @Schema(description = "提现状态")
+    private WithDrawState withDrawState;
+
+    @Schema(description = "系统订单号, 外部平台需保证各自系统上传的该字段的唯一性")
+    private String sysOrderId;
+
+    @Schema(description = "提现类型  0 - D0 1 - D1(对公对私是TN内部维护)")
+    private String withdrawType = "0";
+
+    @Schema(description = "提现金额 单位分")
+    private BigDecimal withdrawAmt;
+
+    @Schema(description = "流水号")
+    private String ssn;
+
+    @Schema(description = "提现时间 格式:YYYY-MM-DD HH:MM:SS")
+    private String transTime;
+
+    @Schema(description = "提现结果 -1:数据问题 0:处理中 1:已记账未支付;2:已支付,状态未知;3:处理成功;4:支付失败;5:支付失败,余额已退回6:已手工重新发起支付")
+    private String status;
+
+    @Schema(description = "提现结果描述")
+    private String desc;
+}

+ 42 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/controller/unionFrictionlessPay/CooperatorController.java

@@ -4,20 +4,30 @@ import com.github.microservice.auth.security.annotations.ResourceAuth;
 import com.github.microservice.auth.security.helper.AuthHelper;
 import com.github.microservice.auth.security.type.AuthType;
 import com.github.microservice.net.ResultContent;
+import com.zhongshu.card.client.model.payment.ExpenseFlowModel;
+import com.zhongshu.card.client.model.payment.ExpenseFlowSearch;
 import com.zhongshu.payment.client.payModel.commn.PayNotifyParam;
 import com.zhongshu.payment.client.payModel.cooperator.CooperatorParam;
+import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopWithDrawRecordModel;
+import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopWithDrawRecordSearch;
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionUserOpenInfoModel;
 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;
+import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.CooperatorService;
 import com.zhongshu.payment.server.core.service.pay.impl.unionFrictionlessPay.UnionFrictionlessPayMainService;
 import io.swagger.v3.oas.annotations.Hidden;
 import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.web.PageableDefault;
 import org.springframework.http.MediaType;
+import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -41,6 +51,9 @@ public class CooperatorController {
     @Autowired
     AuthHelper authHelper;
 
+    @Autowired
+    CooperatorService cooperatorService;
+
     //---------------------------业务 start-----------------------------
     @Operation(summary = "查询商户可提现金额")
     @ResourceAuth(value = "user", type = AuthType.User)
@@ -77,6 +90,35 @@ public class CooperatorController {
         return unionFrictionlessPayMainService.openWithdraw(param);
     }
 
+    @ResourceAuth(value = "user", type = AuthType.User)
+    @Operation(summary = "提现记录-分页列表", description = "提现记录-分页列表")
+    @RequestMapping(value = {"pageWithDraw"}, method = {RequestMethod.POST})
+    public ResultContent<Page<ShopWithDrawRecordModel>> pageWithDraw(
+            @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
+            @Parameter(required = false) ShopWithDrawRecordSearch param) {
+        return cooperatorService.pageWithDraw(pageable, param);
+    }
+
+    @Operation(summary = "根据ID查询提现记录详情", description = "根据ID查询提现记录")
+    @PostMapping(value = "getWithDrawById")
+    public ResultContent<ShopWithDrawRecordModel> getWithDrawById(@RequestParam("id") String id) {
+        return cooperatorService.getWithDrawById(id);
+    }
+
+    @Operation(summary = "根据订单号查询记录详情", description = "根据订单号查询记录详情")
+    @PostMapping(value = "getWithDrawBySysOrderId")
+    public ResultContent<ShopWithDrawRecordModel> getWithDrawBySysOrderId(
+            @RequestParam("sysOrderId") String sysOrderId) {
+        return cooperatorService.getWithDrawBySysOrderId(sysOrderId);
+    }
+
+    @Operation(summary = "根据流水号查询记录详情", description = "根据流水号查询记录详情")
+    @PostMapping(value = "getWithDrawBySsn")
+    public ResultContent<ShopWithDrawRecordModel> getWithDrawBySsn(
+            @RequestParam("ssn") String ssn) {
+        return cooperatorService.getWithDrawBySsn(ssn);
+    }
+
     //---------------------------通知 start-----------------------------
     @Operation(summary = "提现结果通知回调")
     @PostMapping(value = "withDrawNotify/{sysOrderId}", consumes = MediaType.APPLICATION_JSON_VALUE)

+ 22 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/ShopOpenWithDrawDao.java

@@ -0,0 +1,22 @@
+package com.zhongshu.payment.server.core.dao.unionFrictionlessPay;
+
+import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
+import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.extend.UnionUserOpenInfoDaoExtend;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopOpenWithDraw;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.UnionUserOpenInfo;
+
+import java.util.List;
+
+/**
+ *
+ *
+ * @author TRX
+ * @date 2024/3/21
+ */
+public interface ShopOpenWithDrawDao extends MongoDao<ShopOpenWithDraw> {
+
+    UnionUserOpenInfo findTopById(String id);
+
+    UnionUserOpenInfo findTopByShopId(String shopId);
+
+}

+ 23 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/ShopWithDrawRecordDao.java

@@ -0,0 +1,23 @@
+package com.zhongshu.payment.server.core.dao.unionFrictionlessPay;
+
+import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
+import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.extend.ShopWithDrawRecordDaoExtend;
+import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.extend.UnionUserOpenInfoDaoExtend;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopWithDrawRecord;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.UnionUserOpenInfo;
+
+import java.util.List;
+
+/**
+ * @author TRX
+ * @date 2024/3/21
+ */
+public interface ShopWithDrawRecordDao extends MongoDao<ShopWithDrawRecord>, ShopWithDrawRecordDaoExtend {
+
+    ShopWithDrawRecord findTopById(String id);
+
+    ShopWithDrawRecord findTopBySysOrderId(String sysOrderId);
+
+    ShopWithDrawRecord findTopBySsn(String ssn);
+
+}

+ 19 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/extend/ShopWithDrawRecordDaoExtend.java

@@ -0,0 +1,19 @@
+package com.zhongshu.payment.server.core.dao.unionFrictionlessPay.extend;
+
+import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopWithDrawRecordSearch;
+import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionUserOpenInfoSearch;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopWithDrawRecord;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.UnionUserOpenInfo;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+/**
+ * @Author TRX
+ * @CreateDate: 2023/7/7
+ * @Version: 1.0
+ */
+public interface ShopWithDrawRecordDaoExtend {
+
+    Page<ShopWithDrawRecord> page(Pageable pageable, ShopWithDrawRecordSearch param);
+
+}

+ 86 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/dao/unionFrictionlessPay/impl/ShopWithDrawRecordDaoImpl.java

@@ -0,0 +1,86 @@
+package com.zhongshu.payment.server.core.dao.unionFrictionlessPay.impl;
+
+import com.github.microservice.components.data.mongo.mongo.helper.DBHelper;
+import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopWithDrawRecordSearch;
+import com.zhongshu.payment.client.payModel.unionFrictionlessPay.model.UnionUserOpenInfoSearch;
+import com.zhongshu.payment.server.core.dao.BaseImpl;
+import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.extend.ShopWithDrawRecordDaoExtend;
+import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.extend.UnionUserOpenInfoDaoExtend;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.ShopWithDrawRecord;
+import com.zhongshu.payment.server.core.domain.unionFrictionlessPay.UnionUserOpenInfo;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+/**
+ * @Author TRX
+ * @CreateDate: 2023/4/12
+ * @Version: 1.0
+ */
+public class ShopWithDrawRecordDaoImpl extends BaseImpl implements ShopWithDrawRecordDaoExtend {
+
+    @Autowired
+    private DBHelper dbHelper;
+
+    @Override
+    public Page<ShopWithDrawRecord> page(Pageable pageable, ShopWithDrawRecordSearch param) {
+        Criteria criteria = new Criteria();
+
+        if (ObjectUtils.isNotEmpty(param.getShopId())) {
+            criteria.and("shopId").is(param.getShopId());
+        }
+
+        if (param.getWithDrawState() != null) {
+            criteria.and("withDrawState").is(param.getWithDrawState());
+        }
+
+        // 模糊搜索
+        List<Criteria> criterias = new ArrayList<>();
+        if (StringUtils.isNotEmpty(param.getSysOrderId())) {
+            Pattern pattern = Pattern.compile("^.*" + param.getSysOrderId() + ".*$");
+            criterias.add(Criteria.where("sysOrderId").is(pattern));
+        }
+
+        if (StringUtils.isNotEmpty(param.getSsn())) {
+            Pattern pattern = Pattern.compile("^.*" + param.getSsn() + ".*$");
+            criterias.add(Criteria.where("ssn").is(pattern));
+        }
+
+        if (StringUtils.isNotEmpty(param.getDesc())) {
+            Pattern pattern = Pattern.compile("^.*" + param.getDesc() + ".*$");
+            criterias.add(Criteria.where("desc").is(pattern));
+        }
+
+        if (!CollectionUtils.isEmpty(criterias)) {
+            criteria.andOperator(criterias.toArray(new Criteria[]{}));
+        }
+
+//        if (StringUtils.isNotEmpty(param.getKeyWord())) {
+//            Pattern pattern = Pattern.compile("^.*" + param.getKeyWord() + ".*$");
+//            criteria.orOperator(
+//                    Criteria.where("name").regex(pattern),
+//                    Criteria.where("code").regex(pattern),
+//                    Criteria.where("userId").regex(pattern),
+//                    Criteria.where("userName").regex(pattern),
+//                    Criteria.where("phone").regex(pattern)
+//            );
+//        }
+
+        criteria.and("isDelete").is(Boolean.FALSE);
+        Sort sort = buildSort(param);
+        Query query = Query.query(criteria);
+        query.with(sort);
+        return dbHelper.pages(query, pageable, ShopWithDrawRecord.class);
+    }
+
+}

+ 79 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/ShopOpenWithDraw.java

@@ -0,0 +1,79 @@
+package com.zhongshu.payment.server.core.domain.unionFrictionlessPay;
+
+import com.zhongshu.payment.server.core.domain.base.SuperMain;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+/**
+ * 商户开通 收钱吧提现信息
+ *
+ * @author TRX
+ * @date 2024/9/5
+ */
+@Data
+@Document
+public class ShopOpenWithDraw extends SuperMain {
+
+    @Schema(description = "商户oid")
+    private String shopId;
+
+    @Schema(description = "商户名称")
+    private String shopName;
+
+    @Schema(description = "商户号")
+    private String mchntNo;
+
+    @Schema(description = "是否满足开通D0标记 00:不满90天 01:满足开通条件02:商户异常")
+    private String status;
+
+    @Schema(description = "是否允许开通")
+    private Boolean isAllow = Boolean.FALSE;
+
+    public Boolean getIsAllow() {
+        if (status != null && "01".equals(status)) {
+            return Boolean.TRUE;
+        }
+        return Boolean.FALSE;
+    }
+
+    private String statusStr;
+
+    public String getStatusStr() {
+        if (status != null) {
+            if ("00".equals(status)) {
+                return "不满90天";
+            } else if ("01".equals(status)) {
+                return "满足开通条件";
+            } else if ("02".equals(status)) {
+                return "不许开通";
+            }
+        }
+        return "";
+    }
+
+    @Schema(description = "划付类型 D0A:D0A划付-自由提现 D0B:D0B划付-自动划付 T0A:T0A划付-自由提现")
+    private String type;
+
+    private String typeStr;
+
+    public String getType() {
+        if (type != null) {
+            if ("D0A".equals(type)) {
+                return "D0A划付-自由提现";
+            } else if ("D0B".equals(type)) {
+                return "D0B划付-自动划付";
+            } else if ("T0A".equals(type)) {
+                return "T0A划付-自由提现";
+            }
+        }
+        return "";
+    }
+
+    @Schema(description = "申请的参数")
+    private Object requestParam;
+
+    @Schema(description = "响应的数据")
+    private Object response;
+
+}

+ 124 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/domain/unionFrictionlessPay/ShopWithDrawRecord.java

@@ -0,0 +1,124 @@
+package com.zhongshu.payment.server.core.domain.unionFrictionlessPay;
+
+import com.github.microservice.types.unionFrictionlessPayType.WithDrawState;
+import com.zhongshu.card.client.utils.DateUtils;
+import com.zhongshu.payment.server.core.domain.base.SuperMain;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.math.BigDecimal;
+
+/**
+ * 商户开通 提现记录
+ *
+ * @author TRX
+ * @date 2024/9/5
+ */
+@Data
+@Document
+public class ShopWithDrawRecord extends SuperMain {
+
+    @Schema(description = "商户oid")
+    private String shopId;
+
+    @Schema(description = "商户名称")
+    private String shopName;
+
+    @Schema(description = "商户号")
+    private String mchntNo;
+
+    @Schema(description = "操作的用户ID")
+    private String userId;
+
+    @Schema(description = "提现状态")
+    private WithDrawState withDrawState;
+
+    @Schema(description = "系统订单号, 外部平台需保证各自系统上传的该字段的唯一性")
+    private String sysOrderId;
+
+    @Schema(description = "提现类型  0 - D0 1 - D1(对公对私是TN内部维护)")
+    private String withdrawType = "0";
+
+    @Schema(description = "提现金额 单位分")
+    private BigDecimal withdrawAmt;
+
+    @Schema(description = "流水号")
+    private String ssn;
+
+    @Schema(description = "提现时间 格式:YYYY-MM-DD HH:MM:ss")
+    private String transTime;
+
+    @Schema(description = "提现结果 -1:数据问题 0:处理中 1:已记账未支付;2:已支付,状态未知;3:处理成功;4:支付失败;5:支付失败,余额已退回6:已手工重新发起支付")
+    private String status;
+
+    private String statusStr;
+
+    public String getStatusStr() {
+        if (status != null) {
+            switch (status) {
+                case "-1":
+                    return "数据问题";
+                case "0":
+                    return "处理中";
+                case "1":
+                    return "已记账未支付";
+                case "2":
+                    return "已支付,状态未知";
+                case "3":
+                    return "处理成功";
+                case "4":
+                    return "支付失败";
+                case "5":
+                    return "支付失败,余额已退回";
+                case "6":
+                    return "已手工重新发起支付";
+            }
+        }
+        return "";
+    }
+
+    @Schema(description = "提现结果描述")
+    private String desc;
+
+    @Schema(description = "申请的参数")
+    private Object requestParam;
+
+    @Schema(description = "响应的数据")
+    private Object response;
+
+    @Schema(description = "提现的状态")
+    private Object withResponse;
+
+    //-------------------时间 start -----------------------
+    @Schema(description = "年份,如:2024")
+    private Integer year;
+
+    @Schema(description = "月份,如:6")
+    private Integer month;
+
+    @Schema(description = "第几周,如:32")
+    private Integer week;
+
+    @Schema(description = "当前月的第几天")
+    private Integer dayOfMonth;
+
+    @Schema(description = "当前年的第几天")
+    private Integer dayOfYear;
+
+    @Schema(description = "当前的第几小时")
+    private Integer hourOfDay;
+
+    @Schema(description = "消费创建时间")
+    private String paymentTime;
+
+    public void setTimes() {
+        this.year = DateUtils.getCurrentYear();
+        this.dayOfYear = DateUtils.getCurrentDayInYear();
+        this.month = DateUtils.getCurrentMonthInYear();
+        this.week = DateUtils.getCurrentWeekInYear();
+        this.dayOfMonth = DateUtils.getCurrentDayInMonth();
+        this.hourOfDay = DateUtils.getCurrentHourOfDay();
+        this.paymentTime = DateUtils.paresTime(System.currentTimeMillis(), DateUtils.patternyyyySSS);
+    }
+}

+ 114 - 0
PaymentServer/src/main/java/com/zhongshu/payment/server/core/service/pay/impl/unionFrictionlessPay/CooperatorService.java

@@ -0,0 +1,114 @@
+package com.zhongshu.payment.server.core.service.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.zhongshu.card.client.service.feign.OrganizationFeignService;
+import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopOpenWithDrawModel;
+import com.zhongshu.payment.client.payModel.cooperator.platmatModel.ShopWithDrawRecordModel;
+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.service.base.SuperService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.stereotype.Service;
+
+/**
+ * 收钱吧 -- 服务
+ *
+ * @author TRX
+ * @date 2024/9/5
+ */
+@Slf4j
+@Service
+public class CooperatorService extends SuperService {
+
+    @Autowired
+    ShopOpenWithDrawDao shopOpenWithDrawDao;
+
+    @Autowired
+    ShopWithDrawRecordDao shopWithDrawRecordDao;
+
+    @Autowired
+    OrganizationFeignService organizationFeignService;
+
+    /**
+     * 提现记录列表
+     *
+     * @param pageable
+     * @param param
+     * @return
+     */
+    public ResultContent<Page<ShopWithDrawRecordModel>> pageWithDraw(Pageable pageable, ShopWithDrawRecordSearch param) {
+        Page<ShopWithDrawRecord> page = shopWithDrawRecordDao.page(pageable, param);
+        return ResultContent.buildSuccess(PageEntityUtil.toPageModel(page, this::toModel));
+    }
+
+    /**
+     * 根据ID查询提现记录
+     *
+     * @param id
+     * @return
+     */
+    public ResultContent<ShopWithDrawRecordModel> getWithDrawById(String id) {
+        ShopWithDrawRecord record = shopWithDrawRecordDao.findTopById(id);
+        if (ObjectUtils.isEmpty(record)) {
+            return ResultContent.buildFail(String.format("数据不存在:%s", id));
+        }
+        return ResultContent.buildSuccess(toModel(record));
+    }
+
+    /**
+     * 根据订单号查询记录详情
+     *
+     * @param sysOrderId
+     * @return
+     */
+    public ResultContent<ShopWithDrawRecordModel> getWithDrawBySysOrderId(String sysOrderId) {
+        ShopWithDrawRecord record = shopWithDrawRecordDao.findTopBySysOrderId(sysOrderId);
+        if (ObjectUtils.isEmpty(record)) {
+            return ResultContent.buildFail(String.format("订单号不存在:%s", sysOrderId));
+        }
+        return ResultContent.buildSuccess(toModel(record));
+    }
+
+    /**
+     * 根据流水号查询记录详情
+     *
+     * @param ssn
+     * @return
+     */
+    public ResultContent<ShopWithDrawRecordModel> getWithDrawBySsn(String ssn) {
+        ShopWithDrawRecord record = shopWithDrawRecordDao.findTopBySsn(ssn);
+        if (ObjectUtils.isEmpty(record)) {
+            return ResultContent.buildFail(String.format("流水号不存在:%s", ssn));
+        }
+        return ResultContent.buildSuccess(toModel(record));
+    }
+
+    public ShopOpenWithDrawModel toModel(ShopOpenWithDraw entity) {
+        ShopOpenWithDrawModel model = null;
+        if (ObjectUtils.isNotEmpty(entity)) {
+            model = new ShopOpenWithDrawModel();
+            BeanUtils.copyProperties(entity, model);
+        }
+        return model;
+    }
+
+    public ShopWithDrawRecordModel toModel(ShopWithDrawRecord entity) {
+        ShopWithDrawRecordModel model = null;
+        if (ObjectUtils.isNotEmpty(entity)) {
+            model = new ShopWithDrawRecordModel();
+            BeanUtils.copyProperties(entity, model);
+        }
+        return model;
+    }
+
+}

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

@@ -37,6 +37,7 @@ import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.Us
 import com.zhongshu.payment.client.payModel.unionFrictionlessPay.paymentModel.UserSignQueryParam;
 import com.zhongshu.payment.client.types.TradeType;
 import com.zhongshu.payment.server.core.dao.RechargeRecordDao;
+import com.zhongshu.payment.server.core.dao.unionFrictionlessPay.ShopOpenWithDrawDao;
 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.UnionUserOpenInfo;
@@ -112,6 +113,9 @@ public class UnionFrictionlessPayMainService extends SuperPayService {
     @Autowired
     WithdrawConfig withdrawConfig;
 
+    @Autowired
+    ShopOpenWithDrawDao shopOpenWithDrawDao;
+
     /**
      * 发起签约
      *