feat: 费用审核智能体—规则+报销流程+看板
This commit is contained in:
@@ -530,3 +530,49 @@ class VoucherDetail(Base):
|
||||
new_standard_category = Column(String(20), nullable=True, comment="新30号准则分类")
|
||||
period = Column(String(20), nullable=True, comment="期间 YYYY-MM")
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
|
||||
|
||||
# ============================================================
|
||||
# 费用审核智能体 (2026-08)
|
||||
# ============================================================
|
||||
|
||||
class ExpenseRule(Base):
|
||||
"""费用规则 — 自动校验报销单的标准"""
|
||||
__tablename__ = "expense_rules"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
rule_name = Column(String(100), nullable=False, comment="规则名称")
|
||||
dimension = Column(String(20), nullable=False, comment="维度: department/person/expense_type")
|
||||
dimension_value = Column(String(100), nullable=True, comment="维度值: 部门名/人员名/费用类型(空=全局)")
|
||||
expense_type = Column(String(30), nullable=False, comment="费用类型: entertainment/travel/office/management")
|
||||
limit_type = Column(String(20), nullable=False, comment="限额类型: single/monthly/yearly 单笔/月度累计/年度累计")
|
||||
limit_amount = Column(Float, nullable=False, comment="限额金额")
|
||||
cycle = Column(String(20), default="monthly", comment="周期: single/monthly/yearly")
|
||||
status = Column(String(20), default="active", comment="active/inactive")
|
||||
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())
|
||||
|
||||
|
||||
class ExpenseReimbursement(Base):
|
||||
"""费用报销单 — 提交后自动校验规则,超限自动打回"""
|
||||
__tablename__ = "expense_reimbursements"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
reimb_no = Column(String(50), unique=True, nullable=False, comment="报销单号")
|
||||
applicant = Column(String(100), nullable=False, comment="申请人")
|
||||
department = Column(String(100), nullable=True, comment="部门")
|
||||
expense_type = Column(String(30), nullable=False, comment="费用类型: entertainment/travel/office/management")
|
||||
title = Column(String(200), nullable=False, comment="事由/摘要")
|
||||
amount = Column(Float, nullable=False, comment="报销金额")
|
||||
expense_date = Column(DateTime, nullable=True, comment="费用发生日期")
|
||||
attachment = Column(String(500), nullable=True, comment="附件文件名")
|
||||
status = Column(String(20), default="pending", comment="pending待审批/approved已通过/rejected已拒绝/returned已打回")
|
||||
check_result = Column(String(20), default="pass", comment="自动校验结果: pass/fail")
|
||||
check_reason = Column(String(1000), nullable=True, comment="超限原因")
|
||||
check_detail = Column(JSON, nullable=True, comment="校验明细: [{rule_name, limit, actual, passed}]")
|
||||
checked_at = Column(DateTime, nullable=True, comment="自动校验时间")
|
||||
approver = Column(String(100), nullable=True, comment="审批人")
|
||||
approve_comment = Column(String(500), nullable=True, comment="审批意见")
|
||||
approved_at = Column(DateTime, nullable=True, comment="审批时间")
|
||||
created_by = Column(String(100), nullable=True, comment="提交人")
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
||||
|
||||
Reference in New Issue
Block a user