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