From 8ef576b9a1809dd52dacaafe960db456b09e9e0b Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 30 三月 2023 18:24:21 +0800
Subject: [PATCH] 看盘界面调整

---
 third_data/hot_block_data_process.py |   61 +++++++++++++++++++++++-------
 1 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/third_data/hot_block_data_process.py b/third_data/hot_block_data_process.py
index f83f800..0138d69 100644
--- a/third_data/hot_block_data_process.py
+++ b/third_data/hot_block_data_process.py
@@ -97,6 +97,24 @@
         return fresult
 
 
+class XGBDataUtil:
+
+    # 鏉垮潡涓槸鍚︽湁楂樹綅绁�
+    @classmethod
+    def is_has_high_code(cls, block_name, latest_datas):
+        if not latest_datas:
+            return False
+        for block in latest_datas:
+            if block[0] != block_name:
+                continue
+            for code_data in block[2]:
+                if code_data[1] and code_data[1].find("鏉�") >= 0:
+                    day = code_data[1][-2:-1]
+                    if int(day) >= 2:
+                        return True, code_data
+        return False, None
+
+
 __blocks_dict = {}
 
 
@@ -122,21 +140,24 @@
     # 鏂版蹇�
     new_block = None
     latest_blocks = get_latest_block(15)
-    for block in blocks:
-        if block not in latest_blocks:
-            new_block = block
-            # 濡傛灉鏉垮潡涓殑娑ㄥ仠绁ㄦ暟銆�=2鎵嶇畻鏂伴鏉�
-            count = 0
-            if XGBHotBlockDataManager.latest_datas:
-                for b in XGBHotBlockDataManager.latest_datas:
-                    if b[0] == new_block:
-                        for code_data in b[2]:
-                            if len(code_data[4]) > 6:
-                                count += 0
-            if count < 2:
-                new_block = None
-            if not new_block:
+    if blocks:
+        for block in blocks:
+            if block not in latest_blocks:
+                new_block = block
                 break
+                # # 濡傛灉鏉垮潡涓殑娑ㄥ仠绁ㄦ暟銆�=2鎵嶇畻鏂伴鏉愶紝鏆傛椂鍙栨秷
+                # count = 0
+                # if XGBHotBlockDataManager.latest_datas:
+                #     for b in XGBHotBlockDataManager.latest_datas:
+                #         if b[0] == new_block:
+                #             for code_data in b[2]:
+                #                 if len(code_data[4]) > 6:
+                #                     count += 0
+                # if count < 1:
+                #     # 鏉垮潡涓渶浣庢湁
+                #     new_block = None
+                # if not new_block:
+                # break
 
     target_block = None
     if blocks:
@@ -147,6 +168,16 @@
             break
     if not target_block:
         return None
+
+    # 鏄惁鍑虹幇杩囬珮浣嶆澘
+    high_block_info = None
+    for block in blocks:
+        if block == '鍏憡' or block == '鍏朵粬':
+            continue
+        if XGBHotBlockDataManager.latest_datas:
+            has_high, high_code_info = XGBDataUtil.is_has_high_code(block, XGBHotBlockDataManager.latest_datas)
+            if has_high:
+                high_block_info = (high_code_info[0], high_code_info[1])
 
     limit_up_codes_set = set()
     if XGBHotBlockDataManager.latest_datas:
@@ -175,7 +206,7 @@
     break_codes = break_codes.difference(limit_up_codes_set)
     # 鐐告澘涓暟
     break_size = len(break_codes)
-    return target_block, limit_up_count, break_size, new_block
+    return target_block, limit_up_count, break_size, new_block, high_block_info
 
 
 # 淇濆瓨鏁版嵁

--
Gitblit v1.8.0