|
|
@@ -400,19 +400,8 @@ public class PreDataListener extends AnalysisEventListener<Map<Integer, String>>
|
|
|
int mustSize = headVals.size() - tempHeadVal.size();
|
|
|
// 计算剩余字段的交集
|
|
|
Collection<String> intersection = CollUtil.intersection(tempFields, tempHeadVal);
|
|
|
- int overlap = intersection.size() + mustSize;
|
|
|
- // 部分匹配必须有覆盖率下限:否则「matched 字段只有 2 个」的通用模板
|
|
|
- // 会把整张话单/开户表吞掉(F-01B:导出话单 11 列直中「通信登记信息」模板 3,
|
|
|
- // 9 列数据静默丢失;IND-03 20 列直中 6 列子模板)。覆盖率不足时不下结论,
|
|
|
- // 让 sheet 保持 SHEET_TEMPLATE_MATCHED_FAIL,交给智能清洗的 AI 模板匹配裁决。
|
|
|
- int templateCols = tempFields.size() + tempMatchedFields.size();
|
|
|
- if (!partialMatchCovers(overlap, headVals.size(), templateCols)) {
|
|
|
- log.debug("模板{}部分匹配覆盖率不足(重叠 {},文件 {} 列,模板 {} 列),交由 AI 判定",
|
|
|
- templateId, overlap, headVals.size(), templateCols);
|
|
|
- continue;
|
|
|
- }
|
|
|
// 记录模板 ID 和匹配度(交集数量 + 必填字段数量)
|
|
|
- matchTemplateMap.put(templateId, overlap);
|
|
|
+ matchTemplateMap.put(templateId, intersection.size() + mustSize);
|
|
|
}
|
|
|
}
|
|
|
}
|