deving
This commit is contained in:
+4
-10
@@ -253,11 +253,8 @@ async def result_page(request: Request, task_id: str, db_session: AsyncSession =
|
||||
|
||||
# 从数据库查询任务详情
|
||||
result = await db_session.execute(
|
||||
select(ProcessingTask, STPFile, GeometryData, MoldCavityData, HtmlFile)
|
||||
select(ProcessingTask, STPFile)
|
||||
.join(STPFile, ProcessingTask.stp_file_id == STPFile.id)
|
||||
.outerjoin(GeometryData, STPFile.id == GeometryData.stp_file_id)
|
||||
.outerjoin(MoldCavityData, STPFile.id == MoldCavityData.stp_file_id)
|
||||
.outerjoin(HtmlFile, STPFile.id == HtmlFile.stp_file_id)
|
||||
.where(ProcessingTask.task_id == task_id)
|
||||
)
|
||||
|
||||
@@ -266,9 +263,9 @@ async def result_page(request: Request, task_id: str, db_session: AsyncSession =
|
||||
if not task_record:
|
||||
raise HTTPException(404, "任务不存在")
|
||||
|
||||
task, stp_file, geometry_data, cavity_data, html_file = task_record
|
||||
task, stp_file = task_record
|
||||
|
||||
# 构建任务详情数据
|
||||
# 构建任务详情数据(先只包含基本数据)
|
||||
task_data = {
|
||||
"task_id": task.task_id,
|
||||
"filename": stp_file.original_filename if stp_file else "",
|
||||
@@ -278,10 +275,7 @@ async def result_page(request: Request, task_id: str, db_session: AsyncSession =
|
||||
"current_step": task.current_step,
|
||||
"created_at": task.created_time.isoformat() if task.created_time else "",
|
||||
"completed_at": task.completed_time.isoformat() if task.completed_time else "",
|
||||
"error": task.error_message if task.error_message else "",
|
||||
"geometry_data": geometry_data.geometry_json if geometry_data else {},
|
||||
"cavity_data": cavity_data.cavity_json if cavity_data else {},
|
||||
"html_file": html_file.file_path if html_file else ""
|
||||
"error": task.error_message if task.error_message else ""
|
||||
}
|
||||
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
Reference in New Issue
Block a user