Sfoglia il codice sorgente

Merge branch 'ETA_1.4.2' into debug

zwxi 1 anno fa
parent
commit
027b8e50c7

+ 12 - 3
controllers/smart_report/smart_report.go

@@ -95,6 +95,9 @@ func (this *SmartReportController) Add() {
 	item.State = smart_report.SmartReportStateWaitPublish
 	item.CreateTime = time.Now().Local()
 	item.ModifyTime = time.Now().Local()
+	item.HeadImg = req.HeadImg
+	item.EndImg = req.EndImg
+	item.CanvasColor = req.CanvasColor
 	// 继承报告
 	if req.AddType == 2 {
 		ob := new(smart_report.SmartReport)
@@ -230,7 +233,7 @@ func (this *SmartReportController) Edit() {
 		contentModify = true
 	}
 	cols := []string{"ClassifyIdFirst", "ClassifyNameFirst", "ClassifyIdSecond", "ClassifyNameSecond", "Title", "Abstract", "Author",
-		"Frequency", "Content", "ContentSub", "ContentStruct", "ModifyTime"}
+		"Frequency", "Content", "ContentSub", "ContentStruct", "ModifyTime", "HeadImg", "EndImg", "CanvasColor"}
 	item.ClassifyIdFirst = req.ClassifyIdFirst
 	item.ClassifyNameFirst = req.ClassifyNameFirst
 	item.ClassifyIdSecond = req.ClassifyIdSecond
@@ -243,6 +246,9 @@ func (this *SmartReportController) Edit() {
 	item.ContentSub = subContent
 	item.ContentStruct = req.ContentStruct
 	item.ModifyTime = time.Now().Local()
+	item.HeadImg = req.HeadImg
+	item.EndImg = req.EndImg
+	item.CanvasColor = req.CanvasColor
 	if contentModify {
 		//fmt.Println(contentModify)
 		item.LastModifyAdminId = sysUser.AdminId
@@ -744,7 +750,10 @@ func (this *SmartReportController) SaveContent() {
 		item.LastModifyAdminId = sysUser.AdminId
 		item.LastModifyAdminName = sysUser.RealName
 		item.ModifyTime = time.Now().Local()
-		cols := []string{"Content", "ContentSub", "ContentStruct", "ContentModifyTime", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"}
+		item.HeadImg = req.HeadImg
+		item.EndImg = req.EndImg
+		item.CanvasColor = req.CanvasColor
+		cols := []string{"Content", "ContentSub", "ContentStruct", "ContentModifyTime", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime", "HeadImg", "EndImg", "CanvasColor"}
 		if e = item.Update(cols); e != nil {
 			br.Msg = "操作失败"
 			br.ErrMsg = "更新报告内容失败"
@@ -961,7 +970,7 @@ func (this *SmartReportController) List() {
 		"smart_report_id", "report_code", "classify_id_first", "classify_name_first", "classify_id_second", "classify_name_second", "add_type",
 		"title", "abstract", "author", "frequency", "stage", "video_url", "video_name", "video_play_seconds", "video_size", "detail_img_url", "detail_pdf_url",
 		"admin_id", "admin_real_name", "state", "publish_time", "pre_publish_time", "pre_msg_send", "msg_is_send", "msg_send_time", "create_time", "modify_time",
-		"last_modify_admin_id", "last_modify_admin_name", "content_modify_time", "pv", "uv",
+		"last_modify_admin_id", "last_modify_admin_name", "content_modify_time", "pv", "uv", "HeadImg", "EndImg", "CanvasColor",
 	}
 	list, e := reportOB.GetPageItemsByCondition(condition, pars, fields, "", startSize, params.PageSize)
 	if e != nil {

+ 15 - 0
models/smart_report/smart_report.go

@@ -209,6 +209,9 @@ type SmartReportItem struct {
 	ModifyTime          string  `description:"修改时间"`
 	CanEdit             bool    `description:"是否可编辑"`
 	Editor              string  `description:"当前编辑人"`
+	HeadImg             string  `description:"报告头图地址"`
+	EndImg              string  `description:"报告尾图地址"`
+	CanvasColor         string  `description:"画布颜色"`
 }
 
 // FormatSmartReport2Item 格式化智能研报数据格式
@@ -252,6 +255,9 @@ func FormatSmartReport2Item(origin *SmartReport) (item *SmartReportItem) {
 	item.DetailPdfUrl = origin.DetailPdfUrl
 	item.CreateTime = utils.TimeTransferString(utils.FormatDateTime, origin.CreateTime)
 	item.ModifyTime = utils.TimeTransferString(utils.FormatDateTime, origin.ModifyTime)
+	item.HeadImg = origin.HeadImg
+	item.EndImg = origin.EndImg
+	item.CanvasColor = origin.CanvasColor
 	return
 }
 
@@ -266,6 +272,9 @@ type SmartReportAddReq struct {
 	Abstract           string `description:"摘要"`
 	Author             string `description:"作者"`
 	Frequency          string `description:"频度"`
+	HeadImg            string `description:"报告头图地址"`
+	EndImg             string `description:"报告尾图地址"`
+	CanvasColor        string `description:"画布颜色"`
 }
 
 // SmartReportEditReq 编辑智能研报请求体
@@ -274,6 +283,9 @@ type SmartReportEditReq struct {
 	SmartReportId int    `description:"智能研报ID"`
 	Content       string `description:"内容"`
 	ContentStruct string `description:"内容结构"`
+	HeadImg       string `description:"报告头图地址"`
+	EndImg        string `description:"报告尾图地址"`
+	CanvasColor   string `description:"画布颜色"`
 }
 
 // SmartReportRemoveReq 删除智能研报请求体
@@ -300,6 +312,9 @@ type SmartReportSaveContentReq struct {
 	Content       string `description:"内容"`
 	ContentStruct string `description:"内容结构"`
 	NoChange      int    `description:"内容是否未改变:1:内容未改变"`
+	HeadImg       string `description:"报告头图地址"`
+	EndImg        string `description:"报告尾图地址"`
+	CanvasColor   string `description:"画布颜色"`
 }
 
 // SmartReportSaveContentResp 保存草稿响应体