瀏覽代碼

优化对账方法

master
Binary Wang 6 年之前
父節點
當前提交
897394e05e
共有 1 個檔案被更改,包括 15 行新增8 行删除
  1. +15
    -8
      weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java

+ 15
- 8
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java 查看文件

@@ -90,14 +90,17 @@ import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType;
*/
public abstract class BaseWxPayServiceImpl implements WxPayService {
private static final String PAY_BASE_URL = "https://api.mch.weixin.qq.com";
private static final String TOTAL_FUND_COUNT = "资金流水总笔数";
private static final String TOTAL_DEAL_COUNT = "总交易单数";

/**
* The Log.
*/
protected final Logger log = LoggerFactory.getLogger(this.getClass());
final Logger log = LoggerFactory.getLogger(this.getClass());
/**
* The constant wxApiData.
*/
protected static ThreadLocal<WxPayApiData> wxApiData = new ThreadLocal<>();
static ThreadLocal<WxPayApiData> wxApiData = new ThreadLocal<>();

private EntPayService entPayService = new EntPayServiceImpl(this);

@@ -523,6 +526,10 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
}
}

if (StringUtils.isEmpty(responseContent)) {
return null;
}

return this.handleBill(request.getBillType(), responseContent);
}

@@ -563,9 +570,9 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {

String listStr = "";
String objStr = "";
if (responseContent.contains("总交易单数")) {
listStr = responseContent.substring(0, responseContent.indexOf("总交易单数"));
objStr = responseContent.substring(responseContent.indexOf("总交易单数"));
if (responseContent.contains(TOTAL_DEAL_COUNT)) {
listStr = responseContent.substring(0, responseContent.indexOf(TOTAL_DEAL_COUNT));
objStr = responseContent.substring(responseContent.indexOf(TOTAL_DEAL_COUNT));
}

/*
@@ -695,9 +702,9 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
String listStr = "";
String objStr = "";

if (StringUtils.isNotBlank(responseContent) && responseContent.contains("资金流水总笔数")) {
listStr = responseContent.substring(0, responseContent.indexOf("资金流水总笔数"));
objStr = responseContent.substring(responseContent.indexOf("资金流水总笔数"));
if (StringUtils.isNotBlank(responseContent) && responseContent.contains(TOTAL_FUND_COUNT)) {
listStr = responseContent.substring(0, responseContent.indexOf(TOTAL_FUND_COUNT));
objStr = responseContent.substring(responseContent.indexOf(TOTAL_FUND_COUNT));
}
/*
* 记账时间:2018-02-01 04:21:23 微信支付业务单号:50000305742018020103387128253 资金流水单号:1900009231201802015884652186 业务名称:退款


Loading…
取消
儲存