From fda20e935bea4870544695185ec9427dc66fb168 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 06 八月 2024 16:22:20 +0800 Subject: [PATCH] bug修复/H撤更新/接口修改 --- servers/data_server.py | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/servers/data_server.py b/servers/data_server.py index 8eb8342..2656a2a 100644 --- a/servers/data_server.py +++ b/servers/data_server.py @@ -9,7 +9,7 @@ from code_attribute.gpcode_manager import BlackListCodeManager 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 third_data.kpl_limit_up_data_manager import LatestLimitUpBlockManager +from third_data.kpl_limit_up_data_manager import LatestLimitUpBlockManager, CodeLimitUpSequenceManager from utils import global_util, tool, data_export_util from code_attribute import gpcode_manager from log_module import log, log_analyse, log_export, async_log_util @@ -711,6 +711,15 @@ # 鑾峰彇鎵嬬画璐硅鎯� try: fdata = {"delegates": {}} + # 鑾峰彇鏈湀鐨勬墜缁垂 + end_date = tool.get_now_date_str("%Y%m%d") + start_date = f"{end_date[:6]}01" + delegates = trade_data_manager.AccountMoneyManager().get_delegated_count_info(start_date, end_date) + deal_count = trade_data_manager.AccountMoneyManager().get_deal_count(start_date, end_date) + cost = sum([round(0.1 * x[1], 2) for x in delegates]) + make = deal_count * 5 + fdata["month_commission"] = round(make - cost, 2) + # 璁$畻褰撴棩鎵嬬画璐硅鎯� delegates = trade_data_manager.AccountMoneyManager().get_delegated_count_info() delegates = [{"count": x[1], "price": 0.1, "money": round(0.1 * x[1], 2)} for x in delegates] fdata["delegates"]["buy"] = delegates[0] @@ -719,7 +728,7 @@ fdata["delegates"]["sell"] = delegates[3] deal_count = trade_data_manager.AccountMoneyManager().get_deal_count() fdata["deal"] = {"count": deal_count, "price": 5, "money": round(5 * deal_count, 2)} - fdata["commission"] = trade_data_manager.AccountMoneyManager().get_commission_cache() + fdata["commission"] = trade_data_manager.AccountMoneyManager().get_commission_cache() response_data = json.dumps({"code": 0, "data": fdata}) except Exception as e: logger_debug.exception(e) @@ -803,6 +812,10 @@ LatestLimitUpBlockManager().set_current_limit_up_data(tool.get_now_date_str(), result_list_) except: pass + try: + CodeLimitUpSequenceManager().set_current_limit_up_datas(result_list_) + except: + pass self.__kplDataManager.save_data(type_, result_list_) except Exception as e: logger_debug.exception(e) -- Gitblit v1.8.0