From 2d5ff46caa0c44b971589368ea06378b87a543a7 Mon Sep 17 00:00:00 2001 From: liubiren Date: Sun, 28 Dec 2025 01:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8=E6=9B=B4=E6=96=B0=20from=20m?= =?UTF-8?q?ac=20mini(intel)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 票据理赔自动化/main.py | 23 +++++++++++++++++++---- 票据理赔自动化/rules/拒付.json | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/票据理赔自动化/main.py b/票据理赔自动化/main.py index c7ce43a..0c6cd11 100644 --- a/票据理赔自动化/main.py +++ b/票据理赔自动化/main.py @@ -198,7 +198,7 @@ if __name__ == "__main__": ] # 将保险起期和保险止期转为日期(datetime对象) raise # TODO: 若根据保险分公司、被保险人、证件类型、证件号码和出险时间查询被保险人发生异常则流转至主数据人工处理 - except Exception: + except: raise # noinspection PyShadowingNames @@ -1499,7 +1499,7 @@ if __name__ == "__main__": } ) - # 基于影像件识别使能规则评估 + # 基于影像件识别使能规则评估影像件是否识别 if not rule_engine.evaluate( decision="影像件识别使能", inputs={ @@ -1540,13 +1540,14 @@ if __name__ == "__main__": "insurer_company": ( insurer_company := "中银保险有限公司苏州分公司" ), # 指定保险分公司 - "report_time": datetime(2025, 7, 25, 12, 0, 0), # 指定报案时间 + "report_time": datetime(2005, 7, 25, 12, 0, 0), # 指定报案时间 "case_number": case_path.stem, # 设定:赔案目录名称为赔案号 }, # 报案层 "images_layer": [], # 影像件层 "insured_person_layer": {}, # 出险人层 "person_policies_layer": [], # 个单层 "receipts_layer": [], # 票据层 + "claim_layer": {}, # 理赔层 } # 遍历赔案目录中影像件 @@ -1591,7 +1592,21 @@ if __name__ == "__main__": # 就票据层按照事故止期和票据号顺序排序 dossier["receipts_layer"].sort(key=lambda x: (x["end_date"], x["number"])) - # 就 + # 根据拒付规则评估结果匹配处理方法 + match result := rule_engine.evaluate(decision="拒付", inputs=dossier): + case _ if result.get("conclusion") == "拒付": + dossier["claim_layer"].update( + { + "conclusion": result["conclusion"], + "explanation": result["explanation"], + } + ) + case _ if result.get("conclusion") == "赔付": + pass + case _: + raise RuntimeError("未匹配到规则") + + print(result) for receipt in dossier["receipts_layer"]: print(receipt) diff --git a/票据理赔自动化/rules/拒付.json b/票据理赔自动化/rules/拒付.json index 3c91532..d4c0ad0 100644 --- a/票据理赔自动化/rules/拒付.json +++ b/票据理赔自动化/rules/拒付.json @@ -164,7 +164,7 @@ { "id": "b2b97b2a-5e59-4c23-a116-7e49e59e65c3", "name": "拒付", - "field": "refuse" + "field": "conclusion" }, { "id": "bd0ca899-7c74-40e4-9b61-1c058ef5e83f",