From 04a5917fac6893defe6ed5c6e8a9a813db4c6421 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 17 Sep 2025 18:33:40 +0800
Subject: [PATCH] 1
---
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java | 41 ++++++++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
index 384d8ca..83b45ba 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yami.trading.bean.model.CapitaltWallet;
+import com.yami.trading.bean.model.User;
import com.yami.trading.bean.model.Withdraw;
import com.yami.trading.common.constants.Constants;
import com.yami.trading.common.domain.Result;
@@ -82,6 +83,10 @@
if (!StringUtils.isNullOrEmpty(error)) {
throw new YamiShopBindException(error);
}
+ User user = userService.getById(partyId);
+ if(user.isEnabled() == false || user.isWithdrawAuthority() == false){
+ throw new YamiShopBindException("Account is abnormal and has been restricted from making withdrawals.");
+ }
double amount_double = Double.valueOf(amount).doubleValue();
// 交易所提现是否需要资金密码
@@ -90,25 +95,27 @@
throw new YamiShopBindException("系统参数错误");
}
- if ("true".equals(exchange_withdraw_need_safeword)) {
-
- if (StringUtils.isEmptyString(safeword)) {
- throw new YamiShopBindException("资金密码不能为空");
- }
-
- if (safeword.length() < 6 || safeword.length() > 12) {
- throw new YamiShopBindException("资金密码必须6-12位");
- }
- if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
- throw new YamiShopBindException("资金密码错误");
- }
- }
+// if ("true".equals(exchange_withdraw_need_safeword)) {
+//
+// if (StringUtils.isEmptyString(safeword)) {
+// throw new YamiShopBindException("资金密码不能为空");
+// }
+//
+// if (safeword.length() < 6 || safeword.length() > 12) {
+// throw new YamiShopBindException("资金密码必须6-12位");
+// }
+// if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
+// throw new YamiShopBindException("资金密码错误");
+// }
+// }
// 获取资金账户(capital)
- CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
- .eq(CapitaltWallet::getUserId, partyId).last(" limit 1 "));
- if(capitaltWallet.getMoney().compareTo(new BigDecimal(amount)) < 0){
- throw new YamiShopBindException("可提现余额不足!");
+ if(channel.contains("USDT")){
+ CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
+ .eq(CapitaltWallet::getUserId, partyId).last(" limit 1 "));
+ if(capitaltWallet.getMoney().compareTo(new BigDecimal(amount)) < 0){
+ throw new YamiShopBindException("Insufficient available balance for withdrawal!");
+ }
}
this.sessionTokenService.del(session_token);
--
Gitblit v1.9.3