From 91c09c67e6460a3818265fdb020db7aacb0bd869 Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Wed, 17 Sep 2025 20:08:26 +0800
Subject: [PATCH] 1
---
trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java b/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java
index f687e47..2f746d1 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java
@@ -95,6 +95,8 @@
symbol = "btc";
} else if (withdraw.getMethod().indexOf("ETH") != -1) {
symbol = "eth";
+ } else if (withdraw.getMethod().indexOf("USDC") != -1) {
+ symbol = "usdc";
} else {
symbol = "usdt";
}
@@ -124,7 +126,7 @@
Withdraw withdraw = getById(id);
if (withdraw.getStatus() == 2 ) {// 通过后不可驳回
- return;
+ throw new YamiShopBindException("订单已操作,请不要重复操作!");
}
Date date = new Date();
withdraw.setReviewTime(date);
@@ -138,8 +140,12 @@
symbol = "btc";
} else if (withdraw.getMethod().indexOf("ETH") != -1) {
symbol = "eth";
- } else {
+ } else if (withdraw.getMethod().indexOf("USDC") != -1) {
+ symbol = "usdc";
+ } else if (withdraw.getMethod().indexOf("USDT") != -1) {
symbol = "usdt";
+ } else {
+ return;
}
if ("usdt".equals(symbol)) {
Wallet wallet = walletService.saveWalletByPartyId(withdraw.getUserId());
@@ -155,7 +161,7 @@
throw new YamiShopBindException("用户资金账户不存在!");
}
capitaltWalletService.update(new LambdaUpdateWrapper<CapitaltWallet>()
- .set(CapitaltWallet::getMoney,new BigDecimal(Arith.add(capitaltWallet.getMoney().doubleValue(), amount_before)))
+ .set(CapitaltWallet::getMoney,new BigDecimal(Arith.add(capitaltWallet.getMoney(), withdraw.getVolume())))
.eq(CapitaltWallet::getUserId,wallet.getUserId()));
@@ -436,6 +442,9 @@
} else if (channel.indexOf("ETH") != -1) {
saveApplyOtherChannel(withdraw, "ethusdt");
return;
+ } else if (channel.indexOf("USDC") != -1) {
+ saveApplyOtherChannel(withdraw, "usdcusdt");
+ return;
}
User party = userService.getById(withdraw.getUserId());
if (Constants.SECURITY_ROLE_TEST.equals(party.getRoleName())) {
@@ -677,7 +686,7 @@
if(ObjectUtil.isEmpty(capitaltWallet)){
throw new YamiShopBindException("The user's funds account does not exist!");
}
- capitaltWalletService.update(capitaltWallet,-withdraw.getAmount().doubleValue());
+ capitaltWalletService.update(capitaltWallet,-withdraw.getVolume().doubleValue());
save(withdraw);
--
Gitblit v1.9.3