|
@@ -1456,18 +1456,27 @@ func GetGeneralPdfUrl(reportCode, classifyFirstName string, reportLayout int8) (
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- conf, e := models.GetBusinessConfByKey("ReportViewUrl")
|
|
|
- if e != nil {
|
|
|
- return
|
|
|
+ // 优先取Report2ImgUrl(用于兼容内外网环境的), 没有的话取报告详情地址
|
|
|
+ var reportUrl string
|
|
|
+ conf, _ := models.GetBusinessConfByKey(models.BusinessConfReport2ImgUrl)
|
|
|
+ if conf != nil && conf.ConfVal != "" {
|
|
|
+ reportUrl = conf.ConfVal
|
|
|
+ }
|
|
|
+ if reportUrl == "" {
|
|
|
+ conf, e := models.GetBusinessConfByKey(models.BusinessConfReportViewUrl)
|
|
|
+ if e != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ reportUrl = conf.ConfVal
|
|
|
}
|
|
|
|
|
|
switch reportLayout {
|
|
|
case 1:
|
|
|
// 普通布局
|
|
|
- pdfUrl = fmt.Sprintf("%s/reportshare_pdf?code=%s", conf.ConfVal, reportCode)
|
|
|
+ pdfUrl = fmt.Sprintf("%s/reportshare_pdf?code=%s", reportUrl, reportCode)
|
|
|
case 2:
|
|
|
// 智能布局
|
|
|
- pdfUrl = fmt.Sprintf("%s/reportshare_smart_pdf?code=%s", conf.ConfVal, reportCode)
|
|
|
+ pdfUrl = fmt.Sprintf("%s/reportshare_smart_pdf?code=%s", reportUrl, reportCode)
|
|
|
}
|
|
|
|
|
|
return
|