Browse Source

Merge branch 'bzq/knowledge_report_add' of eta_gn_server/eta_report into debug

baoziqiang 3 months ago
parent
commit
156a75bb26
3 changed files with 10 additions and 18 deletions
  1. 4 6
      controllers/report_open.go
  2. 0 2
      models/report_open.go
  3. 6 10
      services/report_open.go

+ 4 - 6
controllers/report_open.go

@@ -141,7 +141,6 @@ func (this *ReportOpenController) ReportCreate() {
 		br.Msg = "请输入课题结束时间"
 		return
 	}
-	req.Abstract = strings.TrimSpace(req.Abstract)
 	topicTime, e := time.ParseInLocation(utils.FormatDateTime, req.EndTime, time.Local)
 	if e != nil {
 		br.Msg = "课题结束时间格式有误"
@@ -190,7 +189,7 @@ func (this *ReportOpenController) ReportCreate() {
 	// 研报类型
 	var reportId int
 	if classify.ClassifyType == utils.ReportTypeDefault {
-		reportId, e = services.CreateReport(req.ReportId, req.ClassifyId, req.Title, req.Abstract, topicTime, req.Creator, req.Authors)
+		reportId, e = services.CreateReport(req.ReportId, req.ClassifyId, req.Title, topicTime, req.Creator, req.Authors)
 		if e != nil {
 			br.Msg = "操作失败"
 			br.ErrMsg = fmt.Sprintf("新增报告失败, %v", e)
@@ -200,7 +199,7 @@ func (this *ReportOpenController) ReportCreate() {
 
 	// PPT类型
 	if classify.ClassifyType == utils.ReportTypePPT {
-		reportId, e = services.CreatePptReport(req.ReportId, req.ClassifyId, req.Title, req.Abstract, topicTime, req.Creator, req.Authors)
+		reportId, e = services.CreatePptReport(req.ReportId, req.ClassifyId, req.Title, topicTime, req.Creator, req.Authors)
 		if e != nil {
 			br.Msg = "操作失败"
 			br.ErrMsg = fmt.Sprintf("新增PPT报告失败, %v", e)
@@ -244,7 +243,6 @@ func (this *ReportOpenController) ReportModify() {
 		br.ErrMsg = fmt.Sprintf("智力共享报告ID有误, %d", req.ReportId)
 		return
 	}
-	req.Abstract = strings.TrimSpace(req.Abstract)
 	req.Title = strings.TrimSpace(req.Title)
 	if req.Title == "" {
 		br.Msg = "请输入报告标题"
@@ -273,7 +271,7 @@ func (this *ReportOpenController) ReportModify() {
 			br.Msg = "报告已发布,不可编辑"
 			return
 		}
-		if e = services.EditReport(reportExist, req.Title, req.Abstract, topicTime, req.Authors); e != nil {
+		if e = services.EditReport(reportExist, req.Title, topicTime, req.Authors); e != nil {
 			br.Msg = "操作失败"
 			br.ErrMsg = fmt.Sprintf("编辑报告失败, %v", e)
 			return
@@ -286,7 +284,7 @@ func (this *ReportOpenController) ReportModify() {
 			br.Msg = "报告已发布,不可编辑"
 			return
 		}
-		if e = services.EditPptReport(pptExist, req.Title, req.Abstract, topicTime, req.Authors); e != nil {
+		if e = services.EditPptReport(pptExist, req.Title, topicTime, req.Authors); e != nil {
 			br.Msg = "操作失败"
 			br.ErrMsg = fmt.Sprintf("编辑PPT报告失败, %v", e)
 			return

+ 0 - 2
models/report_open.go

@@ -5,7 +5,6 @@ type ReportCreateReq struct {
 	ReportId   int      `description:"智力共享报告ID"`
 	ClassifyId int      `description:"分类ID"`
 	Title      string   `description:"报告标题"`
-	Abstract   string   `description:"报告摘要"`
 	EndTime    string   `description:"课题结束时间"`
 	Creator    string   `description:"创建人工号"`
 	Authors    []string `description:"作者工号"`
@@ -21,7 +20,6 @@ type ReportCreateResp struct {
 type ReportModifyReq struct {
 	ReportId int      `description:"智力共享报告ID"`
 	Title    string   `description:"报告标题"`
-	Abstract string   `description:"报告摘要"`
 	EndTime  string   `description:"课题结束时间"`
 	Authors  []string `description:"作者工号"`
 	Operator string   `description:"操作人工号"`

+ 6 - 10
services/report_open.go

@@ -62,7 +62,7 @@ func GetReportByOutReportId(outReportId int) (reportItem *models.Report, pptItem
 }
 
 // CreatePptReport 创建PPT报告
-func CreatePptReport(outReportId, classifyId int, title, abstract string, topicEndTime time.Time, creator string, authors []string) (reportId int, err error) {
+func CreatePptReport(outReportId, classifyId int, title string, topicEndTime time.Time, creator string, authors []string) (reportId int, err error) {
 	defer func() {
 		if err != nil {
 			utils.FileLog.Info(fmt.Sprintf("创建外部PPT报告失败, OutReportId: %d, %v", outReportId, err))
@@ -94,7 +94,6 @@ func CreatePptReport(outReportId, classifyId int, title, abstract string, topicE
 	// 新建PPT基础信息
 	newItem := new(models.PptV2)
 	newItem.Title = title
-	newItem.Abstract = abstract
 	newItem.AddType = utils.ReportAddTypeInherit
 	newItem.ClassifyId = classifyId
 	newItem.CollaborateType = utils.ReportWriteTypeGroup
@@ -288,7 +287,7 @@ func CountParentClassifyReportNumRecursive(list []*models.Classify, parentId int
 }
 
 // CreateReport 创建报告
-func CreateReport(outReportId, classifyId int, title, abstract string, topicEndTime time.Time, creator string, authors []string) (reportId int, err error) {
+func CreateReport(outReportId, classifyId int, title string, topicEndTime time.Time, creator string, authors []string) (reportId int, err error) {
 	defer func() {
 		if err != nil {
 			utils.FileLog.Info(fmt.Sprintf("创建外部报告失败, OutReportId: %d, %v", outReportId, err))
@@ -373,7 +372,6 @@ func CreateReport(outReportId, classifyId int, title, abstract string, topicEndT
 
 	// 新报告信息
 	newItem := new(models.Report)
-	newItem.Abstract = abstract
 	newItem.AddType = utils.ReportAddTypeInherit // 固定继承
 	newItem.ReportVersion = 2                    // 固定新版报告
 	newItem.ClassifyIdFirst = classifyIdFirst
@@ -547,7 +545,7 @@ func CreateReport(outReportId, classifyId int, title, abstract string, topicEndT
 }
 
 // EditReport 编辑报告
-func EditReport(reportItem *models.Report, title, abstract string, topicEndTime time.Time, authors []string) (err error) {
+func EditReport(reportItem *models.Report, title string, topicEndTime time.Time, authors []string) (err error) {
 	if reportItem == nil {
 		err = fmt.Errorf("报告信息有误")
 		return
@@ -631,11 +629,10 @@ func EditReport(reportItem *models.Report, title, abstract string, topicEndTime
 	}
 
 	// 更新报告和移除授权
-	reportItem.Abstract = abstract
 	reportItem.Title = title
 	reportItem.TopicEndTime = topicEndTime
 	reportItem.ModifyTime = time.Now()
-	updateCols := []string{"Title", "Abstract", "TopicEndTime", "ModifyTime"}
+	updateCols := []string{"Title", "TopicEndTime", "ModifyTime"}
 	if e := reportItem.EditReportAndClearGrant(reportItem, updateCols, chapterIds, removePartner); e != nil {
 		err = fmt.Errorf("更新报告失败, %v", e)
 		return
@@ -644,7 +641,7 @@ func EditReport(reportItem *models.Report, title, abstract string, topicEndTime
 }
 
 // EditPptReport 编辑PPT报告
-func EditPptReport(pptItem *models.PptV2, title, abstract string, topicEndTime time.Time, authors []string) (err error) {
+func EditPptReport(pptItem *models.PptV2, title string, topicEndTime time.Time, authors []string) (err error) {
 	if pptItem == nil {
 		err = fmt.Errorf("PPT报告信息有误")
 		return
@@ -675,7 +672,6 @@ func EditPptReport(pptItem *models.PptV2, title, abstract string, topicEndTime t
 	// 新建PPT基础信息
 	pptItem.Title = title
 	pptItem.TopicEndTime = topicEndTime
-	pptItem.Abstract = abstract
 	if len(authors) > 0 {
 		var partnerArr []string
 		for _, v := range authors {
@@ -688,7 +684,7 @@ func EditPptReport(pptItem *models.PptV2, title, abstract string, topicEndTime t
 		}
 		pptItem.CollaborateUsers = strings.Trim(strings.Join(partnerArr, ","), `"`)
 	}
-	updateCols := []string{"Title", "Abstract", "TopicEndTime", "CollaborateUsers"}
+	updateCols := []string{"Title", "TopicEndTime", "CollaborateUsers"}
 	if e := pptItem.Update(updateCols); e != nil {
 		err = fmt.Errorf("更新PPT报告失败, %v", e)
 		return