From 3843348344ddac2a8846af7f88b977762d85617a Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 09 四月 2025 19:44:27 +0800 Subject: [PATCH] L2数据解析 --- l2_data_parser.py | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/l2_data_parser.py b/l2_data_parser.py index b7feec4..00496e8 100644 --- a/l2_data_parser.py +++ b/l2_data_parser.py @@ -13,7 +13,7 @@ return codes -def parse_order_detail(day): +def parse_order_detail(day, code): target_codes = __get_target_codes(day) base_path = f"/home/userzjj/ftp/{day}" with open(f"{base_path}/OrderDetail.csv", 'r', encoding='utf-8') as file: @@ -29,6 +29,8 @@ # 閫愯鍐欏叆鏁版嵁 for row in csv_reader: if row[1] not in target_codes: + continue + if code and code != row[1]: continue # 灏嗘枃浠跺啓鍏ュ埌鏂囨湰 writer.writerow(row) @@ -103,8 +105,12 @@ print("鎺ユ敹鐨勫弬鏁�", params) _type = params[0].strip() day = params[1].strip() + if len(params)>2: + code = params[2].strip() + else: + code = None if _type == 'OrderDetail': - parse_order_detail(day) + parse_order_detail(day, code) elif _type == 'Transaction': parse_transaction(day) elif _type == 'NGTSTick': -- Gitblit v1.8.0