From 92310aaa56ae040c9147f6495630f2c1ae41fac2 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Fri, 26 Apr 2024 10:21:05 +0800
Subject: [PATCH] 1
---
src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java b/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
index c707f79..5ddcdfc 100644
--- a/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/UserWithdrawServiceImpl.java
@@ -88,6 +88,8 @@
@Autowired
IStockConfigServices iStockConfigServices;
+ @Autowired
+ UserAssetsMapper userAssetsMapper;
@Transactional
public ServerResponse outMoney(String amt, String with_Pwd,String accsetType,HttpServletRequest request) throws Exception {
@@ -327,7 +329,12 @@
if (user == null) {
return ServerResponse.createByErrorMsg("用户不存在");
}
- int updateCount = this.userMapper.updateById(user);
+ UserAssets userAssets = iUserAssetsServices.assetsByTypeAndUserId("IN", user.getId());
+ if (userAssets == null) {
+ return ServerResponse.createByErrorMsg("用户资金账户不存在");
+ }
+ userAssets.setAvailableBalance(userAssets.getAvailableBalance().add(userWithdraw.getWithAmt()));
+ int updateCount = userAssetsMapper.updateById(userAssets);
if (updateCount > 0) {
log.info("提现失败,返还用户资金成功!");
} else {
--
Gitblit v1.9.3