后端新增预算本体解析模块和风险规则评分回填服务,优化规则 生成本体对齐和提示词构建,增强费用类型关键词和本体验证, 完善报销查询和审计接口,前端预算中心页面增加对话框和本 体工具函数,重构审计页面元数据和视图模型,补充单元测试。
180 lines
15 KiB
JSON
180 lines
15 KiB
JSON
{
|
|
"schema_version": "2.0",
|
|
"rule_code": "risk.expense.travel.generated_20260526101531166364",
|
|
"name": "住宿日期与差旅行程不匹配",
|
|
"description": "当差旅费业务满足“差旅住宿报销时,先确认已上传住宿发票或酒店水单;再读取报销事由、申报目的地、住宿城市、开票日期和行程城市。若住宿票据显示的城市不在本次差旅行程范围内,或住宿发生时间明显早于出差开始、晚于出差结束,且没有延期、改签、临时任务等说明,则标记为高风险,要求补充住宿原因、行程证明或重新提交票据。”时,系统会按高风险进行提示,并要求经办人或审核人补充核对依据。",
|
|
"enabled": true,
|
|
"requires_attachment": false,
|
|
"risk_dimension": "natural_language_rule",
|
|
"risk_category": "差旅费",
|
|
"ontology_signal": "natural_language_risk",
|
|
"evaluator": "template_rule",
|
|
"template_key": "field_required_v1",
|
|
"semantic_type": null,
|
|
"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": "high",
|
|
"action": "manual_review",
|
|
"risk_score": 77
|
|
}
|
|
},
|
|
"metadata": {
|
|
"owner": "admin",
|
|
"stability": "generated_draft",
|
|
"source_ref": "自然语言风险规则",
|
|
"created_at": "2026-05-26T10:15:31.166364+08:00",
|
|
"created_by": "admin",
|
|
"requires_attachment": false,
|
|
"risk_score": 77,
|
|
"risk_level": "high",
|
|
"risk_level_label": "高风险",
|
|
"risk_score_model": "risk_score_v3",
|
|
"risk_score_detail": {
|
|
"score": 77,
|
|
"level": "high",
|
|
"level_label": "高风险",
|
|
"model": "risk_score_v3",
|
|
"weights": {
|
|
"impact": 0.35,
|
|
"certainty": 0.25,
|
|
"evidence": 0.15,
|
|
"exception": 0.1,
|
|
"action": 0.1,
|
|
"sensitivity": 0.05
|
|
},
|
|
"components": {
|
|
"impact": 78,
|
|
"certainty": 86,
|
|
"evidence": 82,
|
|
"exception": 35,
|
|
"action": 78,
|
|
"sensitivity": 88
|
|
},
|
|
"calibration": {
|
|
"raw_score": 77,
|
|
"rules": []
|
|
},
|
|
"ai_evidence": {},
|
|
"basis": {
|
|
"template_key": "field_required_v1",
|
|
"field_count": 4,
|
|
"condition_count": 0,
|
|
"expense_category": "travel",
|
|
"expense_category_label": "差旅费",
|
|
"requires_attachment": false
|
|
}
|
|
},
|
|
"rule_title": "住宿日期与差旅行程不匹配",
|
|
"expense_category": "travel",
|
|
"expense_category_label": "差旅费",
|
|
"natural_language": "差旅住宿报销时,先确认已上传住宿发票或酒店水单;再读取报销事由、申报目的地、住宿城市、开票日期和行程城市。若住宿票据显示的城市不在本次差旅行程范围内,或住宿发生时间明显早于出差开始、晚于出差结束,且没有延期、改签、临时任务等说明,则标记为高风险,要求补充住宿原因、行程证明或重新提交票据。",
|
|
"business_explanation": "当差旅费业务满足“差旅住宿报销时,先确认已上传住宿发票或酒店水单;再读取报销事由、申报目的地、住宿城市、开票日期和行程城市。若住宿票据显示的城市不在本次差旅行程范围内,或住宿发生时间明显早于出差开始、晚于出差结束,且没有延期、改签、临时任务等说明,则标记为高风险,要求补充住宿原因、行程证明或重新提交票据。”时,系统会按高风险进行提示,并要求经办人或审核人补充核对依据。",
|
|
"condition_summary": "检查住宿城市、申报地点、行程城市是否满足必填和完整性要求",
|
|
"rule_ir": {},
|
|
"flow": {
|
|
"start": "差旅费单据提交",
|
|
"evidence": "读取住宿城市、申报地点、行程城市",
|
|
"decision": "检查住宿城市、申报地点、行程城市是否满足必填和完整性要求",
|
|
"pass": "未命中风险,继续业务流转",
|
|
"fail": "命中高风险,提示复核"
|
|
}
|
|
},
|
|
"flow_diagram_svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"860\" height=\"360\" viewBox=\"0 0 860 360\" data-risk-flow-style=\"review-node-only\" data-risk-flow-detail=\"logic-v2\" 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 <marker id=\"arrow-risk\" markerWidth=\"10\" markerHeight=\"7\" refX=\"9\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"#dc2626\"/>\n </marker>\n </defs>\n <rect width=\"860\" height=\"360\" fill=\"#ffffff\"/>\n <rect x=\"18\" y=\"18\" width=\"824\" height=\"324\" 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=\"38\" y=\"142\" width=\"120\" height=\"62\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.2\"/>\n <rect x=\"38\" y=\"142\" width=\"3.5\" height=\"62\" rx=\"1.75\" ry=\"1.75\" fill=\"#cbd5e1\"/>\n <text x=\"98\" y=\"166\" 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=\"98\" y=\"185\" 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=\"196\" y=\"64\" width=\"240\" height=\"128\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.2\"/>\n <text x=\"212\" y=\"90\" 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=\"650\">字段事实</text>\n <text x=\"212\" y=\"112\" fill=\"#0d0d0d\" 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\">A=住宿城市[attachment.hotel_city]</text>\n <text x=\"212\" y=\"130\" fill=\"#0d0d0d\" 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\">B=申报地点[claim.location]</text>\n <text x=\"212\" y=\"148\" fill=\"#0d0d0d\" 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\">C=行程城市[attachment.route_cities]</text>\n <text x=\"212\" y=\"166\" fill=\"#0d0d0d\" 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\">D=报销事由[claim.reason]</text>\n </g>\n <g>\n <rect x=\"196\" y=\"216\" width=\"382\" height=\"104\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.2\"/>\n <text x=\"212\" y=\"242\" 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=\"650\">判断条件</text>\n <text x=\"212\" y=\"264\" fill=\"#0d0d0d\" 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=\"555.0,80 616,141.0 555.0,202 494,141.0\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.25\"/>\n <text x=\"555\" y=\"131\" 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=\"555\" y=\"152\" 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=\"555\" y=\"167\" 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=\"688\" y=\"76\" width=\"122\" height=\"60\" rx=\"7\" ry=\"7\" fill=\"#ffffff\" stroke=\"#e2e8f0\" stroke-width=\"1.2\"/>\n <rect x=\"688\" y=\"76\" width=\"3.5\" height=\"60\" rx=\"1.75\" ry=\"1.75\" fill=\"#cbd5e1\"/>\n <text x=\"749\" y=\"100\" 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=\"749\" 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=\"11\" font-weight=\"400\">未命中风险,继续业…</text>\n </g>\n <g>\n <rect x=\"688\" y=\"226\" width=\"122\" height=\"68\" rx=\"7\" ry=\"7\" fill=\"#fef2f2\" stroke=\"#fecaca\" stroke-width=\"1.2\"/>\n <rect x=\"688\" y=\"226\" width=\"3.5\" height=\"68\" rx=\"1.75\" ry=\"1.75\" fill=\"#dc2626\"/>\n <text x=\"749\" y=\"250\" 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=\"749\" y=\"269\" 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 <path d=\"M 158 173 H 176 V 128 H 196\" fill=\"none\" stroke=\"#cbd5e1\" stroke-width=\"1.45\" stroke-linecap=\"round\" stroke-linejoin=\"round\" marker-end=\"url(#arrow-neutral)\"/>\n <line x1=\"316\" y1=\"192\" x2=\"316\" y2=\"216\" stroke=\"#cbd5e1\" stroke-width=\"1.45\" stroke-linecap=\"round\" marker-end=\"url(#arrow-neutral)\"/>\n <path d=\"M 436 128 H 466 V 141 H 494\" fill=\"none\" stroke=\"#cbd5e1\" stroke-width=\"1.45\" stroke-linecap=\"round\" stroke-linejoin=\"round\" marker-end=\"url(#arrow-neutral)\"/>\n <line x1=\"555\" y1=\"216\" x2=\"555\" y2=\"202\" stroke=\"#cbd5e1\" stroke-width=\"1.35\" stroke-linecap=\"round\" marker-end=\"url(#arrow-neutral)\"/>\n <path d=\"M 616 125 H 648 V 106 H 688\" fill=\"none\" stroke=\"#cbd5e1\" stroke-width=\"1.35\" stroke-linecap=\"round\" stroke-linejoin=\"round\" marker-end=\"url(#arrow-neutral)\"/>\n <text x=\"651\" 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=\"500\">否</text>\n <path d=\"M 616 166 H 648 V 260 H 688\" fill=\"none\" stroke=\"#dc2626\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" marker-end=\"url(#arrow-risk)\"/>\n <text x=\"651\" y=\"214\" text-anchor=\"middle\" fill=\"#b91c1c\" 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=\"700\">是</text>\n</svg>",
|
|
"severity": "high",
|
|
"risk_score": 77,
|
|
"risk_level": "high",
|
|
"risk_level_label": "高风险",
|
|
"risk_score_detail": {
|
|
"score": 77,
|
|
"level": "high",
|
|
"level_label": "高风险",
|
|
"model": "risk_score_v3",
|
|
"weights": {
|
|
"impact": 0.35,
|
|
"certainty": 0.25,
|
|
"evidence": 0.15,
|
|
"exception": 0.1,
|
|
"action": 0.1,
|
|
"sensitivity": 0.05
|
|
},
|
|
"components": {
|
|
"impact": 78,
|
|
"certainty": 86,
|
|
"evidence": 82,
|
|
"exception": 35,
|
|
"action": 78,
|
|
"sensitivity": 88
|
|
},
|
|
"calibration": {
|
|
"raw_score": 77,
|
|
"rules": []
|
|
},
|
|
"ai_evidence": {},
|
|
"basis": {
|
|
"template_key": "field_required_v1",
|
|
"field_count": 4,
|
|
"condition_count": 0,
|
|
"expense_category": "travel",
|
|
"expense_category_label": "差旅费",
|
|
"requires_attachment": false
|
|
}
|
|
}
|
|
}
|