From 7ff2bf07924915fc12612c9fd8cae5915dca2560 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Tue, 14 Oct 2025 17:28:40 +0800
Subject: [PATCH] 1

---
 trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiExchangeApplyOrderController.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiExchangeApplyOrderController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiExchangeApplyOrderController.java
index bd8f0ac..77e7327 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiExchangeApplyOrderController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiExchangeApplyOrderController.java
@@ -109,12 +109,14 @@
         Map<String, Object> parities = parities(symbol, symbol_to, volume_temp);
         Object getVolume = parities.get("get_volume");
         if(symbol.equals("usdt")){
-            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
+            Wallet userIdWallet = walletService.getOne(new LambdaQueryWrapper<>(Wallet.class)
+                    .eq(Wallet::getUserId, partyId).last(" limit 1 "));
+//            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
             if(userIdWallet.getMoney().compareTo(new BigDecimal(volume_temp)) < 0){
                 throw new YamiShopBindException("not sufficient funds");
             }
             Double value = Double.valueOf(volume_temp);
-            capitaltWalletService.update(userIdWallet,  -value);
+            walletService.update(userIdWallet.getUserId(),  -value);
 
             WalletExtend walletExtend = walletExtendService.getOne(new LambdaQueryWrapper<>(WalletExtend.class)
                     .eq(WalletExtend::getWallettype, symbol_to)
@@ -146,9 +148,12 @@
             walletExtend.setAmount(walletExtend.getAmount() - valueOf);
             walletExtendService.update(walletExtend,new LambdaUpdateWrapper<WalletExtend>().eq(UUIDEntity::getUuid,walletExtend.getUuid()));
 
-
-            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
-            capitaltWalletService.update(userIdWallet,Double.valueOf(getVolume.toString()));
+//
+//            CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
+//            capitaltWalletService.update(userIdWallet,Double.valueOf(getVolume.toString()));
+            Wallet userIdWallet = walletService.getOne(new LambdaQueryWrapper<>(Wallet.class)
+                    .eq(Wallet::getUserId, partyId).last(" limit 1 "));
+            walletService.update(partyId,Double.valueOf(getVolume.toString()));
         }else{
             WalletExtend walletExtend = walletExtendService.getOne(new LambdaQueryWrapper<>(WalletExtend.class)
                     .eq(WalletExtend::getWallettype, symbol)
@@ -374,8 +379,8 @@
     public Result openview() {
         Map<String, Object> data = new HashMap<String, Object>();
         String partyId = SecurityUtils.getUser().getUserId();
-//        Wallet wallet = walletService.saveWalletByPartyId(partyId);
-        CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
+        Wallet userIdWallet = walletService.saveWalletByPartyId(partyId);
+//        CapitaltWallet userIdWallet = capitaltWalletService.getUserIdWallet(partyId);
         // 账户剩余资金
         DecimalFormat df = new DecimalFormat("#.##");
         df.setRoundingMode(RoundingMode.FLOOR);// 向下取整

--
Gitblit v1.9.3