From 37eef4cdb6b8f4b8947743c90331b055fb212f49 Mon Sep 17 00:00:00 2001 From: hixian <316840383@qq.com> Date: Mon, 30 Oct 2023 17:30:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=89=E6=97=A5=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=8F=90=E7=8E=B0=E5=BC=82=E5=B8=B8=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=93=8D=E5=BA=94=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../github/binarywang/wxpay/service/PayrollService.java | 3 ++- .../binarywang/wxpay/service/impl/PayrollServiceImpl.java | 8 ++++++-- .../wxpay/service/impl/PayrollServiceImplTest.java | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayrollService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayrollService.java index 3cd2fe921b..b3f788815c 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayrollService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayrollService.java @@ -1,6 +1,7 @@ package com.github.binarywang.wxpay.service; import com.github.binarywang.wxpay.bean.marketing.payroll.*; +import com.github.binarywang.wxpay.bean.result.WxPayApplyBillV3Result; import com.github.binarywang.wxpay.exception.WxPayException; /** @@ -98,6 +99,6 @@ public interface PayrollService { * @return 返回数据 * @throws WxPayException the wx pay exception */ - PreOrderWithAuthResult merchantFundWithdrawBillType(String billType, String billDate) throws WxPayException; + WxPayApplyBillV3Result merchantFundWithdrawBillType(String billType, String billDate, String tarType) throws WxPayException; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImpl.java index 5708e8579d..3d8c831271 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImpl.java @@ -1,6 +1,7 @@ package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.marketing.payroll.*; +import com.github.binarywang.wxpay.bean.result.WxPayApplyBillV3Result; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.PayrollService; import com.github.binarywang.wxpay.service.WxPayService; @@ -182,11 +183,14 @@ public PreOrderWithAuthResult payrollCardPreOrderWithAuth(PreOrderWithAuthReques * @throws WxPayException the wx pay exception */ @Override - public PreOrderWithAuthResult merchantFundWithdrawBillType(String billType, String billDate) throws WxPayException { + public WxPayApplyBillV3Result merchantFundWithdrawBillType(String billType, String billDate, String tarType) throws WxPayException { String url = String.format("%s/v3/merchant/fund/withdraw/bill-type/%s", payService.getPayBaseUrl(), billType); String query = String.format("?bill_date=%s", billDate); + if (StringUtils.isNotBlank(tarType)) { + query += String.format("&tar_type=%s", tarType); + } String response = payService.getV3(url + query); - return GSON.fromJson(response, PreOrderWithAuthResult.class); + return GSON.fromJson(response, WxPayApplyBillV3Result.class); } } diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImplTest.java index 2254bc6128..03bbc8c593 100644 --- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImplTest.java +++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImplTest.java @@ -3,6 +3,7 @@ import com.github.binarywang.wxpay.bean.marketing.payroll.*; import com.github.binarywang.wxpay.bean.marketing.transfer.PartnerTransferRequest; import com.github.binarywang.wxpay.bean.marketing.transfer.PartnerTransferResult; +import com.github.binarywang.wxpay.bean.result.WxPayApplyBillV3Result; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.testbase.ApiTestModule; @@ -120,9 +121,8 @@ public void payrollCardPreOrderWithAuth() throws WxPayException { public void merchantFundWithdrawBillType() throws WxPayException { String billType = "NO_SUCC"; String billDate = "2019-08-17"; - PreOrderWithAuthResult preOrderWithAuthResult = wxPayService.getPayrollService().merchantFundWithdrawBillType(billType, billDate); - log.info(preOrderWithAuthResult.toString()); - + WxPayApplyBillV3Result result = wxPayService.getPayrollService().merchantFundWithdrawBillType(billType, billDate, null); + log.info(result.toString()); } }