Browse Source

fix:报告回调接口增加摘要字段

zqbao 3 months ago
parent
commit
73dc97f453
3 changed files with 8 additions and 5 deletions
  1. 1 1
      controllers/ppt_v2.go
  2. 3 1
      services/report_outer.go
  3. 4 3
      services/report_v2.go

+ 1 - 1
controllers/ppt_v2.go

@@ -666,7 +666,7 @@ func (this *PptV2Controller) Publish() {
 		}
 		outId, _ := strconv.Atoi(pptItem.OutReportId)
 		// 若回调失败, 则恢复提交前状态(先这么处理吧,允许再次提交)
-		e = services.OuterReportCallBack(outId, pptItem.Title, req.PptxUrl, ".pptx")
+		e = services.OuterReportCallBack(outId, pptItem.Title, pptItem.Abstract, req.PptxUrl, ".pptx")
 		if e != nil {
 			pptItem.State = stateOrigin
 			_ = pptItem.Update([]string{"State"})

+ 3 - 1
services/report_outer.go

@@ -17,6 +17,7 @@ const OuterReportCallBackApiUrl = "/subject/report/writingCallback"
 type OuterReportCallBackRequest struct {
 	Name     string `json:"name"`
 	ReportId int    `json:"reportId"`
+	Abstract string `json:"abstract"`
 	Url      string `json:"url"`
 	FileType string `json:"fileType"`
 	FileSize int    `json:"fileSize"`
@@ -30,7 +31,7 @@ type OuterReportCallBackResp struct {
 }
 
 // OuterReportCallBack 外部报告回调(提交审批)
-func OuterReportCallBack(outReportId int, title, fileUrl, fileType string) (err error) {
+func OuterReportCallBack(outReportId int, title, abstract, fileUrl, fileType string) (err error) {
 	var requestUrl, params, respBody string
 	defer func() {
 		if err != nil {
@@ -46,6 +47,7 @@ func OuterReportCallBack(outReportId int, title, fileUrl, fileType string) (err
 	var req OuterReportCallBackRequest
 	req.Name = fmt.Sprintf("%s%s", title, fileType)
 	req.ReportId = outReportId
+	req.Abstract = abstract
 	req.Url = fileUrl
 	req.FileType = fileType
 	b, e := json.Marshal(req)

+ 4 - 3
services/report_v2.go

@@ -9,14 +9,15 @@ import (
 	"eta_gn/eta_api/models/system"
 	"eta_gn/eta_api/utils"
 	"fmt"
-	"github.com/rdlucklib/rdluck_tools/file"
-	"github.com/rdlucklib/rdluck_tools/http"
 	"html"
 	"os"
 	"path"
 	"strconv"
 	"strings"
 	"time"
+
+	"github.com/rdlucklib/rdluck_tools/file"
+	"github.com/rdlucklib/rdluck_tools/http"
 )
 
 // AddReportAndChapter
@@ -1617,7 +1618,7 @@ func PublishReportV2(reportId int, sysUser *system.Admin) (tips string, err erro
 
 		// 回调智力共享审批, 若请求失败则恢复提交前状态(先这么处理吧,允许再次提交)
 		outId, _ := strconv.Atoi(reportInfo.OutReportId)
-		e := OuterReportCallBack(outId, reportInfo.Title, pdfUrl, ".pdf")
+		e := OuterReportCallBack(outId, reportInfo.Title, reportInfo.Abstract, pdfUrl, ".pdf")
 		if e != nil {
 			reportInfo.State = stateOrigin
 			_ = reportInfo.Update([]string{"State"})