This commit is contained in:
2026-06-12 15:54:40 +08:00
parent 0478674a55
commit 18f7c26539
7 changed files with 496 additions and 94 deletions

View File

@@ -19,6 +19,7 @@ import (
"hyapi-server/internal/domains/api/services/processors"
"hyapi-server/internal/domains/api/services/processors/qygl/reportstore"
"hyapi-server/internal/shared/pdf"
"hyapi-server/internal/shared/qyglreport"
)
// QYGLReportHandler 企业全景报告页面渲染处理器
@@ -97,9 +98,7 @@ func (h *QYGLReportHandler) GetQYGLReportPage(c *gin.Context) {
reportJSON := template.JS(reportJSONBytes)
c.HTML(http.StatusOK, "qiye.html", gin.H{
"ReportJSON": reportJSON,
})
c.HTML(http.StatusOK, "qiye.html", qyglreport.PageTemplateData(reportJSON))
}
// GetQYGLReportPageByID 通过编号查看企业全景报告页面
@@ -115,9 +114,7 @@ func (h *QYGLReportHandler) GetQYGLReportPageByID(c *gin.Context) {
if h.reportRepo != nil {
if entity, err := h.reportRepo.FindByReportID(c.Request.Context(), id); err == nil && entity != nil {
h.maybeScheduleQYGLPDFPregen(c.Request.Context(), id)
c.HTML(http.StatusOK, "qiye.html", gin.H{
"ReportJSON": template.JS(entity.ReportData),
})
c.HTML(http.StatusOK, "qiye.html", qyglreport.PageTemplateData(template.JS(entity.ReportData)))
return
}
}
@@ -140,9 +137,7 @@ func (h *QYGLReportHandler) GetQYGLReportPageByID(c *gin.Context) {
reportJSON := template.JS(reportJSONBytes)
c.HTML(http.StatusOK, "qiye.html", gin.H{
"ReportJSON": reportJSON,
})
c.HTML(http.StatusOK, "qiye.html", qyglreport.PageTemplateData(reportJSON))
}
// qyglReportExists 报告是否仍在库或本进程内存中(用于决定是否补开预生成)