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/CapitaltWalletServiceImpl.java | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/trading-order-service/src/main/java/com/yami/trading/service/impl/CapitaltWalletServiceImpl.java b/trading-order-service/src/main/java/com/yami/trading/service/impl/CapitaltWalletServiceImpl.java
index 46c11a7..513522b 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/impl/CapitaltWalletServiceImpl.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/impl/CapitaltWalletServiceImpl.java
@@ -68,13 +68,14 @@
if (capitaltWallet != null && capitaltWallet.getMoney().compareTo(moneyRevise) >= 0) {
// 执行从资金账户到合约账户的划转操作
capitaltWallet.setMoney(capitaltWallet.getMoney().subtract(moneyRevise)); // 减少资金账户余额
- wallet.setMoney(wallet.getMoney().add(moneyRevise)); // 增加合约账户余额
+ //wallet.setMoney(wallet.getMoney().add(moneyRevise)); // 增加合约账户余额
// 更新账户余额
- walletService.updateById(wallet); // 保存合约账户的更新
+ //walletService.updateById(wallet); // 保存合约账户的更新
+ walletService.updateToBeCovered(wallet, moneyRevise, 1);
updateById(capitaltWallet); // 保存资金账户的更新
return Result.succeed();
} else {
- throw new YamiShopBindException("资金账户余额不足");
+ throw new YamiShopBindException("Insufficient balance in the fund account");
}
} else if (deductAccount.equals("contract") && receiveAccount.equals("capital")) {
@@ -84,7 +85,7 @@
wrapper.eq(ContractOrder::getState,"submitted");
List<ContractOrder> list = contractOrderService.list(wrapper);
if(CollectionUtil.isNotEmpty(list)){
- throw new YamiShopBindException("当前持有全仓仓位,不支持划转!");
+ throw new YamiShopBindException("Currently holding the full position. Transfer is not supported!");
}
// 从合约账户(contract)到资金账户(capital)的划转
@@ -97,11 +98,11 @@
updateById(capitaltWallet); // 保存资金账户的更新
return Result.succeed();
} else {
- throw new YamiShopBindException("合约账户余额不足");
+ throw new YamiShopBindException("Insufficient balance in the contract account");
}
} else {
// 如果划转账户和接收账户不符合预期,返回错误信息
- throw new YamiShopBindException("不支持的账户划转类型");
+ throw new YamiShopBindException("Unsupported account transfer types");
}
}
--
Gitblit v1.9.3