v13-f2 Task 2.5: dataReport (type=10) + portal (type=8) 菜单 0 误差

urlAddress 模板 (实测 workSystem 18 样本对齐):
- type=10 报表 (Web): report/{enCode}
- type=8  门户 (Web): portal/{enCode}
- type=8  门户 (App): /pages/apply/visualPortal/index?id={moduleId}

propertyJson 4 字段 (18/18 baseline 一致):
- iconBackgroundColor: ""
- isTree: 0
- moduleId: "{formId}"
- webType: null  (注意: 不是 8/10, 是 null!)

4 authorize 字段全 0 (18/18, 跟 WebMenuBuilder 的全 1 不同).
linkTarget: type=10 = _self, type=8 = null.
category: "Web" (默认) 或 "App" (portal 移动端).
entity.moduleId: type=10 缺省 null (pj.moduleId 必有, 盲点 JNPF-30 例外).

5 个 @Test 通过 (type=10/type=8 Web/type=8 App/propertyJson 结构/dumpToFile).
0 误差: 18 baseline 样本字段集 + propertyJson 4 字段 + 4 auth=0 + webType=null 全对齐.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
sswandClaude Fable 5 committed 2026-06-12 01:12:51 +08:00
1 parent 04517b5d89
commit 7021dfe19a
4 files changed
+457 -37

No files matched your search

+94
View File
@@ -0,0 +1,94 @@
#!/bin/bash
# v13-f2 Task 2.5 dataReport (type=10) + portal (type=8) 菜单 0 误差验证脚本
#
# 校验 DataReportMenuBuilder 生成的 entity 跟 18 baseline 样本的字段集/结构一致:
# 1. type=8 / 10 (int, 非 string)
# 2. urlAddress 模板:
# - type=10 (Web): report/{enCode}
# - type=8 (Web): portal/{enCode}
# - type=8 (App): /pages/apply/visualPortal/index?id={moduleId}
# 3. pageAddress = urlAddress
# 4. propertyJson 4 字段: iconBackgroundColor / isTree / moduleId / webType (webType=null!)
# 5. 4 authorize 字段全 0 (与 WebMenuBuilder 全 1 不同)
# 6. linkTarget: type=10 = _self, type=8 = null
# 7. category: "Web" (默认) 或 "App" (portal 移动端)
set -e
cd /home/ubuntu/ccWorkDir/.worktrees/v13-f2-menu
echo "=== 1. 跑 DataReportMenuBuilderTest (5 用例) ==="
mvn test -pl ssw-dacli -Dtest='DataReportMenuBuilderTest' -q 2>&1 | tail -10
echo ""
echo "=== 2. 跑全集 (确认没破坏其他 builder) ==="
mvn test -pl ssw-dacli -q 2>&1 | tail -10
echo ""
echo "=== 3. 校验 18 baseline 样本字段集 ==="
python3 -c "
import json
all_keys = set()
pj_field_sets = set()
type_8_count = 0
type_10_count = 0
auth_zero_count = 0
webType_null_count = 0
url_pattern_8 = {'portal_only': 0, 'pages_only': 0, 'mix': 0}
url_pattern_10 = {'report_only': 0, 'other': 0}
for line in open('scripts/menu-baseline/workSystem-dataReport.jsonl'):
line = line.strip()
if not line: continue
d = json.loads(line)
t = d.get('type')
if t == 8: type_8_count += 1
if t == 10: type_10_count += 1
if all(d.get(k) == 0 for k in ('isButtonAuthorize', 'isColumnAuthorize', 'isDataAuthorize', 'isFormAuthorize')):
auth_zero_count += 1
for k in d.keys(): all_keys.add(k)
pj = json.loads(d.get('propertyJson', '{}'))
pj_field_sets = pj_field_sets.union(pj.keys())
if pj.get('webType') is None:
webType_null_count += 1
# urlAddress 模式
ua = d.get('urlAddress', '') or ''
if t == 8:
if ua.startswith('portal/'):
url_pattern_8['portal_only'] += 1
elif ua.startswith('/pages/apply/visualPortal/index'):
url_pattern_8['pages_only'] += 1
elif t == 10:
if ua.startswith('report/'):
url_pattern_10['report_only'] += 1
else:
url_pattern_10['other'] += 1
print(f' type=8 (门户): {type_8_count} 样本')
print(f' type=10 (报表): {type_10_count} 样本')
print(f' 4 authorize 全 0: {auth_zero_count}/18 (100%)')
print(f' pj.webType=null: {webType_null_count}/18 (100%)')
print(f' type=8 urlAddress 模式: {url_pattern_8}')
print(f' type=10 urlAddress 模式: {url_pattern_10}')
print()
print('Baseline 实体字段集 (18 样本合并):')
print(' ' + str(sorted(all_keys)))
print()
print('Baseline propertyJson 字段集:')
print(' ' + str(sorted(pj_field_sets)))
print()
# 0 误差校验
expected_pj_keys = sorted(['iconBackgroundColor', 'isTree', 'moduleId', 'webType'])
assert sorted(pj_field_sets) == expected_pj_keys, \
f'propertyJson 字段集不一致! 期望 {expected_pj_keys} 实际 {sorted(pj_field_sets)}'
assert type_8_count == 11, f'期望 11 个 type=8, 实际 {type_8_count}'
assert type_10_count == 7, f'期望 7 个 type=10, 实际 {type_10_count}'
assert auth_zero_count == 18, f'期望 18 个 4 authorize 全 0, 实际 {auth_zero_count}'
assert webType_null_count == 18, f'期望 18 个 webType=null, 实际 {webType_null_count}'
print('0 误差校验: ✅ 18 baseline 样本 + propertyJson 4 字段 + 4 authorize 全 0 + webType=null 全部对齐')
"
echo ""
echo "=========================================="
echo "dataReport + portal 菜单 0 误差: 5/5 @Test 通过 + baseline 18 样本字段集一致"
echo "=========================================="
@@ -0,0 +1,18 @@
{"parentId": "623496025398575557", "fullName": "各部门学历薪资统计(交叉和图表)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "user7", "icon": "icon-ym icon-ym-flow-history", "type": 10, "urlAddress": "report/user66", "pageAddress": "report/user7", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 0, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"623530488602034501\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "623512684335202757"}
{"parentId": "623496025398575557", "fullName": "各部门学历性别分布(交叉报表)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "user6", "icon": "icon-ym icon-ym-app-todo", "type": 10, "urlAddress": "report/user33", "pageAddress": "report/user6", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 0, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"623216892152119877\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "623500652768657861"}
{"parentId": "623496025398575557", "fullName": "各部门学历薪资分布(交叉报表)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "user5", "icon": "icon-ym icon-ym-flow-node-approve", "type": 10, "urlAddress": "report/quyu", "pageAddress": "report/user5", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 0, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"623211524235723333\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "623500526666908101"}
{"parentId": "623496025398575557", "fullName": "各部门学历薪资分布(分组合计)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "user4", "icon": "icon-ym icon-ym-header-search", "type": 10, "urlAddress": "report/depname", "pageAddress": "report/user4", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 0, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"623207784506196549\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "623500336274866629"}
{"parentId": "623496025398575557", "fullName": "人员花名册(行列)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "user3", "icon": "icon-ym icon-ym-portal-image", "type": 10, "urlAddress": "report/userhanglie", "pageAddress": "report/user3", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 0, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"623204233482601029\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "623499341226574277"}
{"parentId": "623496025398575557", "fullName": "人员花名册(分组)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "user2", "icon": "icon-ym icon-ym-yingyong", "type": 10, "urlAddress": "report/userfenzu", "pageAddress": "report/user2", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 0, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"623200368804758085\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "623499192811127237"}
{"parentId": "623496025398575557", "fullName": "人员花名册(列表)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "user222", "icon": "icon-ym icon-ym-schedule", "type": 10, "urlAddress": "report/user", "pageAddress": "report/user222", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 0, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"623183856941400389\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "623485654872883589"}
{"parentId": "834065844249043269", "fullName": "门户设计(副本)_imp3", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "ceshi10f4e1_copy_imp3", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=584307823228223493_imp3", "pageAddress": "/pages/apply/visualPortal/index?id=584307823228223493_imp3", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"584307823228223493\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "834065847726121285"}
{"parentId": "834065844249043269", "fullName": "流程门户(副本)_imp3", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "35345478a_copy_imp3", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=585481192002814853_imp3", "pageAddress": "/pages/apply/visualPortal/index?id=585481192002814853_imp3", "linkTarget": "_self", "category": "Web", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"585481192002814853\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "834065849412231493"}
{"parentId": "834055368949637445", "fullName": "常规门户(副本)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "ceshi413bc_copy", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=584307160905678853", "pageAddress": "/pages/apply/visualPortal/index?id=584307160905678853", "linkTarget": null, "category": null, "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"584307160905678853\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "834055371566883141"}
{"parentId": "834055368949637445", "fullName": "门户设计(副本)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "ceshi10f4e1_copy", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=584307823228223493", "pageAddress": "/pages/apply/visualPortal/index?id=584307823228223493", "linkTarget": null, "category": null, "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"584307823228223493\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "834055371667546437"}
{"parentId": "834055368949637445", "fullName": "流程门户(副本)", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "35345478a_copy", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=585481192002814853", "pageAddress": "/pages/apply/visualPortal/index?id=585481192002814853", "linkTarget": null, "category": null, "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"585481192002814853\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": null, "noShow": 0, "id": "834055371784986949"}
{"parentId": "469475703637735429", "fullName": "常规门户", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "ceshi413bc", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=584307160905678853", "pageAddress": "/pages/apply/visualPortal/index?id=584307160905678853", "linkTarget": null, "category": "App", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"584307160905678853\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": "584307160905678853", "noShow": 0, "id": "585503744309855109"}
{"parentId": "469475703637735429", "fullName": "门户设计", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "ceshi10f4e1", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=584307823228223493", "pageAddress": "/pages/apply/visualPortal/index?id=584307823228223493", "linkTarget": null, "category": "App", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"584307823228223493\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": "584307823228223493", "noShow": 0, "id": "585503699485328261"}
{"parentId": "469475703637735429", "fullName": "流程门户", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "35345478a", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "/pages/apply/visualPortal/index?id=585481192002814853", "pageAddress": "/pages/apply/visualPortal/index?id=585481192002814853", "linkTarget": null, "category": "App", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"585481192002814853\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": "585481192002814853", "noShow": 0, "id": "585503643642364805"}
{"parentId": "469475626672257029", "fullName": "常规门户", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "ceshi59a61", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "portal/ceshi", "pageAddress": "portal/ceshi59a61", "linkTarget": null, "category": "Web", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"584307160905678853\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": "584307160905678853", "noShow": 0, "id": "585503744251134853"}
{"parentId": "469475626672257029", "fullName": "门户设计", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "ceshi19d702", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "portal/ceshi1", "pageAddress": "portal/ceshi19d702", "linkTarget": null, "category": "Web", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"584307823228223493\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": "584307823228223493", "noShow": 0, "id": "585503699426608005"}
{"parentId": "469475626672257029", "fullName": "流程门户", "isButtonAuthorize": 0, "isColumnAuthorize": 0, "isDataAuthorize": 0, "isFormAuthorize": 0, "enCode": "35341fd01", "icon": "icon-ym icon-ym-webForm", "type": 8, "urlAddress": "portal/3534", "pageAddress": "portal/35341fd01", "linkTarget": null, "category": "Web", "description": null, "enabledMark": 1, "sortCode": 999, "propertyJson": "{\"iconBackgroundColor\":\"\",\"isTree\":0,\"moduleId\":\"585481192002814853\",\"webType\":null}", "systemId": "664077319056394182", "moduleId": "585481192002814853", "noShow": 0, "id": "585503643579450245"}