From e91b7aea968fc18495fdf7df8d49751129594966 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期日, 26 五月 2024 09:16:14 +0800
Subject: [PATCH] 分离LSH撤

---
 third_data/code_plate_key_manager.py |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/third_data/code_plate_key_manager.py b/third_data/code_plate_key_manager.py
index adb81c1..57f19a6 100644
--- a/third_data/code_plate_key_manager.py
+++ b/third_data/code_plate_key_manager.py
@@ -699,10 +699,10 @@
         if not block_codes:
             # 楂樹綅鏉挎硾鍖栨澘鍧椾腑鏃犳澘鍧�
             if not high_level_block_codes.get(block):
-                return False, True, f"{block}:鏉垮潡鏃犳定鍋�", False, False, 0
+                return False, True, f"{block}:鏉垮潡鏃犳定鍋�", False, False, 0, 0
         elif len(block_codes) == 1 and code in block_codes:
             if not high_level_block_codes.get(block):
-                return False, True, f"{block}:鏉垮潡鍙湁褰撳墠浠g爜娑ㄥ仠", False, False, 0
+                return False, True, f"{block}:鏉垮潡鍙湁褰撳墠浠g爜娑ㄥ仠", False, False, 0, 0
         # 鍙互涔扮殑鏈�澶ф帓鍚�
         # open_limit_up_codes = kpl_block_util.get_shsz_open_limit_up_codes(code, block, limit_up_record_datas,
         #                                                                   code_limit_up_reason_dict)
@@ -752,9 +752,11 @@
         is_active_buy = cls.__is_need_active_buy(code, block, current_shsz_rank, len(current_open_limit_up_codes))
 
         if current_shsz_rank < len(current_open_limit_up_codes) + max_rank:
-            return True, False, f"銆恵block}銆戝墠鎺掍唬鐮侊細{current_shsz_rank}", is_strong_block, is_active_buy, current_shsz_rank
+            return True, False, f"銆恵block}銆戝墠鎺掍唬鐮侊細{current_shsz_rank}", is_strong_block, is_active_buy, current_shsz_rank, len(
+                block_codes)
         else:
-            return False, False, f"銆恵block}銆戝墠鎺掍唬鐮侊細{front_current_shsz_rank_codes} 瓒呰繃{len(current_open_limit_up_codes) + max_rank}涓�", is_strong_block, is_active_buy, current_shsz_rank
+            return False, False, f"銆恵block}銆戝墠鎺掍唬鐮侊細{front_current_shsz_rank_codes} 瓒呰繃{len(current_open_limit_up_codes) + max_rank}涓�", is_strong_block, is_active_buy, current_shsz_rank, len(
+                block_codes)
 
     # 鑾峰彇鍙互涔扮殑鏉垮潡
     # current_limit_up_datas: 浠婃棩瀹炴椂娑ㄥ仠
@@ -797,15 +799,16 @@
         code_limit_up_reasons_dict = {}
         load_code_block()
         for block in keys:
-            can_buy, unique, msg, is_strong, is_active_buy, current_rank = cls.__is_block_can_buy_new(code, block,
-                                                                                                      current_limit_up_datas,
-                                                                                                      code_limit_up_reasons_dict,
-                                                                                                      yesterday_current_limit_up_codes,
-                                                                                                      limit_up_record_datas,
-                                                                                                      current_limit_up_block_codes_dict,
-                                                                                                      high_level_code_blocks=high_level_general_code_blocks,
-                                                                                                      high_level_block_codes=high_level_general_block_codes)
-            fresults.append((block, can_buy, unique, msg, is_strong, is_active_buy, current_rank))
+            can_buy, unique, msg, is_strong, is_active_buy, current_rank, block_limit_up_count = cls.__is_block_can_buy_new(
+                code, block,
+                current_limit_up_datas,
+                code_limit_up_reasons_dict,
+                yesterday_current_limit_up_codes,
+                limit_up_record_datas,
+                current_limit_up_block_codes_dict,
+                high_level_code_blocks=high_level_general_code_blocks,
+                high_level_block_codes=high_level_general_block_codes)
+            fresults.append((block, can_buy, unique, msg, is_strong, is_active_buy, current_rank, block_limit_up_count))
         return fresults, keys
 
     # 鏄惁鍙互涓嬪崟
@@ -814,7 +817,7 @@
     @classmethod
     def can_buy(cls, code):
         if constant.TEST:
-            return ["娴嬭瘯"], True, cls.BLOCK_TYPE_NONE, [], set(), ["鍖栧伐"]
+            return [("娴嬭瘯", 0, 1)], True, cls.BLOCK_TYPE_NONE, [], set(), ["鍖栧伐"]
         # if True:
         #     # 娴嬭瘯
         #     return True, "涓嶅垽鏂澘鍧楄韩浣�"
@@ -897,10 +900,11 @@
                 # if r[0] in trade_delegate_blocks_count and len(trade_delegate_blocks_count[r[0]]) >= MAX_DELEGATE_COUNT:
                 #     msg_list.append(f"銆恵r[0]}銆戝凡鎸傚崟锛歿trade_delegate_blocks_count[r[0]]}")
                 #     continue
-                if len(r)>6:
-                    can_buy_blocks.append(f"{r[0]}-{r[6]}")
+                if len(r) > 7:
+                    can_buy_blocks.append((r[0], r[6], r[7]))
                 else:
-                    can_buy_blocks.append(f"{r[0]}")
+                    # 锛堟澘鍧楀悕绉�,韬綅,鏉垮潡娑ㄥ仠鏁伴噺锛�
+                    can_buy_blocks.append((r[0], 0, 1))
                 if r[4]:
                     can_buy_strong_blocks.append(r[0])
                 if r[3]:

--
Gitblit v1.8.0