From befbf57e4112d07003bff18102f556a1e5a154de Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 22 Apr 2026 10:53:37 +0800
Subject: [PATCH] 1

---
 trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java |   54 ++++++++++++++++--------------------------------------
 1 files changed, 16 insertions(+), 38 deletions(-)

diff --git a/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java b/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java
index 08eba0c..086bcef 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java
@@ -14,7 +14,6 @@
 import com.yami.trading.bean.data.domain.Realtime;
 import com.yami.trading.bean.item.domain.Item;
 import com.yami.trading.bean.item.dto.ItemLeverageDTO;
-import com.yami.trading.bean.model.FollowWallet;
 import com.yami.trading.bean.model.User;
 import com.yami.trading.bean.model.Wallet;
 import com.yami.trading.bean.syspara.domain.Syspara;
@@ -26,7 +25,6 @@
 import com.yami.trading.common.util.RandomUtil;
 import com.yami.trading.common.util.StringUtils;
 import com.yami.trading.dao.contract.ContractApplyOrderMapper;
-import com.yami.trading.service.FollowWalletService;
 import com.yami.trading.service.MoneyLogService;
 import com.yami.trading.service.RechargeBonusService;
 import com.yami.trading.service.WalletService;
@@ -81,8 +79,6 @@
     private MoneyLogService moneyLogService;
     @Autowired
     private WalletService walletService;
-    @Autowired
-    private FollowWalletService followWalletService;
     @Autowired
     private ContractOrderService contractOrderService;
     @Autowired
@@ -303,43 +299,25 @@
 
         order.setVolumeOpen(order.getVolume());
 
-        if(ContractApplyOrder.ORDER_FOLLOW == order.getFollow()) { // 跟单订单
-            FollowWallet followWallet = followWalletService.findByUserId(order.getPartyId());
-            BigDecimal amountBefore = followWallet.getMoney();
+        Wallet wallet = this.walletService.findByUserId(order.getPartyId());
+        BigDecimal amountBefore = wallet.getMoney();
 //            fee = exchangeRateService.getUsdtByType(order.getFee(), type);
 //            deposit = exchangeRateService.getUsdtByType(deposit, type);
-            BigDecimal totalAmountCost = deposit.add(order.getFee());
-            if (amountBefore.compareTo(totalAmountCost) < 0) {
-                throw new YamiShopBindException("余额不足");
-            }
-
-            followWalletService.updateMoney(order.getSymbol(), order.getPartyId(), BigDecimal.ZERO.subtract(deposit), BigDecimal.ZERO
-                    , Constants.MONEYLOG_CATEGORY_CONTRACT, Constants.WALLET_USDT, Constants.MONEYLOG_CONTENT_CONTRACT_OPEN, "委托单,订单号[" + order.getOrderNo() + "]"
-            );
-            followWalletService.updateMoney(order.getSymbol(), order.getPartyId(), BigDecimal.ZERO.subtract(fee), BigDecimal.ZERO
-                    , Constants.MONEYLOG_CATEGORY_CONTRACT, Constants.WALLET_USDT, Constants.MONEYLOG_CONTENT_FEE, "委托单手续费,订单号[" + order.getOrderNo() + "]"
-            );
-        } else {
-            Wallet wallet = this.walletService.findByUserId(order.getPartyId());
-            BigDecimal amountBefore = wallet.getMoney();
-//            fee = exchangeRateService.getUsdtByType(order.getFee(), type);
-//            deposit = exchangeRateService.getUsdtByType(deposit, type);
-            BigDecimal totalAmountCost = deposit.add(order.getFee());
-            if (amountBefore.compareTo(totalAmountCost) < 0) {
-                throw new YamiShopBindException("余额不足");
-            }
-
-            walletService.updateMoney(order.getSymbol(), order.getPartyId(), BigDecimal.ZERO.subtract(deposit), BigDecimal.ZERO
-                    , Constants.MONEYLOG_CATEGORY_CONTRACT, Constants.WALLET_USDT, Constants.MONEYLOG_CONTENT_CONTRACT_OPEN, "委托单,订单号[" + order.getOrderNo() + "]"
-            );
-            walletService.updateMoney(order.getSymbol(), order.getPartyId(), BigDecimal.ZERO.subtract(fee), BigDecimal.ZERO
-                    , Constants.MONEYLOG_CATEGORY_CONTRACT, Constants.WALLET_USDT, Constants.MONEYLOG_CONTENT_FEE, "委托单手续费,订单号[" + order.getOrderNo() + "]"
-            );
-
-
-            //ICE盘定制交易手续费返佣
-           rechargeBonusService.saveTradeBounsHandle(order.getPartyId(),1, fee.doubleValue(),order.getOrderNo(),order.getSymbol());
+        BigDecimal totalAmountCost = deposit.add(order.getFee());
+        if (amountBefore.compareTo(totalAmountCost) < 0) {
+            throw new YamiShopBindException("余额不足");
         }
+
+        walletService.updateMoney(order.getSymbol(), order.getPartyId(), BigDecimal.ZERO.subtract(deposit), BigDecimal.ZERO
+                , Constants.MONEYLOG_CATEGORY_CONTRACT, Constants.WALLET_USDT, Constants.MONEYLOG_CONTENT_CONTRACT_OPEN, "委托单,订单号[" + order.getOrderNo() + "]"
+        );
+        walletService.updateMoney(order.getSymbol(), order.getPartyId(), BigDecimal.ZERO.subtract(fee), BigDecimal.ZERO
+                , Constants.MONEYLOG_CATEGORY_CONTRACT, Constants.WALLET_USDT, Constants.MONEYLOG_CONTENT_FEE, "委托单手续费,订单号[" + order.getOrderNo() + "]"
+        );
+
+
+        //ICE盘定制交易手续费返佣
+       rechargeBonusService.saveTradeBounsHandle(order.getPartyId(),1, fee.doubleValue(),order.getOrderNo(),order.getSymbol());
         save(order);
         User party = this.userService.getById(order.getPartyId());
         if (Constants.SECURITY_ROLE_MEMBER.equals(party.getRoleName())) {

--
Gitblit v1.9.3