Browse Source

合并冲突

kobe6258 2 days ago
parent
commit
b6b4c82079
2 changed files with 16 additions and 5 deletions
  1. 13 5
      services/smart_report.go
  2. 3 0
      utils/redis/cluster_redis.go

+ 13 - 5
services/smart_report.go

@@ -301,12 +301,14 @@ func Report2pdfAndJpeg(reportUrl string, reportId, reportType int) {
 	if reportUrl == `` {
 		return
 	}
-	report, err := models.GetReportById(reportId)
-	if err != nil {
-		return
-	}
+	var report *models.ReportDetail
+
 	// 先清空字段
 	if reportType == 1 {
+		report, err = models.GetReportById(reportId)
+		if err != nil {
+			return
+		}
 		err = models.UpdatePdfUrlReportById(reportId)
 		if err != nil {
 			utils.FileLog.Info("清空pdf长图字段失败, Err: \n" + err.Error())
@@ -455,7 +457,13 @@ func Report2pdfAndJpeg(reportUrl string, reportId, reportType int) {
 			}
 		}
 	}()
-	if report.ReportLayout != 3 {
+	var mobilePdf = true
+	if reportType == 1 && report != nil {
+		if report.ReportLayout == 3 {
+			mobilePdf = false
+		}
+	}
+	if mobilePdf {
 		// 移动端
 		go func() {
 			pdfPathMobile := `./static/` + reportCode + "_600.pdf"

+ 3 - 0
utils/redis/cluster_redis.go

@@ -268,7 +268,10 @@ func (rc *ClusterRedisClient) BrpopWithTimeout(key string, timeout time.Duration
 	callback([]byte(values[1]))
 	return
 }
+<<<<<<< HEAD
 
+=======
+>>>>>>> fixbug_8383_englis_report_pdf
 // LLen
 // @Description: 获取list中剩余的数据数
 // @author: Roc