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

---
 trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 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 7edae99..6a2d045 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
@@ -179,7 +179,7 @@
 
         boolean orderOpen = this.sysparaService.find("order_open").getBoolean();
         if (!orderOpen) {
-            throw new YamiShopBindException("不在交易时段");
+            throw new YamiShopBindException("Outside trading hours");
         }
 
         Item item = this.itemService.findBySymbol(order.getSymbol());
@@ -201,9 +201,17 @@
      */
     public void open(ContractApplyOrder order) {
         Item item = this.itemService.findBySymbol(order.getSymbol());
+        //虚拟币新币
+        if (!itemService.isContractTrading(item)) {
+            throw new YamiShopBindException("Contract trading is not enabled");
+        }
+        /*if (itemService.isSuspended(item.getSymbol())) {
+            throw new YamiShopBindException("Trading suspended");
+        }*/
+
         List<ItemLeverageDTO> levers = itemLeverageService.findByItemId(item.getUuid());
         log.info("{}  --- order --- {}  --- {}", order.getSymbol(), item.getUuid(), levers.size());
-        checkLever(order, levers);
+        //checkLever(order, levers);
 
         order.setOrderNo(DateUtil.getToday("yyMMddHHmmss") + RandomUtil.getRandomNum(8));
 
@@ -233,7 +241,7 @@
         BigDecimal totalAmountCost = order.getDeposit().add(order.getFee());
 
         if (amountBefore.compareTo(totalAmountCost) < 0) {
-            throw new YamiShopBindException("余额不足");
+            throw new YamiShopBindException("not sufficient funds");
         }
 
         //如果是限价单先扣钱
@@ -271,7 +279,7 @@
             volume = volume.subtract(applyOrderSubmittedList.get(i).getVolume());
         }
         if (order.getVolume().compareTo(volume) > 0) {
-            throw new YamiShopBindException("可平仓合约数量不足");
+            throw new YamiShopBindException("Insufficient closable contract quantity");
         }
         save(order);
 
@@ -338,7 +346,7 @@
                 }
             }
             if (!findlevers) {
-                throw new YamiShopBindException("杠杠倍数不存在");
+                throw new YamiShopBindException("Leverage multiplier does not exist");
             }
         }
     }

--
Gitblit v1.9.3