kobe6258 2 days ago
parent
commit
8ab53deb21
3 changed files with 19 additions and 8 deletions
  1. 3 0
      controllers/report_chapter.go
  2. 7 4
      controllers/report_v2.go
  3. 9 4
      services/report_v2.go

+ 3 - 0
controllers/report_chapter.go

@@ -447,6 +447,9 @@ func (this *ReportController) EditDayWeekChapter() {
 				defer wg.Done()
 				content := v.Content
 				if content != "" {
+					// 处理关联excel的表格id
+					content = services.HandleReportContentTable(reportInfo.Id, content)
+					content = services.HandleReportContent(content, "del", nil)
 					e := utils.ContentXssCheck(content)
 					if e != nil {
 						br.Msg = "存在非法标签"

+ 7 - 4
controllers/report_v2.go

@@ -893,6 +893,7 @@ func (this *ReportController) SaveReportContent() {
 					go func(v *report.ReportFreeLayout) {
 						defer wg.Done()
 						content = v.Content
+						content = services.HandleReportContent(content, "del", nil)
 						if content != "" {
 							e = utils.ContentXssCheck(content)
 							if e != nil {
@@ -1560,10 +1561,12 @@ func (this *ReportController) PrePublishReport() {
 			}
 		}
 	} else {
-		if reportDetail.Content == "" && reportDetail.ReportLayout != 3 {
-			br.Msg = "报告内容为空,不可设置定时发布"
-			br.ErrMsg = "报告内容为空,不可设置定时发布,report_id:" + strconv.Itoa(reportDetail.Id)
-			return
+		if reportDetail.ReportLayout != 3 {
+			if reportDetail.Content == "" {
+				br.Msg = "报告内容为空,不可设置定时发布"
+				br.ErrMsg = "报告内容为空,不可设置定时发布,report_id:" + strconv.Itoa(reportDetail.Id)
+				return
+			}
 		} else {
 			pages, err := report.GetFreeLayoutChapterPagesByReportId(reportDetail.Id)
 			if err != nil {

+ 9 - 4
services/report_v2.go

@@ -1182,10 +1182,12 @@ func PublishReport(reportId int, reportUrl string, sysUser *system.Admin) (tips
 	}
 
 	// 普通报告
-	if reportInfo.Content == "" && reportInfo.ReportLayout != 3 {
-		errMsg = `报告内容为空,不可发布`
-		err = errors.New("报告内容为空,不需要生成,report_id:" + strconv.Itoa(reportId))
-		return
+	if reportInfo.ReportLayout != 3 {
+		if reportInfo.Content == "" {
+			errMsg = `报告内容为空,不可发布`
+			err = errors.New("报告内容为空,不需要生成,report_id:" + strconv.Itoa(reportId))
+			return
+		}
 	} else {
 		pages, pageErr := report.GetFreeLayoutChapterPagesByReportId(reportInfo.Id)
 		if pageErr != nil {
@@ -1641,6 +1643,9 @@ func GetGeneralPdfUrl(reportId int, reportCode, classifyFirstName string, report
 	case 2:
 		// 智能布局
 		pdfUrl = fmt.Sprintf("%s/reportshare_smart_pdf?code=%s", reportUrl, reportCode)
+	case 3:
+		// 智能布局
+		pdfUrl = fmt.Sprintf("%s/reportshare_free_pdf?code=%s", reportUrl, reportCode)
 	}
 
 	if pdfUrl != "" {