Commit e7fb2a8c authored by Data Governance Dev's avatar Data Governance Dev

refactor(web): 收敛分析项 UI 至 3 组(hide/merge/rename 6 轮)

UI 从 7 组 / 30+ step 收敛到 3 组 / 15 step;隐藏 27 个 indicator。

合并 / 改名为独立 IND 号(移入 standards 组):
- IND-401 / IND-402 → std_ind_401(姓名校验,2 子检查合一)
- IND-006-b → std_ind_006(邮政编码)
- IND-013-a / -b / -c → std_ind_017 / -018 / -019
  (单位类别 GB/T 12402 / 经济类型 国统字〔2011〕86 号 / 行业代码 GB/T 4754)

隐藏 27 个 indicator(_HIDDEN_SUBS,暂离 UI,按需恢复):
- IND-016-a / -101 / -201..-204 / -301 / -302 / -501 / -502
- IND-601..-603 / -901 / -902
- IND-006-a / -008-a..-011-a(其他业务字段整组下架)
- IND-013-a..-c(已改名)
- IND-012-a / -014-a / -014-b / -015-a(单位法人经办人整组下架)

整组下架(5 个 group):
- 单位对公账户 字段规范
- 民政信息
- 证件信息
- 其他业务字段
- 单位 / 法人 / 经办人 字段规范

新增 / 重命名 group:
- 业务字段规范(含 std_ind_401 姓名 + std_ind_007_a 公积金账号)

后端改动:
- 抽 _run_standards_ind_renamed(source_id, target_step_id, target_title) 工厂
  合并 IND-005/006/013 的改名逻辑
- _run_standards_combined factory 处理 std_ind_401 合并子检查
- _IND_COMBINED['ind_401'] 配置(IND-401/IND-402 字符集 + 长度合一)
- _MERGED_SUBS / _HIDDEN_SUBS / mapped_step 同步更新

前端 / 配置:
- analysis_tree.json: 7 组 → 3 组;description / default_expand 同步精简
- routes.py /api/match-config: _COMBINED_GROUPS 聚合 + IND-005/006/013 改名映射

docs(WORKLOG): 6 轮完整记录 + 踩坑(log 闭包 bug 修复、sub_prefix 对无后缀 ID 的适配等)

UI 顺序:基础检查 → 国标字段规范(10 step)→ 业务字段规范(2 step)
parent a72a2ec1
This diff is collapsed.
......@@ -272,6 +272,7 @@ async def get_match_config():
("std_ind_002", ("IND-002-a", "IND-002-b", "IND-002-c")),
("std_ind_003", ("IND-003-a", "IND-003-b")),
("std_ind_004", ("IND-004-a", "IND-004-b")),
("std_ind_401", ("IND-401", "IND-402")),
)
for combined_step_id, sub_ids in _COMBINED_GROUPS:
agg_names: list[str] = []
......@@ -304,6 +305,35 @@ async def get_match_config():
"skip": False,
}
# ── IND-006-b 不再带 -b 后缀:YAML key 仍叫 IND-006-b,UI step_id 改为 std_ind_006 ──
# 2026-08-13:IND-006-b(邮政编码)从「业务字段规范」移入「国标字段规范」组,
# step_id 与 IND-005 同样去掉后缀。
ind006_rec = step7.get("IND-006-b") or {}
ind006_atf = ind006_rec.get("applies_to_fields") or []
ind006_cmk = ind006_rec.get("comment_keywords") or []
by_step["std_ind_006"] = {
"names": ", ".join(ind006_atf),
"comments": ", ".join(ind006_cmk),
"skip": False,
}
# ── IND-013 的 3 个子检查改成新 IND 号:YAML key 仍叫 IND-013-a/b/c,UI step_id 改为 std_ind_017/018/019 ──
# 2026-08-13:原 IND-013-a/b/c(单位类型 / 经济类型 / 行业代码)从「单位/法人/经办人 字段规范」
# 移入「国标字段规范」组,step_id 各自分到 017/018/019(与 IND-005/006 同样去掉后缀)。
for src_id, target_step_id in (
("IND-013-a", "std_ind_017"),
("IND-013-b", "std_ind_018"),
("IND-013-c", "std_ind_019"),
):
rec = step7.get(src_id) or {}
atf = rec.get("applies_to_fields") or []
cmk = rec.get("comment_keywords") or []
by_step[target_step_id] = {
"names": ", ".join(atf),
"comments": ", ".join(cmk),
"skip": False,
}
# ── 其余 step(merge / empty / missing_comments 等)无需输入框 ──
# 前端按 step_id 找不到时按 skip=True 处理即可
......
......@@ -15,94 +15,29 @@
{
"key": "standards",
"title": "国标字段规范",
"description": "IND-001 ~ IND-005 系列:按 GB / GA 标准做字段值级别合规校验。IND-001(身份证)/ IND-002(USCC)/ IND-003(手机号)/ IND-004(行政区划)多子检查已合并为单 step;IND-005(固定电话)单 sub。包含格式 / 校验位 / 出生日期 / 15 位兼容 / 号段 / 编码存在性 / 老代码兼容",
"description": "IND-001 ~ IND-019 系列:按 GB / GA / 央行 / 国统字 / ISO 标准做字段值级别合规校验(格式 / 校验位 / 出生日期 / 号段 / 编码存在性 / 邮编 / 银行账号 Luhn / 单位类型 / 经济类型 / 行业代码 等)",
"default_expand": true,
"children": [
{ "step_id": "std_ind_001" },
{ "step_id": "std_ind_002" },
{ "step_id": "std_ind_003" },
{ "step_id": "std_ind_004" },
{ "step_id": "std_ind_005" }
]
},
{
"key": "id_info",
"title": "证件信息",
"description": "IND-101 ~ IND-204:证件类型枚举 + 4 种证件号码(身份证 / 护照 / 港澳台居住证 / 外国人永居)",
"default_expand": false,
"children": [
{ "step_id": "std_ind_101" },
{ "step_id": "std_ind_201" },
{ "step_id": "std_ind_202" },
{ "step_id": "std_ind_203" },
{ "step_id": "std_ind_204" }
]
},
{
"key": "identity",
"title": "身份信息",
"description": "IND-301 ~ IND-502:证件类型+号码一致性 / 跨表唯一性 / 姓名 / 出生日期",
"default_expand": false,
"children": [
{ "step_id": "std_ind_301" },
{ "step_id": "std_ind_302" },
{ "step_id": "std_ind_401" },
{ "step_id": "std_ind_402" },
{ "step_id": "std_ind_501" },
{ "step_id": "std_ind_502" }
]
},
{
"key": "civil",
"title": "民政信息",
"description": "IND-601 ~ IND-603:行政区划代码 / 民族代码 / 婚姻状况代码",
"default_expand": false,
"children": [
{ "step_id": "std_ind_601" },
{ "step_id": "std_ind_602" },
{ "step_id": "std_ind_603" }
{ "step_id": "std_ind_005" },
{ "step_id": "std_ind_006" },
{ "step_id": "std_ind_016_b" },
{ "step_id": "std_ind_017" },
{ "step_id": "std_ind_018" },
{ "step_id": "std_ind_019" }
]
},
{
"key": "business",
"key": "business_main",
"title": "业务字段规范",
"description": "IND-006 ~ IND-011 系列:业务特定字段(通讯地址 / 邮编 / 个人公积金账号 / 首次参加工作年月 / 用工类型 / 本地户籍 / 职工状态);字段匹配走注释",
"description": "IND-401 / IND-007-a:核心业务字段(姓名 / 个人公积金账号)",
"default_expand": true,
"children": [
{ "step_id": "std_ind_006_a" },
{ "step_id": "std_ind_006_b" },
{ "step_id": "std_ind_007_a" },
{ "step_id": "std_ind_008_a" },
{ "step_id": "std_ind_009_a" },
{ "step_id": "std_ind_010_a" },
{ "step_id": "std_ind_011_a" }
]
},
{
"key": "business_unit",
"title": "单位 / 法人 / 经办人 字段规范",
"description": "IND-012 ~ IND-015 系列:单位基本信息(名称 / 类型 / 经济类型 / 行业代码 / 设立日期 / 启缴年月 / 发薪日);字段匹配走字段名 + 注释",
"default_expand": true,
"children": [
{ "step_id": "std_ind_012_a" },
{ "step_id": "std_ind_013_a" },
{ "step_id": "std_ind_013_b" },
{ "step_id": "std_ind_013_c" },
{ "step_id": "std_ind_014_a" },
{ "step_id": "std_ind_014_b" },
{ "step_id": "std_ind_015_a" }
]
},
{
"key": "business_unit_bank",
"title": "单位对公账户 字段规范",
"description": "IND-016 系列 + IND-901/902:开户银行行号 / 银行账号 格式 + 单位名跨表唯一性 + 账户名一致性(跨字段)",
"default_expand": true,
"children": [
{ "step_id": "std_ind_016_a" },
{ "step_id": "std_ind_016_b" },
{ "step_id": "std_ind_901" },
{ "step_id": "std_ind_902" }
{ "step_id": "std_ind_401" },
{ "step_id": "std_ind_007_a" }
]
}
]
......
This diff is collapsed.
......@@ -1605,6 +1605,15 @@ _IND_COMBINED: dict[str, dict] = {
"title": "IND-004 · 行政区划代码校验",
"format": "GB/T 2260",
},
"ind_401": {
# 2026-08-13:IND-401 / IND-402 合并。注:这一对没有 -a/-b 后缀,
# 是直接以「姓名」「姓名长度」为 ID 的 2 个独立 indicator。
# sub_prefix 推导仍走得通("IND-401".rsplit("-", 1)[0] + "-" = "IND-"),
# 合并后 error 字段前缀显示 [401] / [402]。
"sub_ids": ("IND-401", "IND-402"),
"title": "IND-401 · 姓名校验",
"format": "字符集(汉字 + 少数民族 · + ASCII 字母)+ 长度 2-20",
},
}
# 旧名保留以兼容 orchestrator 现有 import;新代码请用 _IND_COMBINED["ind_001"]["sub_ids"]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment