Sfoglia il codice sorgente

修改 对账功能,时间参数调整

xucaiqin 2 anni fa
parent
commit
7cfe83d647

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LedgerSuccessReq.java

@@ -7,7 +7,7 @@ import jakarta.validation.constraints.Size;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.time.LocalDateTime;
+import java.time.LocalDate;
 
 /**
  * 对账完成
@@ -26,7 +26,7 @@ public class LedgerSuccessReq {
 
     @NotNull(message = "预计收款日期不能为空")
     @JsonFormat(pattern = "yyyy-MM-dd")
-    private LocalDateTime receiptTime;
+    private LocalDate receiptTime;
 
     @NotBlank(message = "财务联系电话不能为空")
     @Size(max = 11, message = "财务联系电话不能超过11个字符")

+ 2 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LogisticsReq.java

@@ -7,7 +7,6 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.io.Serial;
-import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -20,10 +19,9 @@ public class LogisticsReq extends BasePara {
     @Serial
     private static final long serialVersionUID = 5328731681168692784L;
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-
-    private LocalDateTime startCreateTime;
+    private String startCreateTime;
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private LocalDateTime endCreateTime;
+    private String endCreateTime;
     private Integer trading;
     /**
      * @see LedgerEnum

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/LogisticsSendReq.java

@@ -37,14 +37,14 @@ public class LogisticsSendReq {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
 //    @NotNull(message = "计划开始日期不能为空")
-    private LocalDateTime startTime;
+    private String startTime;
     /**
      * 结束日期
      */
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
 //    @NotNull(message = "计划结束日期不能为空")
-    private LocalDateTime endTime;
+    private String endTime;
     /**
      * 实际结算金额
      */

+ 4 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/TradeReq.java

@@ -7,7 +7,6 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.io.Serial;
-import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -19,10 +18,10 @@ import java.util.List;
 public class TradeReq extends BasePara {
     @Serial
     private static final long serialVersionUID = 5328731681168692784L;
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private LocalDateTime startCreateTime;
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private LocalDateTime endCreateTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String startCreateTime;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String endCreateTime;
     private Integer trading;
     /**
      * @see LedgerEnum

+ 2 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/TradeSendReq.java

@@ -38,14 +38,14 @@ public class TradeSendReq {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
 //    @NotNull(message = "计划开始日期不能为空")
-    private LocalDateTime startTime;
+    private String startTime;
     /**
      * 结束日期
      */
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
 //    @NotNull(message = "计划结束日期不能为空")
-    private LocalDateTime endTime;
+    private String endTime;
     /**
      * 实际结算金额
      */

+ 18 - 7
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java

@@ -8,6 +8,7 @@ import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.OrderGenerateUtils;
+import com.sckw.core.utils.StringTimeUtil;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.payment.dao.KwpLedgerLogisticsMapper;
 import com.sckw.payment.model.*;
@@ -25,12 +26,14 @@ import com.sckw.transport.api.model.dto.vo.KwtLogisticsOrderVO;
 import com.sckw.transport.api.model.dto.vo.LogisticsOrderVO;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -77,9 +80,17 @@ public class KwpLedgerLogisticsService extends AbsLedger {
             logisticsDto.setStatusLabel(LedgerEnum.getDesc(logisticsDto.getStatus()));
         }
     }
-
-    public PageRes<ILedger> shipperList(LogisticsReq logisticsReq) {
+    private void fillPara(LogisticsReq logisticsReq) {
         logisticsReq.setEntId(LoginUserHolder.getEntId());
+        if (StringUtils.isNotBlank(logisticsReq.getStartCreateTime())) {
+            logisticsReq.setStartCreateTime(StringTimeUtil.fillStart(logisticsReq.getStartCreateTime()));
+        }
+        if (StringUtils.isNotBlank(logisticsReq.getEndCreateTime())) {
+            logisticsReq.setEndCreateTime(StringTimeUtil.fillEnd(logisticsReq.getEndCreateTime()));
+        }
+    }
+    public PageRes<ILedger> shipperList(LogisticsReq logisticsReq) {
+        fillPara(logisticsReq);
         PageHelper.startPage(logisticsReq.getPage(), logisticsReq.getPageSize());
         List<LedgerShipperDto> kwpLedgerLogisticsList = logisticsMapper.shipperSelect(logisticsReq);
         //字典转换
@@ -92,7 +103,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     }
 
     public PageRes<ILedger> carrierList(LogisticsReq logisticsReq) {
-        logisticsReq.setEntId(LoginUserHolder.getEntId());
+        fillPara(logisticsReq);
         PageHelper.startPage(logisticsReq.getPage(), logisticsReq.getPageSize());
         List<LedgerCarrierDto> kwpLedgerLogisticsList = logisticsMapper.carrierSelect(logisticsReq);
         //字典转换
@@ -144,8 +155,8 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpLedgerLogistics.setId(Objects.isNull(logisticsSendReq.getId()) ? new IdWorker(1).nextId() : logisticsSendReq.getId());
         kwpLedgerLogistics.setEntId(LoginUserHolder.getEntId());
         kwpLedgerLogistics.setName(logisticsSendReq.getName());
-        kwpLedgerLogistics.setStartTime(logisticsSendReq.getStartTime());
-        kwpLedgerLogistics.setEndTime(logisticsSendReq.getEndTime());
+        kwpLedgerLogistics.setStartTime(StringTimeUtil.startDateTime(logisticsSendReq.getStartTime()));
+        kwpLedgerLogistics.setEndTime(StringTimeUtil.endDateTime(logisticsSendReq.getEndTime()));
         kwpLedgerLogistics.setTaxRate(logisticsSendReq.getTaxRate());
         kwpLedgerLogistics.setTrading(logisticsSendReq.getTrading());
         kwpLedgerLogistics.setTotalPrice(logisticsSendReq.getTotalPrice());
@@ -370,7 +381,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
 
         successCheck(kwpLedgerLogistics.getStatus());
 
-        kwpLedgerLogistics.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpLedgerLogistics.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpLedgerLogistics.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
         kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
@@ -389,7 +400,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         kwpSettlementLogistics.setAuditPhone(kwpLedgerLogistics.getAuditPhone());
         kwpSettlementLogistics.setSuccessUser(ledgerReq.getSuccessUser());
         kwpSettlementLogistics.setSuccessPhone(ledgerReq.getSuccessPhone());
-        kwpSettlementLogistics.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpSettlementLogistics.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpSettlementLogistics.setStatus(1);//1-待结算
         kwpSettlementLogistics.setCreateBy(LoginUserHolder.getUserId());
         kwpSettlementLogistics.setCreateTime(LocalDateTime.now());

+ 19 - 7
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java

@@ -9,6 +9,7 @@ import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.OrderGenerateUtils;
+import com.sckw.core.utils.StringTimeUtil;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
 import com.sckw.order.api.model.OrderDetailRes;
@@ -25,12 +26,14 @@ import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -79,6 +82,16 @@ public class KwpLedgerTradeService extends AbsLedger {
         }
     }
 
+    private void fillPara(TradeReq tradeReq) {
+        tradeReq.setEntId(LoginUserHolder.getEntId());
+        if (StringUtils.isNotBlank(tradeReq.getStartCreateTime())) {
+            tradeReq.setStartCreateTime(StringTimeUtil.fillStart(tradeReq.getStartCreateTime()));
+        }
+        if (StringUtils.isNotBlank(tradeReq.getEndCreateTime())) {
+            tradeReq.setEndCreateTime(StringTimeUtil.fillEnd(tradeReq.getEndCreateTime()));
+        }
+    }
+
     /**
      * 销售方
      *
@@ -86,7 +99,7 @@ public class KwpLedgerTradeService extends AbsLedger {
      * @return
      */
     public PageRes<ILedger> sellList(TradeReq tradeReq) {
-        tradeReq.setEntId(LoginUserHolder.getEntId());
+        fillPara(tradeReq);
         PageHelper.startPage(tradeReq.getPage(), tradeReq.getPageSize());
         List<LedgerSellDto> ledgerTradeDto = tradeMapper.sellList(tradeReq);
         //字典转换
@@ -105,8 +118,7 @@ public class KwpLedgerTradeService extends AbsLedger {
      * @return
      */
     public PageRes<ILedger> purchaseList(TradeReq tradeReq) {
-        tradeReq.setEntId(LoginUserHolder.getEntId());
-
+        fillPara(tradeReq);
         PageHelper.startPage(tradeReq.getPage(), tradeReq.getPageSize());
         List<LedgerPurchaseDto> ledgerTradeDto = tradeMapper.purchaseList(tradeReq);
         //字典转换
@@ -132,8 +144,8 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpLedgerTrade.setId(Objects.isNull(tradeSendReq.getId()) ? new IdWorker(1).nextId() : tradeSendReq.getId());
         kwpLedgerTrade.setEntId(LoginUserHolder.getEntId());
         kwpLedgerTrade.setName(tradeSendReq.getName());
-        kwpLedgerTrade.setStartTime(tradeSendReq.getStartTime());
-        kwpLedgerTrade.setEndTime(tradeSendReq.getEndTime());
+        kwpLedgerTrade.setStartTime(StringTimeUtil.startDateTime(tradeSendReq.getStartTime()));
+        kwpLedgerTrade.setEndTime(StringTimeUtil.endDateTime(tradeSendReq.getEndTime()));
         kwpLedgerTrade.setTaxRate(tradeSendReq.getTaxRate());
         kwpLedgerTrade.setTrading(tradeSendReq.getTrading());
         kwpLedgerTrade.setTotalPrice(tradeSendReq.getTotalPrice());
@@ -396,7 +408,7 @@ public class KwpLedgerTradeService extends AbsLedger {
         }
         successCheck(kwpLedgerTrade.getStatus());
 
-        kwpLedgerTrade.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpLedgerTrade.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpLedgerTrade.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerTrade.setUpdateTime(LocalDateTime.now());
         tradeMapper.updateById(kwpLedgerTrade);
@@ -414,7 +426,7 @@ public class KwpLedgerTradeService extends AbsLedger {
         kwpSettlementTrade.setAuditPhone(kwpLedgerTrade.getAuditPhone());
         kwpSettlementTrade.setSuccessUser(ledgerReq.getSuccessUser());
         kwpSettlementTrade.setSuccessPhone(ledgerReq.getSuccessPhone());
-        kwpSettlementTrade.setReceiptTime(ledgerReq.getReceiptTime());
+        kwpSettlementTrade.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
         kwpSettlementTrade.setStatus(1);//1-待结算
         kwpSettlementTrade.setCreateBy(LoginUserHolder.getUserId());
         kwpSettlementTrade.setCreateTime(LocalDateTime.now());

+ 515 - 34
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java

@@ -3,20 +3,26 @@ package com.sckw.payment.service;
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.TypeReference;
+import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.OkHttpUtils;
-import com.sckw.core.utils.StringUtils;
 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 com.sckw.payment.api.model.dto.*;
+import com.sckw.payment.api.model.dto.common.BusinessNo;
+import com.sckw.payment.api.model.dto.common.R;
+import com.sckw.payment.api.model.dto.page.CashPage;
+import com.sckw.payment.api.model.dto.page.PrePayIndexPage;
+import com.sckw.payment.api.model.dto.page.RecordPage;
 import com.sckw.payment.model.constant.PayCenterEnum;
+import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
 
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 
 /**
  * 转发中台接口
@@ -26,6 +32,8 @@ import java.util.Objects;
  */
 @Service
 @Slf4j
+@RefreshScope
+@Validated
 public class PayCenterService {
     @Value("${payCenter.address}")
     private String payCenterAddr;
@@ -42,6 +50,72 @@ public class PayCenterService {
         return ok;
     }
 
+    private String getHttp(PayCenterEnum payCenterEnum, Map<String, Object> para) {
+        log.info("{}入参->{}", payCenterEnum.getDesc(), JSONObject.toJSONString(para));
+        OkHttpUtils okHttpUtils = OkHttpUtils.builder().url(payCenterAddr + payCenterEnum.getAddr());
+        if (!CollectionUtils.isEmpty(para)) {
+            for (Map.Entry<String, Object> p : para.entrySet()) {
+                //跳过非空参数
+                if (Objects.isNull(p.getValue())) {
+                    continue;
+                }
+                if (p.getValue() instanceof ChannelEnum channelEnum) {
+                    okHttpUtils.addPara(p.getKey(), channelEnum.getChannel());
+                } else {
+                    okHttpUtils.addPara(p.getKey(), (String) p.getValue());
+                }
+            }
+        }
+        String sync;
+        try {
+            sync = okHttpUtils.get().sync();
+        } catch (Exception e) {
+            log.error("中台服务异常", e.getCause());
+            throw new RuntimeException("支付服务异常!");
+        }
+        log.info("{}返回值->{}", payCenterEnum.getDesc(), sync);
+        return changeRes(sync);
+    }
+
+    private String postHttp(PayCenterEnum payCenterEnum, Map<String, Object> para) {
+        log.info("{}入参->{}", payCenterEnum.getDesc(), JSONObject.toJSONString(para));
+        OkHttpUtils okHttpUtils = OkHttpUtils.builder().url(payCenterAddr + payCenterEnum.getAddr());
+        if (!CollectionUtils.isEmpty(para)) {
+            for (Map.Entry<String, Object> p : para.entrySet()) {
+                //跳过非空参数
+                if (Objects.isNull(p.getValue())) {
+                    continue;
+                }
+                if (p.getValue() instanceof ChannelEnum channelEnum) {
+                    okHttpUtils.addBodyPara(p.getKey(), channelEnum.getChannel());
+                } else {
+                    okHttpUtils.addBodyPara(p.getKey(), (String) p.getValue());
+                }
+            }
+        }
+        String sync;
+        try {
+            sync = okHttpUtils.post(true).sync();
+        } catch (Exception e) {
+            log.error("中台服务异常", e.getCause());
+            throw new RuntimeException("支付服务异常!");
+        }
+        log.info("{}返回值->{}", payCenterEnum.getDesc(), sync);
+        return changeRes(sync);
+    }
+
+    private String changeRes(String sync) {
+        JSONObject jsonObject = JSONObject.parseObject(sync);
+        //我的泛型是对象 返回值有可能 是对象或数组 {} []
+        //data:[]->转换成 data:null 进入if
+        Object data = jsonObject.get("data");
+        if (Objects.nonNull(data) && data instanceof JSONArray d && d.isEmpty()) {
+            jsonObject.put("data", null);
+            sync = jsonObject.toJSONString();
+        }
+        return sync;
+    }
+
     /**
      * 会员详情
      *
@@ -49,23 +123,12 @@ public class PayCenterService {
      * @param channel
      * @return
      */
-    public R<MemberDetail> memberDetail(String uid, ChannelEnum channel) {
-        log.info("{}入参->uid:{} channel:{}", PayCenterEnum.DETAIL.getDesc(), uid, channel);
-        String sync = OkHttpUtils.builder().url(payCenterAddr + PayCenterEnum.DETAIL.getAddr()).addPara("uid", uid).addPara("channel", channel.getChannel()).get().sync();
-        log.info("{}返回值:{}", PayCenterEnum.DETAIL.getDesc(), sync);
-        return JSONObject.parseObject(sync, new TypeReference<R<MemberDetail>>() {
-        });
-    }
-
-    public R<MemberDetail> withdraw(String uid, String view, String orderNo) {
-        log.info("{}入参->uid:{} view:{} orderNo:{}", PayCenterEnum.WITHDRAW.getDesc(), uid, view, orderNo);
-        String sync = OkHttpUtils.builder().url(payCenterAddr + PayCenterEnum.WITHDRAW.getAddr())
-                .addPara("uid", uid)
-                .addPara("view", view)
-                .addPara("orderNo", orderNo)
-                .get().sync();
-        log.info("{}返回值:{}", PayCenterEnum.WITHDRAW.getDesc(), sync);
-        return JSONObject.parseObject(sync, new TypeReference<R<MemberDetail>>() {
+    public R<MemberDetail> memberDetail(String uid, @NotNull(message = "渠道类型不能为空") ChannelEnum channel) {
+        String sync = getHttp(PayCenterEnum.MEMBER_DETAIL, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
         });
     }
 
@@ -78,18 +141,436 @@ public class PayCenterService {
      * @return
      */
     public R<List<WalletDto>> wallet(@NotNull String uid, ChannelEnum channel, String filter) {
-        log.info("钱包清单入参->uid:{} channel:{} filter:{}", uid, channel, filter);
-        OkHttpUtils okHttpUtils = OkHttpUtils.builder().url(payCenterAddr + PayCenterEnum.WALLET.getAddr())
-                .addPara("uid", uid);
-        if (Objects.nonNull(channel)) {
-            okHttpUtils.addPara("channel", channel.getChannel());
-        }
-        if (StringUtils.isNotBlank(filter)) {
-            okHttpUtils.addPara("filter", filter);
-        }
-        String sync = okHttpUtils.get().sync();
-        log.info("钱包清单返回值:{}", sync);
+        String sync = getHttp(PayCenterEnum.MEMBER_WALLET, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+        }});
         return parseArray(sync, WalletDto.class);
     }
 
+    /**
+     * 提现详情
+     *
+     * @param uid
+     * @param view
+     * @param orderNo
+     * @return
+     */
+    public R<CashDetail> withdrawDetail(@NotBlank(message = "提现用户不能为空") String uid, @NotBlank(message = "") String view, @NotBlank(message = "订单编号不能为空") String orderNo) {
+        String sync = getHttp(PayCenterEnum.WITHDRAW_DETAIL, new HashMap<>() {{
+            put("uid", uid);
+            put("view", view);
+            put("order_no", orderNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 提现清单
+     *
+     * @param uid
+     * @param channel
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<CashPage> withdrawIndex(@NotBlank(message = "提现用户不能为空") String uid, @NotNull(message = "支付渠道不能为空") ChannelEnum channel, @NotNull(message = "分页参数不能为空") Integer page, @NotNull(message = "分页大小参数不能为空") Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.WITHDRAW_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 订单状态
+     *
+     * @param type
+     * @return
+     */
+    public R<Map<String, String>> withdrawStatus(String type) {
+        if (StringUtils.isBlank(type)) {
+            type = "order";
+        }
+        String finalType = type;
+        String sync = getHttp(PayCenterEnum.WITHDRAW_STATUS, new HashMap<>() {{
+            put("type", finalType);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 取消提现
+     *
+     * @param uid
+     * @param orderNo
+     * @return
+     */
+    public R<Object> withdrawCancel(@NotBlank(message = "提现用户不能为空") String uid, @NotBlank(message = "体现订单号不能为空") String orderNo) {
+        String sync = postHttp(PayCenterEnum.WITHDRAW_CANCEL, new HashMap<>() {{
+            put("uid", uid);
+            put("order_no", orderNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 申请提现
+     *
+     * @param uid
+     * @param channel
+     * @param money
+     * @param remarks
+     * @return
+     */
+    public R<Order> withdrawTake(@NotBlank(message = "提现用户不能为空") String uid, @NotBlank(message = "渠道不能为空") ChannelEnum channel, @NotBlank(message = "金额(分)不能为空") Long money, @NotBlank(message = "备注不能为空") String remarks) {
+        String sync = postHttp(PayCenterEnum.WITHDRAW_TAKE, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("money", money);
+            put("remarks", remarks);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 统计信息
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @return
+     */
+    public R<WalletInfo> totalInfo(@NotBlank(message = "用户不能为空") String uid, @NotBlank(message = "渠道不能为空") ChannelEnum channel, @NotBlank(message = "乙方用户不能为空") String filter) {
+        String sync = getHttp(PayCenterEnum.TOTAL_INFO, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 操作记录-下载
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @return
+     */
+    public R<OperateDown> operateDownload(String uid, ChannelEnum channel, String filter) {
+        String sync = getHttp(PayCenterEnum.OPERATE_DOWNLOAD, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 操作记录-分类
+     *
+     * @return
+     */
+    public R<Map<String, String>> operateCategory() {
+        String sync = getHttp(PayCenterEnum.OPERATE_CATEGORY, new HashMap<>());
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 操作记录
+     *
+     * @param uid
+     * @param channel
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<Operate> operateIndex(String uid, ChannelEnum channel, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.OPERATE_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 钱包日志类型
+     *
+     * @return
+     */
+    public R<Map<String, String>> logCategory() {
+        String sync = getHttp(PayCenterEnum.LOG_CATEGORY, new HashMap<>());
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 获取钱包使用明细
+     *
+     * @param uid
+     * @param filter
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<RecordPage> record(String uid, String filter, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.RECORD, new HashMap<>() {{
+            put("uid", uid);
+            put("filter", filter);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 余额转出
+     *
+     * @param uid
+     * @param channel
+     * @param money
+     * @param filter
+     * @return
+     */
+    public R<Object> transfer(String uid, ChannelEnum channel, Long money, String filter) {
+        String sync = postHttp(PayCenterEnum.TRANSFER, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("money", money);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 预付订单详情
+     *
+     * @param orderNo
+     * @return
+     */
+    public R<CashDetail> advancePayDetail(String orderNo) {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_DETAIL, new HashMap<>() {{
+            put("order_no", orderNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 发起预付
+     *
+     * @param uid     乙方uid
+     * @param channel 渠道
+     * @param filter  甲方uid
+     * @param money   金额,分
+     * @return
+     */
+    public R<Order> advancePayApply(String uid, ChannelEnum channel, String filter, Long money) {
+        String sync = postHttp(PayCenterEnum.ADVANCE_PAY_APPLY, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("money", money);
+            put("filter", filter);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /***
+     * 预付订单清单
+     * @param uid
+     * @param channel
+     * @param filter
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<PrePayIndexPage> advancePayIndex(String uid, ChannelEnum channel, String filter, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 预付订单状态
+     *
+     * @return
+     */
+    public R<List<String>> advancePayStatus() {
+        String sync = getHttp(PayCenterEnum.ADVANCE_PAY_STATUS, new HashMap<>());
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 获取通道清单
+     *
+     * @return
+     */
+    public R<List<Channel>> index() {
+        String sync = getHttp(PayCenterEnum.INDEX, new HashMap<>());
+        return parseArray(sync, Channel.class);
+    }
+
+    /**
+     * 订单记录
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @param page
+     * @param pageSize
+     * @return
+     */
+    public R<PayRecordPage> memberPayIndex(String uid, ChannelEnum channel, String filter, Integer page, Integer pageSize) {
+        String sync = getHttp(PayCenterEnum.MEMBER_PAY_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+            put("page", page);
+            put("pageSize", pageSize);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 创建/更新账户
+     *
+     * @param memberCreate
+     * @return
+     */
+    public R<MemberRes> memberIndex(MemberCreate memberCreate) {
+        Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(memberCreate), new TypeReference<>() {
+        });
+        String sync = postHttp(PayCenterEnum.MEMBER_INDEX, map);
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 在线充值
+     *
+     * @param buyUid  付款方/乙方/买货方 账户
+     * @param sellUid 收款方/甲方/供货方 账户
+     * @param channel 渠道方
+     * @param money   金额,单位分
+     * @return
+     */
+    public R<PayIndex> payIndex(String buyUid, String sellUid, ChannelEnum channel, Long money) {
+        String sync = postHttp(PayCenterEnum.PAY_INDEX, new HashMap<>() {{
+            put("buyUid", buyUid);
+            put("sellUid", sellUid);
+            put("channel", channel);
+            put("money", money);
+        }});
+
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 冻结资金
+     *
+     * @param uid        付款方uid
+     * @param channel    支付通道
+     * @param money      冻结金额,单位分
+     * @param filter     收款方uid
+     * @param businessNo 流水号
+     * @return
+     */
+    public R<Freeze> walletFreeze(String uid, ChannelEnum channel, String filter, Long money, String businessNo) {
+        String sync = postHttp(PayCenterEnum.WALLET_FREEZE, new HashMap<>() {{
+            put("uid", uid);
+            put("filter", filter);
+            put("channel", channel);
+            put("money", money);
+            put("businessNo", businessNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 解冻金额
+     *
+     * @param businessNo
+     * @return
+     */
+    public R<BusinessNo> walletUnFreeze(String businessNo) {
+        String sync = postHttp(PayCenterEnum.WALLET_UNFREEZE, new HashMap<>() {{
+            put("business_no", businessNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 清分
+     *
+     * @param buyUid
+     * @param sellUid
+     * @param channel
+     * @param money
+     * @param batchPayList
+     * @param businessNo
+     * @return
+     */
+    public R<BusinessNo> payAgentPay(String buyUid, String sellUid, ChannelEnum channel, Long money, List<PatchPay> batchPayList, String businessNo) {
+        String sync = postHttp(PayCenterEnum.PAY_AGENT_PAY, new HashMap<>() {{
+            put("buy_uid", buyUid);
+            put("sell_uid", sellUid);
+            put("channel", channel);
+            put("money", money);
+            put("batch_pay_list", JSONObject.toJSONString(batchPayList));
+            put("business_no", businessNo);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
+    /**
+     * 创建钱包
+     *
+     * @param uid
+     * @param channel
+     * @param filter
+     * @param nickname
+     * @return
+     */
+    public R<Object> walletIndex(@NotBlank(message = "uid不能为空") String uid,
+                                 @NotNull(message = "支付渠道不能为空") ChannelEnum channel,
+                                 @NotBlank(message = "filter不能为空") String filter, String nickname) {
+        String sync = postHttp(PayCenterEnum.WALLET_INDEX, new HashMap<>() {{
+            put("uid", uid);
+            put("channel", channel);
+            put("filter", filter);
+            put("nickname", nickname);
+        }});
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
 }