Administrator
2024-06-26 3bfb96d2f2664d906409334f3790eace14075301
日志添加
1个文件已修改
26 ■■■■■ 已修改文件
utils/output_data_util.py 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/output_data_util.py
@@ -1,3 +1,4 @@
from log_module.log import logger_debug
from third_data import kpl_data_manager, kpl_block_util
from trade.l2_transaction_data_manager import HuaXinBuyOrderManager
from utils import tool, output_util
@@ -41,18 +42,21 @@
    if latest_datas is None:
        latest_datas = []
    for b in blocks:
        current_codes = kpl_data_manager.KPLLimitUpDataRecordManager.get_current_codes_by_block(b)
        current_codes_count = 0 if not current_codes else len(current_codes)
        temp_records = []
        for r in limit_up_records_data:
            temp_blocks = {r[2]}
            temp_blocks |= set(r[6].split("、"))
            if b in temp_blocks:
                temp_records.append(r)
        rank = kpl_block_util.get_code_current_rank(code, b, latest_datas, code_limit_up_reasons_dict, [], [], [], 0)
        try:
            current_codes = kpl_data_manager.KPLLimitUpDataRecordManager.get_current_codes_by_block(b)
            current_codes_count = 0 if not current_codes else len(current_codes)
            temp_records = []
            for r in limit_up_records_data:
                temp_blocks = {r[2]}
                temp_blocks |= set(r[6].split("、"))
                if b in temp_blocks:
                    temp_records.append(r)
            rank = kpl_block_util.get_code_current_rank(code, b, latest_datas, code_limit_up_reasons_dict, [], [], [], 0)
        blockInfos.append({"name": b, "totalLimitUpCount": len(temp_records),
                           "openLimitUpCount": len(temp_records) - current_codes_count, "rank": rank[0] + 1})
            blockInfos.append({"name": b, "totalLimitUpCount": len(temp_records),
                               "openLimitUpCount": len(temp_records) - current_codes_count, "rank": rank[0] + 1})
        except:
            logger_debug.error(f"blocks:{blocks}")
    # 统计板块的
    fresults["blockInfos"] = blockInfos