feat: 网银流水导入模板+现金流联动(财务数据通道P1)

This commit is contained in:
Hermes CI Fix
2026-08-28 09:59:07 +08:00
parent b9c624fd7e
commit 3bc68fa1c6
9 changed files with 1050 additions and 6 deletions
+21 -1
View File
@@ -612,9 +612,10 @@ class Subject(Base):
class VoucherDetail(Base):
"""凭证明细 — 新30号准则分类"""
"""凭证明细 — 新30号准则分类 (网银流水导入 2026-08-28)"""
__tablename__ = "voucher_details"
id = Column(Integer, primary_key=True, index=True)
entity_id = Column(Integer, default=1, nullable=False, comment="企业ID (多租户隔离)")
voucher_no = Column(String(50), nullable=False, comment="凭证编号")
voucher_date = Column(DateTime, nullable=False, comment="凭证日期")
subject_code = Column(String(20), nullable=False, comment="科目编码")
@@ -622,8 +623,27 @@ class VoucherDetail(Base):
debit_amount = Column(Float, default=0, comment="借方金额")
credit_amount = Column(Float, default=0, comment="贷方金额")
summary = Column(String(500), nullable=True, comment="摘要")
carry_forward = Column(Integer, default=0, nullable=False, comment="结转行标记(1=结转行不参与现金流)")
new_standard_category = Column(String(20), nullable=True, comment="新30号准则分类")
period = Column(String(20), nullable=True, comment="期间 YYYY-MM")
batch = Column(String(100), nullable=True, comment="导入批次号")
created_at = Column(DateTime, server_default=func.now())
class ImportLog(Base):
"""数据导入日志 — 网银流水/Excel导入批次记录 (2026-08-28)"""
__tablename__ = "import_logs"
id = Column(Integer, primary_key=True, index=True)
entity_id = Column(Integer, default=1, nullable=False, comment="企业ID (多租户隔离)")
filename = Column(String(500), nullable=False, comment="文件名")
batch = Column(String(100), nullable=False, comment="批次号")
total_rows = Column(Integer, nullable=True, comment="总行数")
success_rows = Column(Integer, nullable=True, comment="成功行数")
failed_rows = Column(Integer, nullable=True, comment="失败行数")
errors = Column(JSON, nullable=True, comment="失败详情 [{row, field, reason}]")
period = Column(String(20), nullable=True, comment="导入期间")
import_type = Column(String(20), nullable=True, comment="导入类型: vouchers/kpi")
created_by = Column(String(100), nullable=True, comment="导入人")
created_at = Column(DateTime, server_default=func.now())