|
@@ -1117,8 +1117,9 @@ func PublishReport(reportId int, reportUrl string, sysUser *system.Admin) (tips
|
|
|
}()
|
|
|
|
|
|
// 生成报告pdf和长图
|
|
|
- if reportUrl != "" {
|
|
|
- go Report2pdfAndJpeg(reportUrl, reportId, 1)
|
|
|
+ {
|
|
|
+ reportPdfUrl := GetGeneralPdfUrl(reportInfo.ReportCode, reportInfo.ReportLayout)
|
|
|
+ go Report2pdfAndJpeg(reportPdfUrl, reportId, 1)
|
|
|
}
|
|
|
|
|
|
// 报告权限处理
|
|
@@ -1248,8 +1249,9 @@ func PublishChapterReport(reportInfo *models.Report, reportUrl string, sysUser *
|
|
|
go SaveReportLogs(reportInfo, chapters, reportInfo.AdminId, reportInfo.AdminRealName)
|
|
|
|
|
|
// 生成报告pdf和长图
|
|
|
- if reportUrl != "" {
|
|
|
- go Report2pdfAndJpeg(reportUrl, reportId, 1)
|
|
|
+ {
|
|
|
+ reportPdfUrl := GetGeneralPdfUrl(reportInfo.ReportCode, reportInfo.ReportLayout)
|
|
|
+ go Report2pdfAndJpeg(reportPdfUrl, reportId, 1)
|
|
|
}
|
|
|
|
|
|
return
|
|
@@ -1370,3 +1372,28 @@ func UpdateReportVideo(reportInfo *models.Report) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// GetGeneralPdfUrl
|
|
|
+// @Description: 获取生成pdf的地址
|
|
|
+// @author: Roc
|
|
|
+// @datetime 2024-07-19 14:09:28
|
|
|
+// @param reportCode string
|
|
|
+// @param reportLayout int8
|
|
|
+// @return pdfUrl string
|
|
|
+func GetGeneralPdfUrl(reportCode string, reportLayout int8) (pdfUrl string) {
|
|
|
+ conf, e := models.GetBusinessConfByKey("ReportViewUrl")
|
|
|
+ if e != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ switch reportLayout {
|
|
|
+ case 1:
|
|
|
+ // 普通布局
|
|
|
+ pdfUrl = fmt.Sprintf("%s/reportshare_pdf?code=%s", conf.ConfVal, reportCode)
|
|
|
+ case 2:
|
|
|
+ // 智能布局
|
|
|
+ pdfUrl = fmt.Sprintf("%s/reportshare_smart_pdf?code=%s", conf.ConfVal, reportCode)
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
+}
|