统一:DSH 智能分析、Top100 与图表静默恢复
接入 DSH 专用运行时和对话界面,保留模型原始回答,支持会话分页、连续追问与显式报告。 补齐组合筛选、各维度 Top100、分组查询到排名图的转换,图表故障静默省略并基于保存数据自动恢复。 优化报告风格、图表顺序和表格换行,更新接入说明及构建输入。 验证:独立目录前后端构建通过;118 项 Java、102 项前端、102 项图表、14 项 DSH 应用和 13 项组合筛选检查通过。 仅提交相关源码、锁定依赖与测试;不包含凭据、会话、业务数据或本地产物。
This commit is contained in:
@@ -223,7 +223,7 @@ def normalize_query_plan(value, *, root_task, root_value=None, context=None):
|
||||
if (not isinstance(query_id, str) or not query_id or not isinstance(stage, str) or stage not in STAGES | {'overall'}
|
||||
or not isinstance(metric, str) or metric not in WEIGHTS
|
||||
or len(trusted) != 1 or not isinstance(ranks, list) or not 1 <= len(ranks) <= 10
|
||||
or any(type(rank) is not int or not 1 <= rank <= 10 for rank in ranks)
|
||||
or any(type(rank) is not int or not 1 <= rank <= 100 for rank in ranks)
|
||||
or len(set(ranks)) != len(ranks)):
|
||||
raise ValueError(f"queryPlan[{node_id}] previous_ranking只能引用可用排名并指定唯一rank")
|
||||
if (trusted[0].get('dimension') not in SELECTOR_DIMENSIONS or not isinstance(trusted[0].get('period'), dict)
|
||||
@@ -281,7 +281,7 @@ def normalize_query_plan(value, *, root_task, root_value=None, context=None):
|
||||
raise ValueError(f"queryPlan[{node_id}]仅source/records节点接受sourceFields")
|
||||
if purpose == 'changes':
|
||||
dimension, limit, sort = raw.get('dimension'), raw.get('limit', 3), raw.get('sort', 'rate_drop')
|
||||
if (dimension not in SELECTOR_DIMENSIONS or type(limit) is not int or not 1 <= limit <= 10
|
||||
if (dimension not in SELECTOR_DIMENSIONS or type(limit) is not int or not 1 <= limit <= 100
|
||||
or sort not in ('rate_drop', 'current_rate', 'scrap_delta', 'current_scrap')
|
||||
or len(stages) > 1 or not comparison_required
|
||||
or kind not in ('base', 'changes_top')):
|
||||
@@ -305,7 +305,7 @@ def normalize_query_plan(value, *, root_task, root_value=None, context=None):
|
||||
combined = not stages and 'scrapWeight' in fields and set(fields) <= {'rate', 'scrapWeight'}
|
||||
if not isinstance(dimension, str) or dimension not in SELECTOR_DIMENSIONS or not fields or not (combined or stages and not set(fields) - WEIGHTS):
|
||||
raise ValueError(f"queryPlan[{node_id}] ranking必须指定维度、重量字段和阶段")
|
||||
if type(limit) is not int or not 1 <= limit <= 10:
|
||||
if type(limit) is not int or not 1 <= limit <= 100:
|
||||
raise ValueError(f"queryPlan[{node_id}].limit须为1到10")
|
||||
node.update(dimension=dimension, limit=limit)
|
||||
elif purpose == "defects":
|
||||
@@ -314,7 +314,7 @@ def normalize_query_plan(value, *, root_task, root_value=None, context=None):
|
||||
defect = raw.get("defect")
|
||||
category = raw.get("category")
|
||||
if (dimension not in ('defect', 'product') or fields != ['scrapWeight'] or not stages
|
||||
or type(limit) is not int or not 1 <= limit <= 100
|
||||
or type(limit) is not int or not 1 <= limit <= 1000
|
||||
or defect is not None and (not isinstance(defect, str) or not defect.strip())
|
||||
or category is not None and (not isinstance(category, str) or not category.strip())):
|
||||
raise ValueError(f"queryPlan[{node_id}] defects必须指定defect/product维度、scrapWeight、阶段和1到100的limit")
|
||||
@@ -338,8 +338,6 @@ def normalize_query_plan(value, *, root_task, root_value=None, context=None):
|
||||
if purpose == "trend":
|
||||
if comparison_required:
|
||||
raise ValueError(f"queryPlan[{node_id}] trend不能与comparisonRequired混用")
|
||||
if len(expected_months(period)) < 2:
|
||||
raise ValueError(f"queryPlan[{node_id}] trend必须继承至少两个月的root期间")
|
||||
if comparison_required and root_task.get("comparisonPeriod") is None:
|
||||
raise ValueError(f"queryPlan[{node_id}] comparisonRequired需要root comparisonPeriod")
|
||||
if purpose == "ranking" and selector.get("kind") == "catalog_members" and selector["dimension"] != node["dimension"]:
|
||||
@@ -561,7 +559,9 @@ def scope_documents(evidence, scope, *, release_id=None):
|
||||
elif mode not in ('query', 'compare') or result.get('kind') != ('quality_comparison' if mode == 'compare' else 'quality_metrics'):
|
||||
continue
|
||||
elif mode == 'query' and result.get('view') != 'overall':
|
||||
continue
|
||||
if (purpose != 'metrics' or result.get('view') not in ('department', 'group', 'product')
|
||||
or task.get('dimensions') != [result.get('view')]):
|
||||
continue
|
||||
if purpose == 'trend' and mode != 'query':
|
||||
continue
|
||||
raw_purpose = purpose in ('source','records')
|
||||
|
||||
Reference in New Issue
Block a user