|
@@ -418,6 +418,24 @@ func AddReportSaveLog(reportId, adminId int, content, contentSub, adminName stri
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func MultiAddReportChaptersSaveLog(items []*ReportChapter, adminId int, adminRealName string) (err error) {
|
|
|
+ o := orm.NewOrmUsingDB("rddp")
|
|
|
+ p, err := o.Raw(`INSERT INTO report_save_log(report_id, report_chapter_id, content, content_sub, admin_id, admin_name) VALUES (?,?,?,?,?,?)`).Prepare()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ defer func() {
|
|
|
+ _ = p.Close()
|
|
|
+ }()
|
|
|
+ for _, v := range items {
|
|
|
+ _, err = p.Exec(v.ReportId, v.ReportChapterId, v.Content, v.ContentSub, adminId, adminRealName)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
type SaveReportContentResp struct {
|
|
|
ReportId int `description:"报告id"`
|
|
|
}
|
|
@@ -485,9 +503,11 @@ func AddReportAndChapter(reportItem *Report, chapterItemList []*ReportChapter) (
|
|
|
if len(chapterItemList) > 0 {
|
|
|
for _, chapterItem := range chapterItemList {
|
|
|
chapterItem.ReportId = int(reportId)
|
|
|
- if _, tmpErr := to.Insert(chapterItem); tmpErr != nil {
|
|
|
+ cpId, tmpErr := to.Insert(chapterItem)
|
|
|
+ if tmpErr != nil {
|
|
|
return
|
|
|
}
|
|
|
+ chapterItem.ReportChapterId = int(cpId)
|
|
|
}
|
|
|
}
|
|
|
|