From 05f7cd2be5bc482e168a0f71cc851de31aa10367 Mon Sep 17 00:00:00 2001 From: xiaoxue_admin <9283713@qq.com> Date: Tue, 23 Jun 2026 01:15:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=91=E7=9B=AE=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=A0=87=E5=87=86=E6=98=A0=E5=B0=84=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 投票归一化:同一代码取最高频名称 2. 标准映射覆盖:用用户提供的对照表覆盖已知代码名称 - 修正了9个代码的提取错误(共73处) - 2203.01: 预收账款→物业管理费 - 1012.01: POS刷卡→POS刷卡未到账 - 6051.02: POS刷卡→办证工本收入 - 6401.51.09: 淇县支行→日常维修费 等 --- core/excel_writer.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/core/excel_writer.py b/core/excel_writer.py index c85d797..ce53905 100644 --- a/core/excel_writer.py +++ b/core/excel_writer.py @@ -229,6 +229,29 @@ def merge_output(results, template_path, output_dir, review=False): if fixed_count > 0: print(f' 🔄 科目名称归一化:修正 {fixed_count} 处不一致') + # ---- 标准映射覆盖:用户提供的正确对照表 ---- # + STANDARD_NAMES = { + '1002.01.01': '淇县支行1710020809200182975', + '1002.02.01': '漓江支行4105016228400000750', + '1012.01': 'POS刷卡未到账', + '2203.01': '物业管理费', + '2241.01.01': '装修押金', + '6051.02': '办证工本收入', + '6051.08': '转售水电费收入', + '6401.02.02': '办公费', + '6401.51.09': '日常维修费', + } + override_count = 0 + for row_data in all_entries: + code = str(row_data[5]) if len(row_data) > 5 else '' + if code in STANDARD_NAMES and len(row_data) > 6: + correct_name = STANDARD_NAMES[code] + if str(row_data[6]) != correct_name: + row_data[6] = correct_name + override_count += 1 + if override_count > 0: + print(f' 📋 标准映射覆盖:修正 {override_count} 处') + out_wb = xlwt.Workbook(encoding='utf-8') out_ws = out_wb.add_sheet('t_Schema', cell_overwrite_ok=True) for r in range(schema_sheet.nrows):