| | |
| | | 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: |
| | |
| | | # 逐行写入数据 |
| | | for row in csv_reader: |
| | | if row[1] not in target_codes: |
| | | continue |
| | | if code and code != row[1]: |
| | | continue |
| | | # 将文件写入到文本 |
| | | writer.writerow(row) |
| | |
| | | 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': |