Refine travel reimbursement steward flow

Align planner, runtime rules, and policy assets so travel guidance
matches the updated reimbursement workflow.
This commit is contained in:
caoxiaozhu
2026-06-15 22:55:18 +08:00
parent 792741709a
commit 9f7b8b46a3
85 changed files with 9496 additions and 2555 deletions

View File

@@ -13,8 +13,18 @@ from app.schemas.agent_asset import (
from app.services.agent_asset_spreadsheet import (
COMPANY_COMMUNICATION_EXPENSE_RULE_CODE,
COMPANY_COMMUNICATION_EXPENSE_RULE_FILENAME,
COMPANY_TRAVEL_ALLOWANCE_RULE_CODE,
COMPANY_TRAVEL_ALLOWANCE_RULE_FILENAME,
COMPANY_TRAVEL_EXPENSE_RULE_CODE,
COMPANY_TRAVEL_EXPENSE_RULE_FILENAME,
COMPANY_TRAVEL_GRADE_MAPPING_RULE_CODE,
COMPANY_TRAVEL_GRADE_MAPPING_RULE_FILENAME,
COMPANY_TRAVEL_SEASON_MAPPING_RULE_CODE,
COMPANY_TRAVEL_SEASON_MAPPING_RULE_FILENAME,
COMPANY_TRAVEL_TRANSPORT_ESTIMATE_RULE_CODE,
COMPANY_TRAVEL_TRANSPORT_ESTIMATE_RULE_FILENAME,
COMPANY_TRAVEL_TRANSPORT_RULE_CODE,
COMPANY_TRAVEL_TRANSPORT_RULE_FILENAME,
FINANCE_RULES_LIBRARY,
RULE_LIBRARY_NAMES,
SPREADSHEET_MIME_TYPE,
@@ -133,7 +143,7 @@ class AgentAssetSpreadsheetHelperMixin:
}
if config_json.get("rule_document") != expected_document:
config_json["detail_mode"] = "spreadsheet"
config_json["tag"] = str(config_json.get("tag") or "财务规则").strip() or "财务规则"
config_json["tag"] = str(config_json.get("tag") or "基础规则").strip() or "基础规则"
config_json["rule_library"] = library
config_json["rule_document"] = expected_document
asset.config_json = config_json
@@ -160,7 +170,7 @@ class AgentAssetSpreadsheetHelperMixin:
)
config_json = dict(asset.config_json or {})
config_json["detail_mode"] = "spreadsheet"
config_json["tag"] = str(config_json.get("tag") or "财务规则").strip() or "财务规则"
config_json["tag"] = str(config_json.get("tag") or "基础规则").strip() or "基础规则"
config_json["rule_library"] = library
config_json["rule_document"] = {
**self.spreadsheet_manager.build_rule_document_config(
@@ -187,6 +197,16 @@ class AgentAssetSpreadsheetHelperMixin:
return COMPANY_TRAVEL_EXPENSE_RULE_FILENAME
if asset.code == COMPANY_COMMUNICATION_EXPENSE_RULE_CODE:
return COMPANY_COMMUNICATION_EXPENSE_RULE_FILENAME
if asset.code == COMPANY_TRAVEL_ALLOWANCE_RULE_CODE:
return COMPANY_TRAVEL_ALLOWANCE_RULE_FILENAME
if asset.code == COMPANY_TRAVEL_TRANSPORT_RULE_CODE:
return COMPANY_TRAVEL_TRANSPORT_RULE_FILENAME
if asset.code == COMPANY_TRAVEL_TRANSPORT_ESTIMATE_RULE_CODE:
return COMPANY_TRAVEL_TRANSPORT_ESTIMATE_RULE_FILENAME
if asset.code == COMPANY_TRAVEL_GRADE_MAPPING_RULE_CODE:
return COMPANY_TRAVEL_GRADE_MAPPING_RULE_FILENAME
if asset.code == COMPANY_TRAVEL_SEASON_MAPPING_RULE_CODE:
return COMPANY_TRAVEL_SEASON_MAPPING_RULE_FILENAME
fallback = Path(str(asset.name or "规则表").strip()).name
return fallback if fallback.lower().endswith(".xlsx") else f"{fallback}.xlsx"