From 31c03f7c3458ca00d66e04df0af53e7dc3438688 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期一, 05 八月 2024 17:36:24 +0800
Subject: [PATCH] 调整账户资金管理目录/买入调整/增加手续费接口

---
 third_data/kpl_limit_up_data_manager.py |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/third_data/kpl_limit_up_data_manager.py b/third_data/kpl_limit_up_data_manager.py
index 4b4a138..00d5b98 100644
--- a/third_data/kpl_limit_up_data_manager.py
+++ b/third_data/kpl_limit_up_data_manager.py
@@ -42,7 +42,8 @@
     # 棣栨澘韬綅
     __first_block_sequence_dict = {}
 
-    def set_current_limit_up_datas(self, current_limit_up_datas):
+    @classmethod
+    def set_current_limit_up_datas(cls, current_limit_up_datas):
         """
         璁剧疆鐩墠鐨勬定鍋滀唬鐮�
         @param current_limit_up_datas:
@@ -68,6 +69,10 @@
             if b not in block_codes:
                 block_codes[b] = set()
             block_codes[b].add(code)
+        # 鑾峰彇涓婁釜浜ゆ槗鏃ユ定鍋滅殑浠g爜
+        yesterday_codes = kpl_data_manager.get_yesterday_limit_up_codes()
+        if yesterday_codes is None:
+            yesterday_codes = set()
 
         for code in limit_up_codes:
             # 璁$畻韬綅
@@ -76,12 +81,29 @@
             total_count = len(codes)
             # 缁熻鐪熸娑ㄥ仠鏁�
             limit_up_count = 0
+            limit_up_codes_list = []
             for c in codes:
                 if c in limit_up_codes:
                     limit_up_count += 1
-            # TODO 鑾峰彇棣栨澘浠g爜鐨勬帓浣�
+                    if c not in yesterday_codes:
+                        limit_up_codes_list.append((c, current_code_block_dict[c][2]))
+            # 鑾峰彇棣栨澘浠g爜鐨勬帓浣�
+            limit_up_codes_list.sort(key=lambda x: x[1])
+            index = 1
+            for i in range(0, len(limit_up_codes_list)):
+                if limit_up_codes_list[i][0] == code:
+                    index = i + 1
+                    break
+            cls.__first_block_sequence_dict[code] = (b, index, total_count, limit_up_count)
 
-
+    @classmethod
+    def get_current_limit_up_sequence(cls, code):
+        """
+        鑾峰彇浠g爜褰撳墠鐨勬澘鍧楄韩浣�
+        @param code:
+        @return:锛堟澘鍧楀悕绉�,韬綅,鎬绘定鍋滄暟閲忥紝鐩墠娑ㄥ仠鏁伴噺锛�
+        """
+        return cls.__first_block_sequence_dict.get(code)
 
 
 class LatestLimitUpBlockManager:

--
Gitblit v1.8.0