From 19c6775bc913c5224cb1fbca3a4d05773c4eca8d Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Wed, 10 Dec 2025 20:51:26 +0800
Subject: [PATCH] fix(okxWs): 优化订单状态检查逻辑

---
 src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
index 96a483f..9976ba4 100644
--- a/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
+++ b/src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
@@ -7,6 +7,7 @@
 import com.xcong.excoin.modules.okxNewPrice.celue.CaoZuoService;
 import com.xcong.excoin.modules.okxNewPrice.okxWs.*;
 import com.xcong.excoin.modules.okxNewPrice.okxWs.enums.CoinEnums;
+import com.xcong.excoin.modules.okxNewPrice.okxWs.enums.ExchangeInfoEnum;
 import com.xcong.excoin.modules.okxNewPrice.okxWs.enums.OrderParamEnums;
 import com.xcong.excoin.modules.okxNewPrice.utils.SSLConfig;
 import com.xcong.excoin.modules.okxNewPrice.wangge.WangGeService;
@@ -50,7 +51,6 @@
 
     private static final String WS_URL_MONIPAN = "wss://wspap.okx.com:8443/ws/v5/private";
     private static final String WS_URL_SHIPAN = "wss://ws.okx.com:8443/ws/v5/private";
-    private static final boolean INTERNET = false;
 
     /**
      * 订阅频道指令
@@ -123,7 +123,7 @@
             SSLConfig.configureSSL();
             System.setProperty("https.protocols", "TLSv1.2,TLSv1.3");
             String WS_URL = WS_URL_MONIPAN;
-            if (INTERNET){
+            if (ExchangeInfoEnum.OKX_UAT.isAccountType()){
                 WS_URL = WS_URL_SHIPAN;
             }
             URI uri = new URI(WS_URL);
@@ -266,10 +266,10 @@
             OrderInfoWs.handleEvent(response, redisUtils);
         }else if (AccountWs.ACCOUNTWS_CHANNEL.equals(channel)) {
             AccountWs.handleEvent(response, redisUtils);
-        } else if (PositionsWs.POSITIONSWS_CHANNEL.equals(channel)) {
-            PositionsWs.handleEvent(response, redisUtils);
             String side = caoZuoService.caoZuo();
             TradeOrderWs.orderEvent(webSocketClient, redisUtils, side);
+        } else if (PositionsWs.POSITIONSWS_CHANNEL.equals(channel)) {
+            PositionsWs.handleEvent(response, redisUtils);
         } else if (BalanceAndPositionWs.CHANNEL_NAME.equals(channel)) {
             BalanceAndPositionWs.handleEvent(response);
         }

--
Gitblit v1.9.1