Browse Source

Merge branch 'aj_week_report_video' into debug

hongze 6 months ago
parent
commit
68f01481c0
1 changed files with 12 additions and 0 deletions
  1. 12 0
      services/report_v2.go

+ 12 - 0
services/report_v2.go

@@ -4,6 +4,7 @@ import (
 	"archive/zip"
 	"errors"
 	"eta/eta_api/models"
+	"eta/eta_api/models/company"
 	"eta/eta_api/models/report"
 	"eta/eta_api/models/report_approve"
 	"eta/eta_api/models/system"
@@ -1413,6 +1414,17 @@ func UpdateReportVideo(reportInfo *models.Report) {
 			if reportInfo.VideoUrl != "" && reportInfo.VideoName != "" && reportInfo.VideoSize != "" && reportInfo.VideoPlaySeconds != "" {
 				return
 			}
+
+			weekClassifyId, err := company.GetReportClassifyIdByConfigKey("report_week_classify_id")
+			if err != nil && err.Error() != utils.ErrNoRow() {
+				msg := "获取周报ID配置失败:" + err.Error()
+				utils.FileLog.Info(msg)
+				return
+			}
+
+			if reportInfo.ClassifyIdFirst == weekClassifyId {
+				return
+			}
 			videoUrl, videoName, videoSize, videoPlaySeconds, e := CreateReportVideo(reportInfo.Title, html.UnescapeString(reportContent), time.Now().Format(utils.FormatDateTime))
 			if e != nil {
 				err = e