From ffc5b9eb80eb5bd43077a0ce96e0fb2ea4c8d62c Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期三, 25 十月 2023 11:31:58 +0800
Subject: [PATCH] bug修复

---
 trade/huaxin/huaxin_trade_order_processor.py |    7 ++++---
 huaxin_client/trade_client.py                |    4 +++-
 trade/huaxin/huaxin_trade_api.py             |    3 ++-
 utils/data_export_util.py                    |    2 +-
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/huaxin_client/trade_client.py b/huaxin_client/trade_client.py
index a37a603..1c8ec4b 100644
--- a/huaxin_client/trade_client.py
+++ b/huaxin_client/trade_client.py
@@ -874,12 +874,14 @@
             sinfo = data["sinfo"]
             order_ref = data.get("order_ref")
             shadow_price = data.get("shadow_price")
+            blocking = data.get("blocking")
 
             if direction == 1:
                 async_log_util.info(logger_trade, f"{code}鍗庨懌鏈湴寮�濮嬩笅鍗�")
                 # 涔�
                 try:
-                    req_rid_dict[sinfo] = (client_id, request_id, sk, order_ref)
+                    if blocking:
+                        req_rid_dict[sinfo] = (client_id, request_id, sk, order_ref)
                     # threading.Thread(target=lambda: self.__tradeSimpleApi.buy(code, volume, price, sinfo, order_ref),
                     #                  daemon=True).start()
                     self.trade_thread_pool.submit(self.__tradeSimpleApi.buy, code, volume, price, sinfo, order_ref, shadow_price)
diff --git a/trade/huaxin/huaxin_trade_api.py b/trade/huaxin/huaxin_trade_api.py
index 259e7b9..21d19c4 100644
--- a/trade/huaxin/huaxin_trade_api.py
+++ b/trade/huaxin/huaxin_trade_api.py
@@ -372,7 +372,8 @@
                             "order_ref": order_ref,
                             "volume": volume,
                             "price_type": price_type,
-                            "price": price, "shadow_price": shadow_price, "sinfo": sinfo}, request_id=request_id,
+                            "price": price, "shadow_price": shadow_price, "sinfo": sinfo, "blocking": blocking},
+                           request_id=request_id,
                            blocking=blocking,
                            is_pipe=is_pipe_channel_normal())
     try:
diff --git a/trade/huaxin/huaxin_trade_order_processor.py b/trade/huaxin/huaxin_trade_order_processor.py
index 708aa63..36917f3 100644
--- a/trade/huaxin/huaxin_trade_order_processor.py
+++ b/trade/huaxin/huaxin_trade_order_processor.py
@@ -148,9 +148,10 @@
             if huaxin_util.is_can_cancel(order.orderStatus):
                 # 璁剧疆涓嬪崟鎴愬姛
                 new_place_order_index_ = process_order_success(order)
-                if not new_place_order_index_:
-                    # 鏈夊彲鑳界敱浜嶭2鏁版嵁杩樻病鏈夋潵锛屽鑷存纭殑涓嬪崟浣嶇疆灏氭湭鑾峰彇鍒帮紝闇�瑕佸欢鏃�200ms鍐嶈繘琛屽鐞�
-                    cls.__thread_pool.submit(lambda: process_order_success(order, delay_s=0.2))
+                # 鏆傛椂涓嶉渶瑕侀獙璇�
+                # if not new_place_order_index_:
+                #     # 鏈夊彲鑳界敱浜嶭2鏁版嵁杩樻病鏈夋潵锛屽鑷存纭殑涓嬪崟浣嶇疆灏氭湭鑾峰彇鍒帮紝闇�瑕佸欢鏃�200ms鍐嶈繘琛屽鐞�
+                #     cls.__thread_pool.submit(lambda: process_order_success(order, delay_s=0.2))
             elif huaxin_util.is_canceled(order.orderStatus) or huaxin_util.is_deal(
                     order.orderStatus):
                 # 宸茬粡鎾ゅ崟/宸茬粡鎴愪氦锛岄渶瑕佸鐞嗕复鏃朵繚瀛樼殑绯荤粺璁㈠崟鍙�
diff --git a/utils/data_export_util.py b/utils/data_export_util.py
index f036bec..cd55100 100644
--- a/utils/data_export_util.py
+++ b/utils/data_export_util.py
@@ -265,6 +265,6 @@
 
 if __name__ == "__main__":
     try:
-        export_l2_excel("000010")
+        export_l2_excel("000981")
     except Exception as e:
         logging.exception(e)

--
Gitblit v1.8.0