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 c5e91ee0
authored
Jan 06, 2026
by
gonglei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
加入框架代码
1 parent
0ada508c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
aus-admin/src/main/java/com/glsx/usedcar/web/rest/finance/RechargeController.java
aus-core/src/main/java/com/glsx/usedcar/module/finance/service/TransactionService.java
aus-admin/src/main/java/com/glsx/usedcar/web/rest/finance/RechargeController.java
View file @
c5e91ee
...
...
@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.data.domain.Page
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.web.bind.annotation.*
;
import
org.summerframework.core.exception.FieldException
;
import
org.summerframework.orm.paging.Pagination
;
import
java.util.List
;
...
...
@@ -57,7 +58,7 @@ public class RechargeController {
* @return
*/
@PostMapping
(
"auditRecharge"
)
public
Recharge
auditRecharge
(
@Valid
@RequestBody
ApproveHistory
approveHistory
,
Authentication
authentication
)
throws
WxPayException
{
public
Recharge
auditRecharge
(
@Valid
@RequestBody
ApproveHistory
approveHistory
,
Authentication
authentication
)
throws
WxPayException
,
FieldException
{
approveHistory
.
setUser
((
User
)
authentication
.
getPrincipal
());
return
transactionService
.
auditRecharge
(
approveHistory
);
}
...
...
aus-core/src/main/java/com/glsx/usedcar/module/finance/service/TransactionService.java
View file @
c5e91ee
...
...
@@ -245,10 +245,13 @@ public class TransactionService extends AbstractAuctionService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
public
Recharge
refundRecharge
(
long
rechargeId
)
throws
FieldException
{
Recharge
recharge
=
rechargeDao
.
findById
(
rechargeId
).
orElseThrow
();
Recharge
recharge
=
rechargeDao
.
findBy
Recharge
Id
(
rechargeId
).
orElseThrow
();
if
(
recharge
.
getRefundState
()
!=
Deposit
.
RefundState
.
UNREFUND
)
{
throw
new
FieldException
(
"refundState"
,
recharge
,
"订单已退款,不能再次退款"
);
}
if
(
recharge
.
getAccount
().
getSurplus
()
<
recharge
.
getAmount
())
{
throw
new
FieldException
(
"amount"
,
recharge
,
"账户余额不足,无法退款"
);
}
recharge
.
setAuditState
(
AuditState
.
UNAUDITED
);
return
recharge
;
}
...
...
@@ -397,12 +400,15 @@ public class TransactionService extends AbstractAuctionService {
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
public
Recharge
auditRecharge
(
ApproveHistory
approveHistory
)
throws
WxPayException
{
public
Recharge
auditRecharge
(
ApproveHistory
approveHistory
)
throws
WxPayException
,
FieldException
{
Recharge
recharge
=
rechargeDao
.
findById
((
long
)
approveHistory
.
getApproveId
()).
orElseThrow
(()
->
new
ObjectNotFoundException
(
approveHistory
.
getApproveId
(),
Withdraw
.
class
.
getSimpleName
()));
if
(
approveHistory
.
getApproveResult
()
==
AuditState
.
AUDITED
&&
recharge
.
getAuditState
()
!=
AuditState
.
AUDITED
)
{
if
(!
StringUtils
.
hasText
(
recharge
.
getOutTradeNo
()))
{
throw
new
WxPayException
(
"退款订单号为空,此订单未支付,不能进行退款操作"
);
}
if
(
recharge
.
getAccount
().
getSurplus
()
<
recharge
.
getAmount
())
{
throw
new
FieldException
(
"amount"
,
recharge
,
"账户余额不足,无法退款"
);
}
WxPayRefundV3Request
request
=
new
WxPayRefundV3Request
();
WxPayRefundV3Request
.
Amount
amount
=
new
WxPayRefundV3Request
.
Amount
();
...
...
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