统一:DSH 智能分析、Top100 与图表静默恢复

接入 DSH 专用运行时和对话界面,保留模型原始回答,支持会话分页、连续追问与显式报告。
补齐组合筛选、各维度 Top100、分组查询到排名图的转换,图表故障静默省略并基于保存数据自动恢复。
优化报告风格、图表顺序和表格换行,更新接入说明及构建输入。

验证:独立目录前后端构建通过;118 项 Java、102 项前端、102 项图表、14 项 DSH 应用和 13 项组合筛选检查通过。
仅提交相关源码、锁定依赖与测试;不包含凭据、会话、业务数据或本地产物。
This commit is contained in:
2026-11-12 11:57:41 +08:00
parent cc8832c8e5
commit f1a2fbd494
166 changed files with 26281 additions and 2248 deletions
+30
View File
@@ -71,6 +71,36 @@ class NativeStructureTests(unittest.TestCase):
self.assertIn('规格'+name,location['inheritedText'])
self.assertEqual(sum('规格'+other in location['inheritedText'] for other in '甲乙丙'),1)
def test_closed_annotation_siblings_do_not_leak_subjects_even_when_values_match(self):
tokens={'N1':{'ownerScope':{'group':'合成组织甲'}},
'N2':{'ownerScope':{'group':'合成组织乙'}}}
context={'_agentTask':{'period':{'year':2026,'month':9},'filters':{}},
'_nativeScopeCatalog':[{'group':'合成组织甲'},{'group':'合成组织乙'}]}
for second_rate in ('-0.28','-0.29'):
text=('合成组织甲(率降-0.28pp,报废增量+12kg)和'
f'合成组织乙(率降{second_rate}pp,报废增量+13kg)。')
for span in (second_rate,'+13'):
start=text.rindex(span)
location=native_span_structure(text).locate(start,start+len(span))
with self.subTest(second_rate=second_rate,span=span):
self.assertIn('合成组织乙',location['inheritedText'])
self.assertNotIn('合成组织甲',location['inheritedText'])
slots=_native_span_slots(text,start,start+len(span),context,tokens,
'pp' if span.startswith('-') else 'kg',location)
self.assertFalse(slots['scopeConflict'],slots)
self.assertEqual(slots['scope'].get('group'),'合成组织乙')
nested='范围:父部门(合成组织乙(率降-0.28pp))'
start=nested.index('-0.28')
location=native_span_structure(nested).locate(start,start+5)
nested_context={'_agentTask':{'period':{'year':2026,'month':9},
'filters':{'department':'父部门'}},
'_nativeScopeCatalog':[{'department':'父部门','group':'合成组织乙'}]}
nested_tokens={'N1':{'ownerScope':{'department':'父部门','group':'合成组织乙'}}}
slots=_native_span_slots(nested,start,start+5,nested_context,nested_tokens,'pp',location)
self.assertFalse(slots['scopeConflict'],slots)
self.assertEqual(slots['scope'],{'department':'父部门','group':'合成组织乙'})
def test_versions_and_explicit_ancestors_are_separate(self):
blocks=[{'sourceId':'D1','text':'## 产业部:部门甲\n\n分组比较:'},
{'sourceId':'D2','text':'| 分组 | 本期 |\n|---|---|\n| 分组乙 | 10 |'}]