x
This commit is contained in:
@@ -448,7 +448,8 @@ class StorageIntegrationService:
|
||||
'mold_cavity_data': None,
|
||||
'html_content': None,
|
||||
'features': [],
|
||||
'recommendations': []
|
||||
'recommendations': [],
|
||||
'analysis_metrics': None # 新增分析指标字段
|
||||
}
|
||||
|
||||
# 2. 从RustFS获取数据
|
||||
@@ -508,7 +509,7 @@ class StorageIntegrationService:
|
||||
)
|
||||
result['recommendations'] = [
|
||||
{
|
||||
'rec_type': r.rec_type,
|
||||
'type': r.rec_type, # 改为 type 以匹配前端期望的字段名
|
||||
'priority': r.priority,
|
||||
'description': r.description,
|
||||
'reason': r.reason,
|
||||
@@ -517,6 +518,15 @@ class StorageIntegrationService:
|
||||
for r in recommendations.scalars().all()
|
||||
]
|
||||
|
||||
# 4. 获取分析指标
|
||||
if stp_file.analysis_metrics:
|
||||
result['analysis_metrics'] = {
|
||||
'volume_utilization': stp_file.analysis_metrics.volume_utilization,
|
||||
'topology_complexity': stp_file.analysis_metrics.topology_complexity,
|
||||
'wall_uniformity': stp_file.analysis_metrics.wall_uniformity,
|
||||
'analysis_summary': stp_file.analysis_metrics.analysis_summary
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
async def delete_stp_file_cascade(self, session: AsyncSession,
|
||||
|
||||
Reference in New Issue
Block a user