From cbe19ea6066a600cbd0b5110db5d43f8252d14a8 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 13 六月 2024 11:23:53 +0800
Subject: [PATCH] L撤成交进度相关改进

---
 utils/data_export_util.py |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/utils/data_export_util.py b/utils/data_export_util.py
index 2681ca0..146f6ce 100644
--- a/utils/data_export_util.py
+++ b/utils/data_export_util.py
@@ -43,16 +43,10 @@
         datas = local_today_datas.get(code)
     if not datas:
         datas = []
-    logger_debug.info("鍔犺浇L2閫愮瑪濮旀墭鑰楁椂锛歿}", f"{(time.time() - __start_time)}")
-    __start_time = time.time()
     process_indexs = log_export.get_l2_process_position(code, date)
-    logger_debug.info("鍔犺浇L2閫愮瑪濮旀墭鎵规鑰楁椂锛歿}", f"{(time.time() - __start_time)}")
-    __start_time = time.time()
     trade_indexs = log_export.get_l2_trade_position(code, date)
     real_position_indexes = log_export.get_real_place_order_positions(code, date)
     deal_list = log_export.load_huaxin_deal_record(code, date)
-    logger_debug.info("鍔犺浇鍏朵粬浜ゆ槗鍙傛暟鑰楁椂锛歿}", f"{(time.time() - __start_time)}")
-    __start_time = time.time()
     deal_list_dict = {}
     for d in deal_list:
         deal_list_dict[str(d[0])] = d
@@ -61,14 +55,10 @@
     sell_nos = sell_no_dict.get(code)
     active_sell_map = log_export.load_huaxin_active_sell_map(date=date)
     active_sell_set = active_sell_map.get(code)
-    logger_debug.info("鍔犺浇鍗栧崟鑰楁椂锛歿}", f"{(time.time() - __start_time)}")
-    __start_time = time.time()
     if not active_sell_set:
         active_sell_set = set()
     fdatas = export_l2_data(code, datas, process_indexs, trade_indexs, real_position_indexes, deal_list_dict, sell_nos,
                             active_sell_set)
-    logger_debug.info("缁勮鏁版嵁鑰楁椂锛歿}", f"{(time.time() - __start_time)}")
-    __start_time = time.time()
     return fdatas
 
 
@@ -94,30 +84,30 @@
             if trade_indexs[i][1] == index:
                 return trade_indexs[i]
         return None
-    logger_debug.info("鍑嗗鍔犺浇L2Map鏁版嵁-----")
     # 鏁版嵁棰勫鐞�
     num_operate_map = {}
     l2.l2_data_util.load_num_operate_map(num_operate_map, code, datas)
-    logger_debug.info("load_num_operate_map")
-
     buy_no_map = {}
     sell_no_map = {}
     l2.l2_data_util.load_buy_no_map(buy_no_map, code, datas)
-    logger_debug.info("load_buy_no_map")
     l2.l2_data_util.load_sell_no_map(sell_no_map, code, datas)
-    logger_debug.info("load_sell_no_map")
     l2.l2_data_util.load_canceled_buy_no_map(l2.l2_data_util.local_today_canceled_buyno_map, code, datas)
-    logger_debug.info("load_canceled_buy_no_map")
     # num_dict = {}
     # for data in datas:
     #     if data["val"]["num"] not in num_dict:
     #         num_dict[data["val"]["num"]] = []
     #     num_dict[data["val"]["num"]].append(data)
-
+    logger_debug.info(f"寰幆缁勮鏁版嵁寮�濮嬶細闀垮害-{len(datas)} 涓诲姩鍗栭暱搴�-{len(active_sell_nos)}")
     index = 0
     fdatas = []
+    # 鏁版嵁澶灏遍渶瑕佽繃婊ゆ帀灏忛噾棰�
+    is_data_too_large = len(datas) > 20000
     for data in datas:
         index += 1
+        if is_data_too_large and data['val']['num'] * float(data['val']['price']) < 5000:
+            if data["index"] not in real_position_indexes:
+                continue
+
         # 鍏堢Щ闄�
         if data['val']['orderNo'] in active_sell_nos:
             # 杩囨护涓诲姩鍗�

--
Gitblit v1.8.0