You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

681 B

批量导入跨文件去重

动机

当前批量导入时,每个文件独立处理,文件之间没有重复性校验。如果多个文件包含相同的交易记录,会导致数据重复。同时,一个文件内部的一次委托分多次成交不应被误判为重复。

目标

  1. 单文件导入时,文件内部不去重,允许一次委托分多次成交
  2. 批量导入时,跨文件进行去重,避免重复导入
  3. 数据库中已有记录仍需去重

范围

  • app/services/trade_parser.pysave_to_db 增加 batch_existing_keys 参数,返回新增去重键
  • app/api/trade_review.py — 批量导入时维护跨文件去重键集合