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

---
 api/outside_api_command_callback.py |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/api/outside_api_command_callback.py b/api/outside_api_command_callback.py
index 2bdf7bc..14e7d7b 100644
--- a/api/outside_api_command_callback.py
+++ b/api/outside_api_command_callback.py
@@ -38,8 +38,9 @@
 from third_data.history_k_data_manager import HistoryKDataManager
 from third_data.history_k_data_util import JueJinApi, HistoryKDatasUtils
 from third_data.kpl_data_manager import KPLDataManager
+from third_data.kpl_limit_up_data_manager import CodeLimitUpSequenceManager
 from third_data.kpl_util import KPLDataType
-from trade import trade_manager, l2_trade_util
+from trade import trade_manager, l2_trade_util, trade_data_manager
 import l2_data_util as l2_data_util_old
 
 from trade.huaxin import huaxin_trade_api, huaxin_trade_data_update, \
@@ -817,7 +818,7 @@
                 except Exception as e:
                     self.send_response({"code": 1, "msg": str(e)}, client_id, request_id)
             elif ctype == "get_delegated_buy_code_infos":
-                account_available_money = trade_manager.AccountAvailableMoneyManager().get_available_money_cache()
+                account_available_money = trade_data_manager.AccountMoneyManager().get_available_money_cache()
                 # 鑾峰彇濮旀墭涓殑浠g爜
                 # current_delegates = huaxin_trade_record_manager.DelegateRecordManager().list_current_delegates()
                 current_delegates, update_time = huaxin_trade_record_manager.DelegateRecordManager.list_by_day(
@@ -1035,17 +1036,9 @@
                             limit_up_data = kpl_data_manager.KPLLimitUpDataRecordManager.record_code_dict.get(code)
                             # 鑾峰彇褰撳墠鏉垮潡
                             try:
-                                can_buy_result = CodePlateKeyBuyManager.can_buy(code)
-                                if can_buy_result:
-                                    if can_buy_result[0]:
-                                        fdata['block'] = ",".join(
-                                            [f"{x[0]}-{x[1] + 1}({x[2]}&{x[3] - x[2]})" for x in can_buy_result[0]])
-                                    else:
-                                        if can_buy_result[1]:
-                                            if limit_up_data:
-                                                fdata['block'] = f"{limit_up_data[5]}-鐙嫍"
-                                            else:
-                                                fdata['block'] = f"鐙嫍"
+                                limit_up_sequence = CodeLimitUpSequenceManager.get_current_limit_up_sequence(code)
+                                if limit_up_sequence:
+                                    fdata['block'] = f"{limit_up_sequence[0]}-{limit_up_sequence[1]}({limit_up_sequence[2]}&{limit_up_sequence[2] - limit_up_sequence[3]})"
                             except:
                                 pass
                             # 鑾峰彇娑ㄥ仠鏃堕棿
@@ -1184,7 +1177,8 @@
             elif ctype == "get_buy_block_mode":
                 # 鑾峰彇涔板叆鏉垮潡鐨勬ā寮�
                 can_buy_unique_block = TradeBlockBuyModeManager().can_buy_unique_block()
-                self.send_response({"code": 0, "data": {"unique_block": 1 if can_buy_unique_block else 0 }, "msg": f""}, client_id,
+                self.send_response({"code": 0, "data": {"unique_block": 1 if can_buy_unique_block else 0}, "msg": f""},
+                                   client_id,
                                    request_id)
 
             elif ctype == "set_buy_unique_block_mode":

--
Gitblit v1.8.0