后端拆分风险规则生成为解释器、语义分析、本体对齐等子模块, 优化模板执行和流程图生成,完善员工种子数据和导入逻辑,增强 报销单权限策略和草稿持久化,前端新增预算中心视图和趋势图 组件,重构审计页面和风险规则测试对话框交互,完善文档中心 和报销创建页面细节,补充单元测试覆盖。
103 lines
11 KiB
JSON
103 lines
11 KiB
JSON
{
|
|
"schema_version": "2.0",
|
|
"rule_code": "risk.expense.travel.generated_20260525155459576686",
|
|
"name": "住宿日期与差旅行程不匹配",
|
|
"description": "面向业务用户的说明",
|
|
"enabled": true,
|
|
"requires_attachment": true,
|
|
"risk_dimension": "natural_language_rule",
|
|
"risk_category": "差旅费",
|
|
"ontology_signal": "natural_language_risk",
|
|
"evaluator": "template_rule",
|
|
"template_key": "field_required_v1",
|
|
"applies_to": {
|
|
"domains": [
|
|
"expense"
|
|
],
|
|
"expense_categories": [
|
|
"travel"
|
|
]
|
|
},
|
|
"inputs": {
|
|
"fields": [
|
|
{
|
|
"key": "attachment.hotel_city",
|
|
"label": "住宿城市",
|
|
"type": "text",
|
|
"source": "attachment"
|
|
},
|
|
{
|
|
"key": "claim.location",
|
|
"label": "申报地点",
|
|
"type": "text",
|
|
"source": "claim"
|
|
},
|
|
{
|
|
"key": "attachment.route_cities",
|
|
"label": "行程城市",
|
|
"type": "list",
|
|
"source": "attachment"
|
|
},
|
|
{
|
|
"key": "claim.reason",
|
|
"label": "报销事由",
|
|
"type": "text",
|
|
"source": "claim"
|
|
}
|
|
]
|
|
},
|
|
"params": {
|
|
"template_key": "field_required_v1",
|
|
"field_keys": [
|
|
"attachment.hotel_city",
|
|
"claim.location",
|
|
"attachment.route_cities",
|
|
"claim.reason"
|
|
],
|
|
"condition_summary": "检查住宿城市、申报地点、行程城市是否满足必填和完整性要求",
|
|
"natural_language": "差旅住宿报销时,先确认已上传住宿发票或酒店水单;再读取报销事由、申报目的地、住宿城市、开票日期和行程城市。若住宿票据显示的城市不在本次差旅行程范围内,或住宿发生时间明显早于出差开始、晚于出差结束,且没有延期、改签、临时任务等说明,则标记为高风险,要求补充住宿原因、行程证明或重新提交票据。",
|
|
"required_fields": [
|
|
"attachment.hotel_city",
|
|
"claim.location",
|
|
"attachment.route_cities",
|
|
"claim.reason"
|
|
]
|
|
},
|
|
"outcomes": {
|
|
"pass": {
|
|
"severity": "none",
|
|
"action": "continue"
|
|
},
|
|
"fail": {
|
|
"severity": "medium",
|
|
"action": "manual_review"
|
|
}
|
|
},
|
|
"metadata": {
|
|
"owner": "admin",
|
|
"stability": "generated_draft",
|
|
"source_ref": "自然语言风险规则",
|
|
"created_at": "2026-05-25T15:54:59.576686+00:00",
|
|
"created_by": "admin",
|
|
"requires_attachment": true,
|
|
"rule_title": "住宿日期与差旅行程不匹配",
|
|
"expense_category": "travel",
|
|
"expense_category_label": "差旅费",
|
|
"natural_language": "差旅住宿报销时,先确认已上传住宿发票或酒店水单;再读取报销事由、申报目的地、住宿城市、开票日期和行程城市。若住宿票据显示的城市不在本次差旅行程范围内,或住宿发生时间明显早于出差开始、晚于出差结束,且没有延期、改签、临时任务等说明,则标记为高风险,要求补充住宿原因、行程证明或重新提交票据。",
|
|
"business_explanation": "面向业务用户的说明",
|
|
"condition_summary": "检查住宿城市、申报地点、行程城市是否满足必填和完整性要求",
|
|
"flow": {
|
|
"start": "提交业务单据",
|
|
"evidence": "读取住宿城市、申报地点、行程城市",
|
|
"decision": "检查住宿城市、申报地点、行程城市是否满足必填和完整性要求",
|
|
"pass": "继续流转",
|
|
"fail": "提示风险"
|
|
},
|
|
"risk_level": "medium",
|
|
"risk_level_label": "中风险",
|
|
"risk_level_updated_at": "2026-05-25T16:05:15.691638+00:00"
|
|
},
|
|
"flow_diagram_svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"760\" height=\"280\" viewBox=\"0 0 760 280\" data-risk-flow-style=\"review-node-only\" role=\"img\" aria-labelledby=\"risk-flow-title risk-flow-desc\">\n <title id=\"risk-flow-title\">住宿日期与差旅行程不匹配流程说明</title>\n <desc id=\"risk-flow-desc\">风险规则只读流程图,展示从业务单据提交到风险复核的判断路径。</desc>\n <defs>\n <marker id=\"arrow-neutral\" markerWidth=\"10\" markerHeight=\"7\" refX=\"9\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"#cbd5e1\"/>\n </marker>\n </defs>\n <rect width=\"760\" height=\"280\" fill=\"#ffffff\"/>\n <rect x=\"18\" y=\"18\" width=\"724\" height=\"244\" rx=\"8\" ry=\"8\" fill=\"none\" stroke=\"#e2e8f0\" stroke-width=\"1\" stroke-dasharray=\"4,3\"/>\n <text x=\"34\" y=\"43\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"11\" font-weight=\"500\">RULE FLOW</text>\n <g>\n <rect x=\"48\" y=\"118\" width=\"124\" height=\"60\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.2\"/>\n <rect x=\"48\" y=\"118\" width=\"3.5\" height=\"60\" rx=\"1.75\" ry=\"1.75\" fill=\"#cbd5e1\"/>\n <text x=\"110\" y=\"142\" text-anchor=\"middle\" fill=\"#0d0d0d\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"13\" font-weight=\"600\">业务输入</text>\n <text x=\"110\" y=\"161\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"11\" font-weight=\"400\">提交业务单据</text>\n </g>\n <g>\n <rect x=\"214\" y=\"118\" width=\"132\" height=\"60\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.2\"/>\n <rect x=\"214\" y=\"118\" width=\"3.5\" height=\"60\" rx=\"1.75\" ry=\"1.75\" fill=\"#cbd5e1\"/>\n <text x=\"280\" y=\"142\" text-anchor=\"middle\" fill=\"#0d0d0d\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"13\" font-weight=\"600\">字段取数</text>\n <text x=\"280\" y=\"161\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"11\" font-weight=\"400\">读取字段证据</text>\n </g>\n <g>\n <polygon points=\"448.0,92 504,148.0 448.0,204 392,148.0\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.25\"/>\n <text x=\"448\" y=\"138\" text-anchor=\"middle\" fill=\"#0d0d0d\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"12.5\" font-weight=\"600\">判断依据</text>\n <text x=\"448\" y=\"159\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"10.2\" font-weight=\"400\">检查住宿城市、申</text>\n <text x=\"448\" y=\"174\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"10.2\" font-weight=\"400\">报地点、行程城…</text>\n </g>\n <g>\n <rect x=\"562\" y=\"74\" width=\"126\" height=\"60\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.2\"/>\n <rect x=\"562\" y=\"74\" width=\"3.5\" height=\"60\" rx=\"1.75\" ry=\"1.75\" fill=\"#cbd5e1\"/>\n <text x=\"625\" y=\"98\" text-anchor=\"middle\" fill=\"#0d0d0d\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"13\" font-weight=\"600\">继续流转</text>\n <text x=\"625\" y=\"117\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"11\" font-weight=\"400\">继续流转</text>\n </g>\n <g>\n <rect x=\"562\" y=\"190\" width=\"126\" height=\"62\" rx=\"7\" ry=\"7\" fill=\"#fff7ed\" stroke=\"#fed7aa\" stroke-width=\"1.2\"/>\n <rect x=\"562\" y=\"190\" width=\"3.5\" height=\"62\" rx=\"1.75\" ry=\"1.75\" fill=\"#f97316\"/>\n <text x=\"625\" y=\"214\" text-anchor=\"middle\" fill=\"#0d0d0d\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"13\" font-weight=\"600\">进入复核</text>\n <text x=\"625\" y=\"233\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"11\" font-weight=\"400\">提示风险</text>\n </g>\n <g>\n <rect x=\"214\" y=\"218\" width=\"290\" height=\"36\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1\" stroke-dasharray=\"4,3\"/>\n <text x=\"226\" y=\"240\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"10\" font-weight=\"500\">BASIS</text>\n <text x=\"268\" y=\"240\" text-anchor=\"start\" fill=\"#0d0d0d\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"10.2\" font-weight=\"400\">检查住宿城市、申报地点、行程城市是否满足必…</text>\n </g>\n <line x1=\"172\" y1=\"148\" x2=\"214\" y2=\"148\" stroke=\"#cbd5e1\" stroke-width=\"1.45\" marker-end=\"url(#arrow-neutral)\"/>\n <line x1=\"346\" y1=\"148\" x2=\"392\" y2=\"148\" stroke=\"#cbd5e1\" stroke-width=\"1.45\" marker-end=\"url(#arrow-neutral)\"/>\n <path d=\"M 504 127 L 532 127 L 532 104 L 562 104\" fill=\"none\" stroke=\"#cbd5e1\" stroke-width=\"1.35\" marker-end=\"url(#arrow-neutral)\"/>\n <text x=\"534\" y=\"119\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"10.5\" font-weight=\"400\">否</text>\n <path d=\"M 504 169 L 532 169 L 532 221 L 562 221\" fill=\"none\" stroke=\"#cbd5e1\" stroke-width=\"1.8\" marker-end=\"url(#arrow-neutral)\"/>\n <text x=\"534\" y=\"195\" text-anchor=\"middle\" fill=\"#6e6e80\" font-family=\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica Neue, 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'SimHei', sans-serif\" font-size=\"10.5\" font-weight=\"600\">是</text>\n</svg>",
|
|
"severity": "medium"
|
|
}
|