Administrator
2025-04-09 3843348344ddac2a8846af7f88b977762d85617a
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':