From 640ccb9229224642515527daf87f308a7aa9bdf4 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 10 Jun 2026 11:47:26 +0800
Subject: [PATCH] 1
---
trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java | 47 ++++++++++++++++++++++++++++-------------------
1 files changed, 28 insertions(+), 19 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..e363294 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("Order already processed, please do not repeat!");
}
Date date = new Date();
withdraw.setReviewTime(date);
@@ -135,11 +137,15 @@
String symbol = "";
if (withdraw.getMethod().indexOf("BTC") != -1) {
- symbol = "btc";
+ symbol = "btcusdt";
} else if (withdraw.getMethod().indexOf("ETH") != -1) {
- symbol = "eth";
- } else {
+ symbol = "ethusdt";
+ } else if (withdraw.getMethod().indexOf("USDC") != -1) {
+ symbol = "usdcusdt";
+ } else if (withdraw.getMethod().indexOf("USDT") != -1) {
symbol = "usdt";
+ } else {
+ return;
}
if ("usdt".equals(symbol)) {
Wallet wallet = walletService.saveWalletByPartyId(withdraw.getUserId());
@@ -152,10 +158,10 @@
CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
.eq(CapitaltWallet::getUserId, wallet.getUserId().toString()).last(" limit 1 "));
if(ObjectUtil.isEmpty(capitaltWallet)){
- throw new YamiShopBindException("用户资金账户不存在!");
+ throw new YamiShopBindException("User fund account does not exist!");
}
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()));
@@ -238,7 +244,7 @@
throw new YamiShopBindException("Please go through the advanced certification process first.");
}
// if (!party.isWithdrawAuthority()) {
-// throw new YamiShopBindException("无权限");
+// throw new YamiShopBindException("Permission denied");
// }
if (party.getStatus() != 1) {
throw new YamiShopBindException("Your account has been frozen");
@@ -436,10 +442,13 @@
} 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())) {
- throw new YamiShopBindException("无权限");
+ throw new YamiShopBindException("Permission denied");
}
Syspara syspara = sysparaService.find("stop_user_internet");
@@ -451,7 +460,7 @@
System.out.println("stopUserInternet = " + stopUserInternet);
if(Arrays.asList(stopUsers).contains(party.getUserName())){
- throw new YamiShopBindException("无网络");
+ throw new YamiShopBindException("No network connection");
}
}
@@ -461,7 +470,7 @@
party_kyc=new RealNameAuthRecord();
}
if (!(party_kyc.getStatus() == 2) && "true".equals(sysparaService.find("withdraw_by_kyc").getSvalue())) {
- throw new YamiShopBindException("未基础认证");
+ throw new YamiShopBindException("Basic verification not completed");
}
if (party_kycHighLevel==null){
party_kycHighLevel=new HighLevelAuthRecord();
@@ -469,10 +478,10 @@
double withdraw_by_high_kyc = Double.valueOf(sysparaService.find("withdraw_by_high_kyc").getSvalue());
if (withdraw_by_high_kyc > 0 && withdraw.getVolume().doubleValue() > withdraw_by_high_kyc
&& !(party_kycHighLevel.getStatus() == 2)) {
- throw new YamiShopBindException(1001,"请先通过高级认证");
+ throw new YamiShopBindException(1001,"Please complete advanced verification first");
}
// if (!party.isWithdrawAuthority()) {
-// throw new YamiShopBindException(1, "无权限");
+// throw new YamiShopBindException(1, "Permission denied");
// }
if (party.getStatus() != 1) {
throw new YamiShopBindException("Your account has been frozen");
@@ -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);
@@ -729,7 +738,7 @@
public void updateAddress(String id, String userName, Long adminuserId, String newAddress) {
Withdraw withdraw = getById(id);
if (withdraw == null) {
- throw new YamiShopBindException("参数错误!");
+ throw new YamiShopBindException("Invalid parameters!");
}
String oldaddres = withdraw.getAddress();
withdraw.setAddress(newAddress);
@@ -760,20 +769,20 @@
BigDecimal amount = withdraw.getAmount();
String symbol = "btc";
if (!UserConstants.SECURITY_ROLE_MEMBER.equals(user.getRoleName())) {
- throw new YamiShopBindException("无权限");
+ throw new YamiShopBindException("Permission denied");
}
RealNameAuthRecord realNameAuthRecord = realNameAuthRecordService.getByUserId(user.getUserId());
if (!(realNameAuthRecord.getStatus() == 2) && "true".equals(sysparaService.find("withdraw_by_kyc").getSvalue())) {
- throw new YamiShopBindException("未安全认证,无提现权限");
+ throw new YamiShopBindException("Security verification not completed, no withdrawal permission");
}
HighLevelAuthRecord highLevelAuthRecord = highLevelAuthRecordService.findByUserId(withdraw.getUserId());
BigDecimal withdrawByHighKyc = new BigDecimal(sysparaService.find("withdraw_by_high_kyc").getSvalue());
if (withdrawByHighKyc.doubleValue() > 0 && amount.doubleValue() > withdrawByHighKyc.doubleValue()
&& !(highLevelAuthRecord.getStatus() == 2)) {
- throw new YamiShopBindException("请先通过高级认证");
+ throw new YamiShopBindException("Please complete advanced verification first");
}
if (!user.isWithdrawAuthority()) {
- throw new YamiShopBindException("无提现权限");
+ throw new YamiShopBindException("No withdrawal permission");
}
if (user.getStatus() == 0) {
throw new YamiShopBindException("Your account has been frozen");
@@ -917,7 +926,7 @@
*/
double weekWithdraw = weekWithdraw(party.getUserId());
if (Arith.add(weekWithdraw, withdrawVolumn) > limit) {
- throw new YamiShopBindException("提现不得大于限额");
+ throw new YamiShopBindException("Withdrawal amount cannot exceed the limit");
}
}
}
--
Gitblit v1.9.3