| | |
| | | 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 |
| | |
| | | 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 |