xiexiaoyuan hace 3 años
padre
commit
0b8bde94ed

+ 6 - 8
models/response/report.go

@@ -16,16 +16,12 @@ type ReportChapterListItem struct {
 	ReportId        int    `json:"report_id"`
 	Title           string    `json:"title"`
 	TypeId                  int         `json:"type_id"`
-	IsEdit                    int8        `json:"is_edit"`
+	TypeName                string         	`json:"type_name"`
 	Trend                   string      `json:"trend"`
 	ReportChapterTypeKey    string      `json:"report_chapter_type_key"`
 	ReportChapterTypeThumb  string	    `json:"report_chapter_type_thumb"`
-	BannerUrl               string     	`json:"banner_url"`
 	ReportChapterTypeName   string       `json:"report_chapter_type_name"`
 	Sort                    int          `json:"sort"`
-	EditImgUrl              string       `json:"edit_img_url"`
-	PauseStartTime          time.Time    `json:"pause_start_time"`
-	PauseEndTime            time.Time    `json:"pause_end_time"`
 	PublishTime         time.Time    `json:"publish_time"`
 }
 
@@ -52,11 +48,9 @@ type ReportChapterItem struct {
 	ReportId        int    `json:"report_id"`
 	Title           string    `json:"title"`
 	TypeId                  int         `json:"type_id"`
-	Edit                    int8        `json:"edit"`
+	TypeName                string         	`json:"type_name"`
 	Trend                   string      `json:"trend"`
 	ReportChapterTypeName   string       `json:"report_chapter_type_name"`
-	PauseStartTime          time.Time    `json:"pause_start_time"`
-	PauseEndTime            time.Time    `json:"pause_end_time"`
 	PublishTime         time.Time    `json:"publish_time"`
 	Content            string `description:"内容" json:"content"`
 	ContentSub         string `description:"内容前两个章节" json:"content_sub"`
@@ -64,6 +58,10 @@ type ReportChapterItem struct {
 	VideoName           string    `json:"video_name"`                  //音频文件名称
 	VideoPlaySeconds    string    `json:"video_play_seconds"`      //音频播放时长
 	VideoSize           string    `json:"video_size"`
+	Author              string    `description:"作者" json:"author"`
+	Stage              int        `description:"期数" json:"stage"`
+	ClassifyIdFirst    int        `description:"一级分类id" json:"classify_id_first"`
+	ClassifyNameFirst  string     `description:"一级分类名称" json:"classify_name_first"`
 }
 
 type ReportChapterDetail struct {

+ 1 - 1
models/tables/rddp/classify/query.go

@@ -41,7 +41,7 @@ func GetSecondIdsByClassifyNames(names []string) (ids []int, err error) {
 
 // GetParentList 查询所有一级分类
 func GetParentList() (list []*Classify, err error) {
-	err = global.MYSQL["rddp"].Model(Classify{}).Where("parent_id = 0").Order("sort asc, id asc").Scan(&list).Error
+	err = global.MYSQL["rddp"].Model(Classify{}).Where("parent_id = 0 and classify_name != '权益研报'").Order("sort asc, id asc").Scan(&list).Error
 	if err == utils.ErrNoRow {
 		err = nil
 	}

+ 1 - 1
models/tables/rddp/report_chapter/query.go

@@ -64,7 +64,7 @@ func GetListByReportIdTypeIds(reportId int, typeIds []int, classifyNameFirst str
 
 // GetContentById 根据ID获取章节详情
 func GetContentById(id int, typeIds []int) (info *ReportChapter, err error)  {
-	err = global.MYSQL["rddp"].Model(ReportChapter{}).Select("report_chapter_id, report_id,  is_edit, content, trend, type_id, type_name, abstract, title, author, publish_time, content, content_sub, video_url, video_name, video_play_seconds, video_size").
+	err = global.MYSQL["rddp"].Model(ReportChapter{}).Select("report_chapter_id, report_id,  is_edit, classify_name_first, classify_id_first, content, trend, type_id, type_name, abstract, title, author, stage, publish_time, content, content_sub, video_url, video_name, video_play_seconds, video_size").
 		Where("report_chapter_id = ? and type_id in (?) AND publish_state = 2 ", id, typeIds).
 		First(&info).Error
 	if err == utils.ErrNoRow {

+ 5 - 1
services/company/permission.go

@@ -586,10 +586,14 @@ func GetFiccPermissionList() (list []*FiccPermissionList, err error) {
 }
 
 func GetHomeFiccPermissions(user user.UserInfo) (list response.PermissionFiccList, err error){
-	validPermissionIds, err := GetPurchasePermissionIdsByCompany2ProductId(user.CompanyID, 1)
+	validPermissionList, err := GetValidPermissionByCompany2ProductId(user.CompanyID, 1)
 	if err != nil {
 		return
 	}
+	var validPermissionIds []int
+	for _, item := range validPermissionList {
+		validPermissionIds = append(validPermissionIds, item.ChartPermissionID)
+	}
 	permissionList, err := chart_permission.GetFiccListExceptTacticByProductId()
 	if err != nil {
 		return

+ 1 - 0
services/report/classify.go

@@ -282,6 +282,7 @@ func GetClassifyFirstList(user user.UserInfo) (list []*response.ClassifyFirstLis
 		return
 	}
 	classifyMap := make(map[string]bool)
+	// TODO 确认正式环境名称是否一致
 	classifyMap["需求报告"] = true
 	classifyMap["宏观报告"] = true
 	classifyMap["日度点评"] = true

+ 7 - 4
services/report/report_chapter.go

@@ -122,14 +122,11 @@ func GetChapterListByReport(classifyNameFirst string, reportId int, companyId in
 			temp := new(response.ReportChapterListItem)
 			temp.ReportChapterId = item.ReportChapterId
 			temp.TypeId = item.TypeId
+			temp.TypeName = item.TypeName
 			temp.Title = item.Title
 			temp.ReportId = item.ReportId
 			temp.Sort = item.Sort
 			temp.PublishTime = item.PublishTime
-			temp.BannerUrl = typeItem.BannerUrl
-			temp.PauseEndTime = typeItem.PauseEndTime
-			temp.PauseStartTime = typeItem.PauseStartTime
-			temp.EditImgUrl = typeItem.EditImgUrl
 			temp.ReportChapterTypeKey = typeItem.ReportChapterTypeKey
 			// TODO 章节名称和icon
 			temp.ReportChapterTypeName = typeItem.ReportChapterTypeName
@@ -229,6 +226,7 @@ func GetChapterDetail(user user.UserInfo, reportChapterId int) (reportChapterDet
 	reportChapterItem := new(response.ReportChapterItem)
 	reportChapterItem.ReportChapterId = reportChapter.ReportChapterId
 	reportChapterItem.ReportId = reportChapter.ReportId
+
 	reportChapterItem.TypeId = reportChapter.TypeId
 	reportChapterItem.Title = reportChapter.Title
 	reportChapterItem.ReportId = reportChapter.ReportId
@@ -236,6 +234,11 @@ func GetChapterDetail(user user.UserInfo, reportChapterId int) (reportChapterDet
 	reportChapterItem.VideoPlaySeconds = reportChapter.VideoPlaySeconds
 	reportChapterItem.VideoName = reportChapter.VideoName
 	reportChapterItem.VideoSize = reportChapter.VideoSize
+	reportChapterItem.TypeName = reportChapter.TypeName
+	reportChapterItem.Author = reportChapter.Author
+	reportChapterItem.Stage = reportChapter.Stage
+	reportChapterItem.ClassifyNameFirst = reportChapter.ClassifyNameFirst
+	reportChapterItem.ClassifyIdFirst = reportChapter.ClassifyIdFirst
 	if authOk {
 		reportChapterItem.Content = html.UnescapeString(reportChapter.Content)
 		reportChapterItem.VideoUrl = reportChapter.VideoUrl