From 7c6d06136079b73c5676c716c992fdebb23cca7c Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 27 五月 2025 16:15:31 +0800
Subject: [PATCH] bug修复

---
 servers/data_server.py |   37 +++++++++++++++++++++++++------------
 1 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/servers/data_server.py b/servers/data_server.py
index 4c808e7..3c5cc04 100644
--- a/servers/data_server.py
+++ b/servers/data_server.py
@@ -12,7 +12,8 @@
 from code_attribute.gpcode_manager import BlackListCodeManager, HumanRemoveForbiddenManager
 from l2.huaxin import huaxin_target_codes_manager
 from l2.l2_transaction_data_manager import HuaXinBuyOrderManager
-from log_module.log import logger_system, logger_debug, logger_kpl_limit_up, logger_request_api
+from log_module.log import logger_system, logger_debug, logger_kpl_limit_up, logger_request_api, \
+    logger_kpl_market_strong, logger_kpl_new_blocks
 from third_data.custom_block_in_money_manager import CodeInMoneyManager
 from third_data.kpl_data_constant import LimitUpCodesBlockRecordManager, LimitUpDataConstant, \
     ContainsLimitupCodesBlocksManager
@@ -808,8 +809,9 @@
                 deals_month = trade_data_manager.AccountMoneyManager().get_deal_count_info(start_date, end_date)
                 cost_month = sum([round(0.1 * x[1], 2) for x in delegates_month])
                 make_month = 0
-                make_month += max(1 * deals_month[0][1] if deals_month[0][1] else 0, deals_month[0][2] * 1.854 / 10000 if deals_month[0][2] else 0) + 1 * deals_month[1][
-                    1] + 0 * deals_month[2][1]
+                make_month += max(1 * deals_month[0][1] if deals_month[0][1] else 0,
+                                  deals_month[0][2] * 1.854 / 10000 if deals_month[0][2] else 0) + 1 * deals_month[1][
+                                  1] + 0 * deals_month[2][1]
                 fdata["month_commission"] = round(make_month - cost_month, 2)
                 # 璁$畻褰撴棩鎵嬬画璐硅鎯�
                 delegates = trade_data_manager.AccountMoneyManager().get_delegated_count_info()
@@ -959,7 +961,9 @@
                                  big_money_rate * 100  # 澶у崟鎴愪氦姣�
                                  ),
                                 output_util.money_desc(deal_big_money_info[1]),
-                                output_util.money_desc(deal_big_money_info[2])]
+                                output_util.money_desc(deal_big_money_info[2]),
+                                output_util.money_desc(deal_big_money_info[3]),
+                            ]
                             if len(codes) == 1:
                                 # 鍔犺浇澶у崟璇︽儏
                                 deal_big_order_detail_info = radical_buy_data_manager.get_l2_big_order_deal_info(code)
@@ -1037,7 +1041,11 @@
                 @return:
                 """
                 yesterday_codes = kpl_data_manager.get_yesterday_limit_up_codes()
+                blocks = set()
                 for bi in blocks_info:
+                    if bi[0] in blocks:
+                        continue
+                    blocks.add(bi[0])
                     result = kpl_api.getCodesByPlate(bi[1])
                     result = json.loads(result)
                     code_info_list = []
@@ -1046,14 +1054,18 @@
                             continue
                         # 娑ㄥ箙瑕佸ぇ浜�5%
                         rate = d[6] / int(round((tool.get_limit_up_rate(d[0]) - 1) * 10))
-                        if rate/((tool.get_limit_up_rate(d[0])-1)*10) < 5:
+                        if rate / ((tool.get_limit_up_rate(d[0]) - 1) * 10) < 5:
                             continue
                         # 鏍煎紡锛�(浠g爜,娑ㄥ箙)
                         code_info_list.append((d[0], d[6]))
+                    # 淇濆瓨鏂伴鏉�
+                    datas = [(d[0], d[6]) for d in result["list"]]
+                    async_log_util.info(logger_kpl_new_blocks, f"{(tool.get_thread_id() ,bi, datas)}")
                     if code_info_list:
                         # 灏嗕唬鐮佸姞鍏ユ柊棰樻潗
-                        new_block_processor.process_new_block_by_component_codes(bi[0], set([x[0] for x in code_info_list]), all_new_blocks)
-
+                        new_block_processor.process_new_block_by_component_codes(bi[0],
+                                                                                 set([x[0] for x in code_info_list]),
+                                                                                 all_new_blocks)
 
             try:
                 if result_list_:
@@ -1129,7 +1141,9 @@
 
                     try:
                         # 鏂伴鏉�
-                        new_block_codes = new_block_processor.screen_new_blocks_with_limit_up_datas([(x[0], x[5]) for x in result_list_])
+                        new_block_processor.process_limit_up_list({x[0]: x[5] for x in result_list_})
+                        new_block_codes = new_block_processor.screen_new_blocks_with_limit_up_datas(
+                            [(x[0], x[5]) for x in result_list_])
                         if new_block_codes:
                             # 缁熻鏉垮潡鐨勪唬鐮�
                             records = KPLLimitUpDataRecordManager.total_datas
@@ -1149,8 +1163,8 @@
                                 # 闇�瑕佽幏鍙栨澘鍧椾笅鐨勪唬鐮�
                                 self.__new_blocks_codes_request_thread_pool.submit(
                                     lambda: request_new_blocks_codes(update_new_block_plates, new_block_codes.keys()))
-                    except:
-                        pass
+                    except Exception as e:
+                        logger_debug.exception(e)
                     self.__kplDataManager.save_data(type_, result_list_)
             except Exception as e:
                 logger_debug.exception(e)
@@ -1230,11 +1244,10 @@
                 RealTimeKplMarketData.set_market_jingxuan_out_blocks(result_list)
         elif type_ == KPLDataType.MARKET_STRONG.value:
             strong = data["data"]
-            logger_debug.debug("寮�鐩樺暒甯傚満寮哄害锛歿}", strong)
+            logger_kpl_market_strong.info(strong)
             # 淇濆瓨甯傚満鐑害
             if strong is not None:
                 RealTimeKplMarketData.set_market_strong(strong)
-
         return json.dumps({"code": 0})
 
     def __send_response(self, data):

--
Gitblit v1.8.0