浏览代码

Merge branch 'bugfix_6452' into debug

xiziwen 4 月之前
父节点
当前提交
0ae4c43045
共有 3 个文件被更改,包括 34 次插入7 次删除
  1. 2 0
      models/business_conf.go
  2. 18 2
      models/data_manage/chart_classify.go
  3. 14 5
      services/report_v2.go

+ 2 - 0
models/business_conf.go

@@ -53,6 +53,8 @@ const (
 	BusinessConfTencentApiRecTaskCallbackUrl = "TencentApiRecTaskCallbackUrl" // 腾讯云API-语音识别回调地址
 
 	BusinessConfEdbStopRefreshRule = "EdbStopRefreshRule" // 是否停止指标刷新规则
+	BusinessConfReport2ImgUrl      = "Report2ImgUrl"      // 报告转长图地址(用于兼容内外网环境的)
+	BusinessConfReportViewUrl      = "ReportViewUrl"      // 报告详情地址
 )
 
 const (

+ 18 - 2
models/data_manage/chart_classify.go

@@ -501,7 +501,15 @@ func GetChartClassifyAndInfoByParentId(parentId int) (items []*ChartClassifyItem
 	sys_user_real_name,
 	sort,
 	level,
-	unique_code
+	unique_code,
+	source,
+	0 as date_type,
+	'' as start_date,
+	'' as end_date,
+	0 as chart_type,
+	'' as calendar,
+	'' as season_start_date,
+	'' as season_end_date
 FROM
 	chart_classify 
 WHERE
@@ -518,7 +526,15 @@ SELECT
 	sys_user_real_name,
 	sort,
 	0 AS level,
-	unique_code
+	unique_code,
+	source,
+	date_type,
+	start_date,
+	end_date,
+	chart_type,
+	calendar,
+	season_start_date,
+	season_end_date
 FROM
 	chart_info 
 WHERE

+ 14 - 5
services/report_v2.go

@@ -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