|
@@ -535,20 +535,22 @@ func getAddChapter(reportInfo *models.Report, minClassifyId, inheritReportId int
|
|
|
// 继承的报告章节内容
|
|
|
for i := 0; i < len(inheritReportChapters); i++ {
|
|
|
customChapter := inheritReportChapters[i]
|
|
|
+ // 继承的报告章节ID
|
|
|
+ inheritReportChapterId := customChapter.ReportChapterId
|
|
|
|
|
|
// 授权用户列表
|
|
|
- tmpGrantList, ok := grantListMap[customChapter.ReportChapterId]
|
|
|
+ tmpGrantList, ok := grantListMap[inheritReportChapterId]
|
|
|
if !ok {
|
|
|
tmpGrantList = make([]*report.ReportChapterGrant, 0)
|
|
|
}
|
|
|
- oldChapterIdGrantListMap[customChapter.ReportChapterId] = tmpGrantList
|
|
|
+ oldChapterIdGrantListMap[inheritReportChapterId] = tmpGrantList
|
|
|
|
|
|
// 关联品种列表
|
|
|
- chapterPermissionList, ok := chapterPermissionListMap[customChapter.ReportChapterId]
|
|
|
+ chapterPermissionList, ok := chapterPermissionListMap[inheritReportChapterId]
|
|
|
if !ok {
|
|
|
chapterPermissionList = make([]*report.ReportChapterPermissionMapping, 0)
|
|
|
}
|
|
|
- oldChapterPermissionListMap[customChapter.ReportChapterId] = chapterPermissionList
|
|
|
+ oldChapterPermissionListMap[inheritReportChapterId] = chapterPermissionList
|
|
|
|
|
|
// 判断该章节是否是系统章节,如果是的话,那就是需要额外创建的
|
|
|
if customChapter.TypeId > 0 {
|
|
@@ -573,7 +575,7 @@ func getAddChapter(reportInfo *models.Report, minClassifyId, inheritReportId int
|
|
|
ReportChapter: customChapter,
|
|
|
GrantList: tmpGrantList,
|
|
|
GrantPermissionList: chapterPermissionList,
|
|
|
- InheritReportChapterId: customChapter.ReportChapterId,
|
|
|
+ InheritReportChapterId: inheritReportChapterId,
|
|
|
}
|
|
|
customAddChapterList = append(customAddChapterList, customAddChapter)
|
|
|
}
|
|
@@ -754,7 +756,7 @@ func getAddChapter(reportInfo *models.Report, minClassifyId, inheritReportId int
|
|
|
chapterList = append(chapterList, addChapterItem)
|
|
|
}
|
|
|
|
|
|
- for _, chapterItem := range chapterList {
|
|
|
+ for k, chapterItem := range chapterList {
|
|
|
reportFreeLayoutList, ok := chapterFreeLayoutListMap[chapterItem.InheritReportChapterId]
|
|
|
if ok {
|
|
|
tmpReportFreeLayoutList := make([]*report.ReportFreeLayout, 0)
|
|
@@ -771,7 +773,7 @@ func getAddChapter(reportInfo *models.Report, minClassifyId, inheritReportId int
|
|
|
ModifyTime: time.Now(),
|
|
|
})
|
|
|
}
|
|
|
- chapterItem.ReportChapterFreeLayoutList = tmpReportFreeLayoutList
|
|
|
+ chapterList[k].ReportChapterFreeLayoutList = tmpReportFreeLayoutList
|
|
|
}
|
|
|
}
|
|
|
|