feat: 支持ZIP压缩包上传(含密码保护)

This commit is contained in:
CHE LIANG ZHAO
2026-01-23 13:46:45 +08:00
parent 49e3176e6b
commit a97a8d6a20
22 changed files with 973 additions and 72 deletions

View File

@@ -18,11 +18,31 @@ class AlipayCleaner(BaseCleaner):
"""执行清理"""
self.print_header()
# 读取数据
# 读取数据,跳过支付宝导出文件的头部信息
with open(self.input_file, "r", encoding="utf-8") as f:
reader = csv.reader(f)
header = next(reader)
rows = list(reader)
header = None
rows = []
for row in reader:
# 跳过空行
if not row or not row[0].strip():
continue
# 查找实际的CSV头部行包含"交易时间"和"交易分类"
if header is None:
if len(row) >= 2 and "交易时间" in row[0] and "交易分类" in row[1]:
header = row
continue
# 跳过头部信息行
continue
# 收集数据行
rows.append(row)
# 确保找到了有效的头部
if header is None:
raise ValueError("无法找到有效的支付宝账单表头(需包含'交易时间''交易分类'列)")
self.stats["original_count"] = len(rows)
print(f"原始数据行数: {len(rows)}")