|
@@ -18,29 +18,31 @@ func SyncReportChapterType(req *crm.ReportChapterTypeSyncReq) (err error, errMsg
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
ob := &crm.ReportChapterType{
|
|
|
- ReportChapterTypeId: v.ReportChapterTypeId,
|
|
|
- ReportChapterTypeKey: v.ReportChapterTypeKey,
|
|
|
- ReportChapterTypeThumb: v.ReportChapterTypeThumb,
|
|
|
- BannerUrl: v.BannerUrl,
|
|
|
- ReportChapterTypeName: v.ReportChapterTypeName,
|
|
|
- Sort: v.Sort,
|
|
|
- Enabled: v.Enabled,
|
|
|
- CreatedTime: v.CreatedTime,
|
|
|
- LastUpdatedTime: v.LastUpdatedTime,
|
|
|
- ResearchType: v.ResearchType,
|
|
|
- SelectedImage: v.SelectedImage,
|
|
|
- UnselectedImage: v.UnselectedImage,
|
|
|
- PcSelectedImage: v.PcSelectedImage,
|
|
|
- PcUnselectedImage: v.PcUnselectedImage,
|
|
|
- EditImgUrl: v.EditImgUrl,
|
|
|
- TickerTitle: v.TickerTitle,
|
|
|
- IsShow: v.IsShow,
|
|
|
- PauseStartTime: v.PauseStartTime,
|
|
|
- PauseEndTime: v.PauseEndTime,
|
|
|
- IsSet: v.IsSet,
|
|
|
- YbIconUrl: v.YbIconUrl,
|
|
|
- YbBottomIcon: v.YbBottomIcon,
|
|
|
- YbHidden: v.YbHidden,
|
|
|
+ ReportChapterTypeId: v.ReportChapterTypeId,
|
|
|
+ ReportChapterTypeKey: v.ReportChapterTypeKey,
|
|
|
+ ReportChapterTypeThumb: v.ReportChapterTypeThumb,
|
|
|
+ BannerUrl: v.BannerUrl,
|
|
|
+ ReportChapterTypeName: v.ReportChapterTypeName,
|
|
|
+ Sort: v.Sort,
|
|
|
+ Enabled: v.Enabled,
|
|
|
+ CreatedTime: v.CreatedTime,
|
|
|
+ LastUpdatedTime: v.LastUpdatedTime,
|
|
|
+ ResearchType: v.ResearchType,
|
|
|
+ SelectedImage: v.SelectedImage,
|
|
|
+ UnselectedImage: v.UnselectedImage,
|
|
|
+ PcSelectedImage: v.PcSelectedImage,
|
|
|
+ PcUnselectedImage: v.PcUnselectedImage,
|
|
|
+ EditImgUrl: v.EditImgUrl,
|
|
|
+ TickerTitle: v.TickerTitle,
|
|
|
+ IsShow: v.IsShow,
|
|
|
+ PauseStartTime: v.PauseStartTime,
|
|
|
+ PauseEndTime: v.PauseEndTime,
|
|
|
+ IsSet: v.IsSet,
|
|
|
+ YbIconUrl: v.YbIconUrl,
|
|
|
+ YbBottomIcon: v.YbBottomIcon,
|
|
|
+ YbHidden: v.YbHidden,
|
|
|
+ ReportClassifyId: v.ReportClassifyId,
|
|
|
+ InheritReportChapterTypeId: v.InheritReportChapterTypeId,
|
|
|
}
|
|
|
|
|
|
err = ob.UpdateOrCreate()
|
|
@@ -52,10 +54,13 @@ func SyncReportChapterType(req *crm.ReportChapterTypeSyncReq) (err error, errMsg
|
|
|
}
|
|
|
|
|
|
if req.ReportChapterTypeId > 0 {
|
|
|
+ if req.ResearchType == `` {
|
|
|
+ req.ResearchType = "chapter"
|
|
|
+ }
|
|
|
//同步权限信息
|
|
|
newPermissions := make([]*crm.ReportChapterTypePermission, 0) // 报告章节权限表(新)
|
|
|
newWeekPermissions := make([]*crm.ChartPermissionChapterMapping, 0) // 报告章节权限表(老)
|
|
|
- newEtaPermissions, er := eta.GetChapterTypePermissionByTypeIdAndResearchType(req.ReportChapterTypeId, req.ResearchType)
|
|
|
+ newEtaPermissions, er := eta.GetChapterTypePermissionByTypeIdAndResearchType(req.ReportChapterTypeId)
|
|
|
if er != nil {
|
|
|
errMsg = "更新失败"
|
|
|
err = fmt.Errorf("查询章节权限失败, Err: " + er.Error())
|