|
90 | 90 | */ |
91 | 91 | public abstract class BaseWxPayServiceImpl implements WxPayService { |
92 | 92 | private static final String PAY_BASE_URL = "https://api.mch.weixin.qq.com"; |
| 93 | + private static final String TOTAL_FUND_COUNT = "资金流水总笔数"; |
| 94 | + private static final String TOTAL_DEAL_COUNT = "总交易单数"; |
| 95 | + |
93 | 96 | /** |
94 | 97 | * The Log. |
95 | 98 | */ |
96 | | - protected final Logger log = LoggerFactory.getLogger(this.getClass()); |
| 99 | + final Logger log = LoggerFactory.getLogger(this.getClass()); |
97 | 100 | /** |
98 | 101 | * The constant wxApiData. |
99 | 102 | */ |
100 | | - protected static ThreadLocal<WxPayApiData> wxApiData = new ThreadLocal<>(); |
| 103 | + static ThreadLocal<WxPayApiData> wxApiData = new ThreadLocal<>(); |
101 | 104 |
|
102 | 105 | private EntPayService entPayService = new EntPayServiceImpl(this); |
103 | 106 |
|
@@ -523,6 +526,10 @@ public WxPayBillResult downloadBill(WxPayDownloadBillRequest request) throws WxP |
523 | 526 | } |
524 | 527 | } |
525 | 528 |
|
| 529 | + if (StringUtils.isEmpty(responseContent)) { |
| 530 | + return null; |
| 531 | + } |
| 532 | + |
526 | 533 | return this.handleBill(request.getBillType(), responseContent); |
527 | 534 | } |
528 | 535 |
|
@@ -563,9 +570,9 @@ private WxPayBillResult handleAllBill(String responseContent) { |
563 | 570 |
|
564 | 571 | String listStr = ""; |
565 | 572 | String objStr = ""; |
566 | | - if (responseContent.contains("总交易单数")) { |
567 | | - listStr = responseContent.substring(0, responseContent.indexOf("总交易单数")); |
568 | | - objStr = responseContent.substring(responseContent.indexOf("总交易单数")); |
| 573 | + if (responseContent.contains(TOTAL_DEAL_COUNT)) { |
| 574 | + listStr = responseContent.substring(0, responseContent.indexOf(TOTAL_DEAL_COUNT)); |
| 575 | + objStr = responseContent.substring(responseContent.indexOf(TOTAL_DEAL_COUNT)); |
569 | 576 | } |
570 | 577 |
|
571 | 578 | /* |
@@ -695,9 +702,9 @@ private WxPayFundFlowResult handleFundFlow(String responseContent) { |
695 | 702 | String listStr = ""; |
696 | 703 | String objStr = ""; |
697 | 704 |
|
698 | | - if (StringUtils.isNotBlank(responseContent) && responseContent.contains("资金流水总笔数")) { |
699 | | - listStr = responseContent.substring(0, responseContent.indexOf("资金流水总笔数")); |
700 | | - objStr = responseContent.substring(responseContent.indexOf("资金流水总笔数")); |
| 705 | + if (StringUtils.isNotBlank(responseContent) && responseContent.contains(TOTAL_FUND_COUNT)) { |
| 706 | + listStr = responseContent.substring(0, responseContent.indexOf(TOTAL_FUND_COUNT)); |
| 707 | + objStr = responseContent.substring(responseContent.indexOf(TOTAL_FUND_COUNT)); |
701 | 708 | } |
702 | 709 | /* |
703 | 710 | * 记账时间:2018-02-01 04:21:23 微信支付业务单号:50000305742018020103387128253 资金流水单号:1900009231201802015884652186 业务名称:退款 |
|
0 commit comments