feat(cashflow): 现金流量表结构分析——三大活动净额八类企业定性判定 (P1)

- 后端: cashflow_structure.py 模块 (GET rules/periods/values/analysis + POST values upsert)
- 判定: O/I/F 三净额符号 → 8类企业定性 (CMA P2 现金流量表分析, 无'现金流肖像'字样)
- 数据: cash_flow_structure_values 表 (entity_id+period 唯一), 官方现金流量表净额按期间注入
- 前端: CashFlowStructure.vue 判定横幅/瀑布图/规则表/入库记录 + MyDialog 录入弹窗
- 菜单: 财务报表分析 → 现金流量表分析 (路由 /cashflow-structure, 角色 ceo/finance/it)
- 测试: tests/test_cashflow_structure.py 7 条通过 (规则8类/判定/覆盖/博海边界6-7/非法期间)
This commit is contained in:
Hermes CI Fix
2026-09-03 01:22:46 +08:00
parent 0a6320f41f
commit e5dd6e380b
7 changed files with 1034 additions and 4 deletions
+21
View File
@@ -940,3 +940,24 @@ class AISuggestion(Base):
apply_detail = Column(JSON, nullable=True, comment="应用结果明细: [{target_type,target_id,action,before,after}]")
created_at = Column(DateTime, server_default=func.now())
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
class CashFlowStructureValue(Base):
"""现金流量表结构分析 — 三大活动净额 (P1 2026-09-03 八类企业定性分析)
官方现金流量表三大活动净额按期间注入,支撑 O/I/F 符号组合 → 8类企业判定
单位统一为 万元(与 BH_CASH_BALANCE / ledger 口径一致)
"""
__tablename__ = "cash_flow_structure_values"
id = Column(Integer, primary_key=True, index=True)
entity_id = Column(Integer, nullable=False, default=1, comment="企业ID(账套,多租户隔离)")
period = Column(String(20), nullable=False, comment="期间 YYYY-MM")
operating_net = Column(Float, nullable=False, comment="经营活动现金流量净额(万元)")
investing_net = Column(Float, nullable=False, comment="投资活动现金流量净额(万元)")
financing_net = Column(Float, nullable=False, comment="筹资活动现金流量净额(万元)")
begin_cash = Column(Float, nullable=True, comment="期初现金及现金等价物余额(万元)")
end_cash = Column(Float, nullable=True, comment="期末现金及现金等价物余额(万元)")
source = Column(String(50), default="official", comment="official官方报表/manual人工录入")
remark = Column(String(500), nullable=True, comment="备注/口径说明")
created_at = Column(DateTime, server_default=func.now())
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
__table_args__ = (UniqueConstraint("entity_id", "period", name="uq_cf_struct_entity_period"),)