Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
usedCarAuction
/
aus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 218abbba
authored
Dec 31, 2025
by
gonglei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改保证金支付流程
1 parent
0b7a825e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
aus-admin/src/main/java/com/glsx/usedcar/web/rest/finance/DepositController.java
aus-api/src/main/java/com/glsx/usedcar/web/api/finance/DepositController.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/finance/DepositController.java
View file @
218abbb
package
com
.
glsx
.
usedcar
.
web
.
rest
.
finance
;
import
com.github.binarywang.wxpay.bean.request.WxPayRefundV3Request
;
import
com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderV3Request
;
import
com.github.binarywang.wxpay.bean.result.WxPayRefundV3Result
;
import
com.github.binarywang.wxpay.exception.WxPayException
;
import
com.github.binarywang.wxpay.service.WxPayService
;
import
com.glsx.usedcar.export.DepositBean
;
import
com.glsx.usedcar.export.ExcelExporter
;
import
com.glsx.usedcar.export.WithdrawBean
;
...
...
@@ -18,6 +23,7 @@ import jakarta.persistence.criteria.JoinType;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.*
;
import
org.summerframework.orm.paging.Pagination
;
...
...
@@ -44,6 +50,12 @@ public class DepositController {
@Resource
private
WithdrawService
withdrawService
;
@Resource
private
WxPayService
wxService
;
@Value
(
"${wx.pay.notifyUrl}"
)
private
String
notifyUrl
;
/**
* 分页查询保证金规则
*
...
...
@@ -175,4 +187,28 @@ public class DepositController {
return
depositService
.
getFreezeAmountByAccount
(
accountId
);
}
/**
* <pre>
* 微信支付-申请退款
* 详见 https://pay.weixin.qq.com/doc/v3/merchant/4012791862
* </pre>
*
* @param request 请求对象
* @return 退款操作结果
*/
@PostMapping
(
"refund"
)
public
WxPayRefundV3Result
refund
(
@RequestBody
int
depositId
)
throws
WxPayException
{
Deposit
deposit
=
depositService
.
getDepositDetailById
(
depositId
);
WxPayRefundV3Request
request
=
new
WxPayRefundV3Request
();
WxPayRefundV3Request
.
Amount
amount
=
new
WxPayRefundV3Request
.
Amount
();
amount
.
setCurrency
(
"CNY"
);
amount
.
setTotal
((
int
)
(
deposit
.
getTransaction
().
getAmount
()
*
100
));
amount
.
setRefund
((
int
)
(
deposit
.
getAmount
()
*
100
));
request
.
setAmount
(
amount
);
request
.
setOutTradeNo
(
deposit
.
getOutTradeNo
());
request
.
setTransactionId
(
deposit
.
getTransactionId
());
request
.
setNotifyUrl
(
notifyUrl
);
return
this
.
wxService
.
refundV3
(
request
);
}
}
\ No newline at end of file
aus-api/src/main/java/com/glsx/usedcar/web/api/finance/DepositController.java
View file @
218abbb
...
...
@@ -57,4 +57,6 @@ public class DepositController {
WxPayUnifiedOrderV3Result
.
JsapiResult
result
=
wxService
.
createOrderV3
(
TradeTypeEnum
.
JSAPI
,
request
);
return
result
;
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment