kobe6258 hai 4 meses
pai
achega
e70e25a3e4

+ 5 - 5
controllers/report/report_controller.go

@@ -62,7 +62,7 @@ func (r *ReportController) Search(key string) {
 		pageRes.TotalPage = page.TotalPages(pageRes.Total, pageRes.PageSize)
 		list := make([]reportService.ReportDTO, 0)
 		if pageRes.LatestId > 0 {
-			list, err = report.SearchReportList(key, reportIds, r.PageInfo)
+			list, err = report.SearchReportList(key, reportIds, r.PageInfo, isLogin(detailType), userInfo.Id)
 			if err != nil {
 				r.FailedResult("分页搜索报告列表失败", result)
 				return
@@ -154,7 +154,7 @@ func (r *ReportController) HotRanked(permissionIds string, limit int) {
 		detailType := r.Data["detailType"].(string)
 		userInfo := r.Data["user"].(user.User)
 		//
-		permissionIdsWithRisk, err := report.RangePermissionIds(isLogin(detailType), userInfo.Id)
+		permissionIdsWithRisk, pdRiskLevel, err := report.RangePermissionIds(isLogin(detailType), userInfo.Id)
 		if err != nil {
 			logger.Error("获取带有风险等级的品种列表错误:%v", err)
 			r.FailedResult("获取最热报告列表失败", result)
@@ -165,7 +165,7 @@ func (r *ReportController) HotRanked(permissionIds string, limit int) {
 			r.SuccessResult("获取本周最热报告列表成功", []report.HotRankedReport{}, result)
 			return
 		}
-		list, err := report.GetRandedReportByWeeklyHot(limit)
+		list, err := report.GetRandedReportByWeeklyHot(limit, isLogin(detailType), userInfo.Id, pdRiskLevel)
 		//二级品种
 		permissionIdList, err := r.TransPermissionIds(permissionIds)
 		if err != nil {
@@ -223,7 +223,7 @@ func (r *ReportController) PublishRanked(permissionIds string, limit int, week b
 		detailType := r.Data["detailType"].(string)
 		userInfo := r.Data["user"].(user.User)
 		//
-		permissionIdsWithRisk, err := report.RangePermissionIds(isLogin(detailType), userInfo.Id)
+		permissionIdsWithRisk, pdRiskLevel, err := report.RangePermissionIds(isLogin(detailType), userInfo.Id)
 		if err != nil {
 			logger.Error("获取带有风险等级的品种列表错误:%v", err)
 			r.FailedResult("获取最新发布报告列表失败", result)
@@ -235,7 +235,7 @@ func (r *ReportController) PublishRanked(permissionIds string, limit int, week b
 			return
 		}
 		//获取最新的报告列表
-		list, err := report.GetRandedReportByPublishTimeWeekly(limit, week)
+		list, err := report.GetRandedReportByPublishTimeWeekly(limit, week, isLogin(detailType), userInfo.Id, pdRiskLevel)
 		if err != nil {
 			r.FailedResult("获取最新发布报告列表失败", result)
 			return

+ 2 - 2
domian/merchant/merchant_product.go

@@ -59,9 +59,9 @@ func GetProductBySourceId(id int, productType merchantDao.MerchantProductType) (
 	productDao, err := merchantDao.GetMerchantProductBySourceId(id, productType)
 	if err != nil {
 		if errors.Is(err, gorm.ErrRecordNotFound) {
-			logger.Error("商品信息不存在[productId:%d]", id)
+			logger.Error("商品信息不存在[sourceId:%d,type:%v]", id, productType)
 		} else {
-			logger.Error("获取商品信息失败[productId:%d],err:", id, err)
+			logger.Error("获取商品信息失败[sourceId:%d,type:%v],err:%v", id, productType, err)
 		}
 		return
 	}

+ 2 - 1
domian/report/report_service.go

@@ -359,7 +359,8 @@ func getHTReportFirstPermissions(id int) (permissionDTOs []configService.Permiss
 	}
 }
 func getETAReportSecondPermissions(id int) (permissionDTOs []configService.PermissionDTO) {
-	classifyId, err := etaDao.GetReportClassifyById(id)
+	classifyId, err := reportDao.GetReportClassifyById(id)
+	//classifyId, err := etaDao.GetReportClassifyById(id)
 	if err != nil || classifyId == 0 {
 		logger.Error("获取研报分类信息失败:%v", err)
 		return

+ 3 - 3
models/merchant/merchant_product.go

@@ -11,8 +11,8 @@ type SaleStatus string
 type MerchantProductType string
 
 const (
-	detailColumns  = "id,title,price,is_permanent,valid_days,type"
-	sourceIdColumn = "source_id"
+	detailColumns  = "id,title,price,is_permanent,valid_days,type,risk_level"
+	sourceIdColumn = "id,risk_level,source_id"
 )
 const (
 	OnSale  SaleStatus          = "on_sale"  //上架
@@ -68,6 +68,6 @@ func GetMerchantProductBySourceId(sourceId int, productType MerchantProductType)
 
 func GetProductListBySourceIds(ids []int, productType MerchantProductType) (productList []MerchantProduct, err error) {
 	db := models.Main()
-	err = db.Select(detailColumns).Where("source_id in ? and type = ? and deleted =? ", ids, productType, false).Find(&productList).Error
+	err = db.Select(sourceIdColumn).Where("source_id in ? and type = ? and deleted =? ", ids, productType, false).Find(&productList).Error
 	return
 }

+ 9 - 0
models/report/report.go

@@ -139,6 +139,7 @@ func GetReportByOrgId(orgId int, source string) (reports Report, err error) {
 	err = db.Select(CommonColumns).Where("org_id = ? and source =? ", orgId, source).Find(&reports).Error
 	return
 }
+
 func GetReportById(reportId int) (report Report, err error) {
 	db := models.Main()
 	err = db.Select(CommonColumns).Where("id = ?", reportId).First(&report).Error
@@ -387,3 +388,11 @@ func GetETAReportByClassifyIds(classifyIds []int) (reportList []Report, err erro
 	err = db.Model(&Report{}).Select(CommonColumns).Where("source=? and classify_id in (?)", SourceETA, classifyIds).Find(&reportList).Error
 	return
 }
+
+func GetReportClassifyById(id int) (classifyId int, err error) {
+	db := models.Main()
+	err = db.Model(&Report{}).
+		Select("classify_id").
+		Where("orgId =? and source ='ETA' ", id).Scan(&classifyId).Error
+	return
+}

+ 282 - 42
service/report/report_service.go

@@ -43,6 +43,11 @@ type PublishRankedReport struct {
 	PermissionNames   interface{}    `json:"permissionNames,omitempty"`
 	PublishedTime     string         `json:"publishedTime"`
 	CoverUrl          string         `json:"coverUrl"`
+	RiskLevel         string         `json:"riskLevel"`
+	IsFree            bool           `json:"isFree"`
+	Price             string         `json:"price"`
+	IsSubscribe       bool           `json:"isSubscribe"`
+	Login             bool           `json:"login"`
 }
 
 type HotRankedReport struct {
@@ -56,6 +61,11 @@ type HotRankedReport struct {
 	Permissions       map[int]string `json:"-"`
 	PermissionNames   interface{}    `json:"permissionNames,omitempty"`
 	CoverUrl          string         `json:"coverUrl"`
+	RiskLevel         string         `json:"riskLevel"`
+	IsFree            bool           `json:"isFree"`
+	Price             string         `json:"price"`
+	IsSubscribe       bool           `json:"isSubscribe"`
+	Login             bool           `json:"login"`
 }
 
 //type PermissionNode struct {
@@ -141,7 +151,23 @@ func matchRiskLevel(userId int, report reportService.ReportDTO) (riskLevelMatch
 		return
 	}
 }
-
+func getHighestRiskLevel(permissions []permissionService.PermissionDTO) (riskLevelNum int) {
+	for _, permission := range permissions {
+		pRiskNum, err := parseRiskLevel(permission.RiskLevel)
+		if err != nil {
+			logger.Error("解析风险等级失败:%v", err)
+			continue
+		}
+		if riskLevelNum == 0 {
+			riskLevelNum = pRiskNum
+		} else {
+			if riskLevelNum < pRiskNum {
+				riskLevelNum = pRiskNum
+			}
+		}
+	}
+	return
+}
 func getLowestRiskLevel(permissions []permissionService.PermissionDTO) (riskLevelNum int) {
 	for _, permission := range permissions {
 		pRiskNum, err := parseRiskLevel(permission.RiskLevel)
@@ -336,7 +362,7 @@ func parseRiskLevel(level string) (int, error) {
 	return number, nil
 }
 
-func SearchReportList(key string, Ids []int, pageInfo page.PageInfo) (reports []reportService.ReportDTO, err error) {
+func SearchReportList(key string, Ids []int, pageInfo page.PageInfo, isLogin bool, userId int) (reports []reportService.ReportDTO, err error) {
 	offset := page.StartIndex(pageInfo.Current, pageInfo.PageSize)
 	reports, err = reportService.SearchReportList(key, Ids, offset, pageInfo.PageSize, pageInfo.LatestId)
 	var wg sync.WaitGroup
@@ -344,7 +370,11 @@ func SearchReportList(key string, Ids []int, pageInfo page.PageInfo) (reports []
 	for i := 0; i < len(reports); i++ {
 		go func(report *reportService.ReportDTO) {
 			defer wg.Done()
+			report.Login = isLogin
 			report.PermissionNames = getReportPermissionNames(report.OrgId, report.Source)
+			permissions := getReportSecondPermissions(report.OrgId, report.Source)
+			riskNum := getHighestRiskLevel(permissions)
+			report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
 			var src string
 			src, err = mediaService.GetImageSrc(report.CoverSrc)
 			if err != nil {
@@ -353,6 +383,39 @@ func SearchReportList(key string, Ids []int, pageInfo page.PageInfo) (reports []
 			} else {
 				report.CoverUrl = src
 			}
+			//下查询产品信息
+			product, pdErr := productService.GetProductBySourceId(report.ReportID, productDao.Report)
+			if pdErr != nil {
+				if errors.Is(pdErr, gorm.ErrRecordNotFound) {
+					report.Price = defaultProductPrice
+					report.IsFree = true
+					report.IsSubscribe = false
+				} else {
+					report.Price = defaultProductPrice
+					report.IsFree = false
+					report.IsSubscribe = false
+				}
+				return
+			}
+			report.Price = product.Price.String()
+			report.IsFree = false
+			subscribe, subscribeErr := userService.GetUserSubscribe(product.Id, userId)
+			if subscribeErr != nil {
+				report.IsSubscribe = false
+				return
+			}
+			report.IsSubscribe = subscribe.Status == userDao.SubscribeValid
+			pdRiskNum, parseErr := parseRiskLevel(product.RiskLevel)
+			if parseErr != nil {
+				return
+			}
+			rpRiskNum, parseErr := parseRiskLevel(report.RiskLevel)
+			if parseErr != nil {
+				return
+			}
+			if rpRiskNum <= pdRiskNum {
+				report.RiskLevel = product.RiskLevel
+			}
 		}(&reports[i])
 	}
 	wg.Wait()
@@ -474,6 +537,9 @@ func GetReportPage(pageInfo page.PageInfo, orgIds map[string][]int, searchAll bo
 			defer wg.Done()
 			report.Login = isLogin
 			report.PermissionNames = getReportPermissionNames(report.OrgId, report.Source)
+			permissions := getReportSecondPermissions(report.OrgId, report.Source)
+			riskNum := getHighestRiskLevel(permissions)
+			report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
 			var src string
 			src, err = mediaService.GetImageSrc(report.CoverSrc)
 			if err != nil {
@@ -482,10 +548,11 @@ func GetReportPage(pageInfo page.PageInfo, orgIds map[string][]int, searchAll bo
 			} else {
 				report.CoverUrl = src
 			}
+
 			//下查询产品信息
 			product, pdErr := productService.GetProductBySourceId(report.ReportID, productDao.Report)
 			if pdErr != nil {
-				if errors.Is(err, gorm.ErrRecordNotFound) {
+				if errors.Is(pdErr, gorm.ErrRecordNotFound) {
 					report.Price = defaultProductPrice
 					report.IsFree = true
 					report.IsSubscribe = false
@@ -504,6 +571,17 @@ func GetReportPage(pageInfo page.PageInfo, orgIds map[string][]int, searchAll bo
 				return
 			}
 			report.IsSubscribe = subscribe.Status == userDao.SubscribeValid
+			pdRiskNum, parseErr := parseRiskLevel(product.RiskLevel)
+			if parseErr != nil {
+				return
+			}
+			rpRiskNum, parseErr := parseRiskLevel(report.RiskLevel)
+			if parseErr != nil {
+				return
+			}
+			if rpRiskNum <= pdRiskNum {
+				report.RiskLevel = product.RiskLevel
+			}
 		}(&list[i])
 	}
 	wg.Wait()
@@ -537,10 +615,11 @@ func CountReport(count RecordCount) (traceId string, err error) {
 	dto := convertToRecordCountDTO(count)
 	return userService.CountReport(dto)
 }
-func GetRandedReportByWeeklyHot(limit int) (reports []HotRankedReport, err error) {
+func GetRandedReportByWeeklyHot(limit int, isLogin bool, userId int, pdRiskLevel string) (reports []HotRankedReport, err error) {
 	end := time.Now()
 	begin := date.GetBeginOfTheWeek(end, time.Monday)
 	hotReports := userService.GetHotReports(begin.Format(time.DateOnly), end.Format(time.DateOnly), limit)
+
 	if len(hotReports) > 0 {
 		var dtoList []reportService.ReportDTO
 		var ids []int
@@ -548,30 +627,116 @@ func GetRandedReportByWeeklyHot(limit int) (reports []HotRankedReport, err error
 			ids = append(ids, hotReports[i].ReportId)
 		}
 		dtoList, err = reportService.GetListByCondition("id", ids)
-
 		if err != nil {
 			logger.Error("获取本周最热研报列表失败:%v", err)
 			err = exception.New(exception.GetHotRandListFailed)
 			return
 		}
+		var filterList []reportService.ReportDTO
+		if pdRiskLevel != "" {
+			for _, report := range dtoList {
+				product, pdErr := productService.GetProductBySourceId(report.ReportID, productDao.Report)
+				if pdErr != nil {
+					if errors.Is(pdErr, gorm.ErrRecordNotFound) {
+						report.Price = defaultProductPrice
+						report.IsFree = true
+						report.IsSubscribe = false
+					} else {
+						logger.Error("查询产品失败:%v", pdErr)
+						report.Price = defaultProductPrice
+						report.IsFree = false
+						report.IsSubscribe = false
+					}
+					filterList = append(filterList, report)
+				} else {
+					pdRiskNum, paresErr := parseRiskLevel(product.RiskLevel)
+					if paresErr != nil {
+						logger.Error("解析风险等级失败:%v", err)
+						continue
+					}
+					reRiskNum, paresErr := parseRiskLevel(pdRiskLevel)
+					if paresErr != nil {
+						logger.Error("解析风险等级失败:%v", err)
+						continue
+					}
+					report.RiskLevel = product.RiskLevel
+					if isLogin {
+						subscribe, subErr := userService.GetUserSubscribe(product.Id, userId)
+						if subErr != nil {
+							logger.Error("查询用户订阅信息失败:%v,productId:%v,userId:%v", err, product.Id, userId)
+							report.Price = product.Price.String()
+							report.IsFree = false
+							report.IsSubscribe = false
+						} else {
+							report.Price = product.Price.String()
+							report.IsFree = false
+							report.IsSubscribe = subscribe.Status == userDao.SubscribeValid
+						}
+					}
+					if pdRiskNum <= reRiskNum {
+						filterList = append(filterList, report)
+					}
+				}
+			}
+		} else {
+			filterList = dtoList
+			for _, report := range filterList {
+				product, pdErr := productService.GetProductBySourceId(report.ReportID, productDao.Report)
+				if pdErr != nil {
+					if errors.Is(pdErr, gorm.ErrRecordNotFound) {
+						report.Price = defaultProductPrice
+						report.IsFree = true
+						report.IsSubscribe = false
+					} else {
+						logger.Error("查询产品失败:%v", pdErr)
+						report.Price = defaultProductPrice
+						report.IsFree = false
+						report.IsSubscribe = false
+					}
+				} else {
+					report.Price = product.Price.String()
+					report.IsFree = false
+					report.IsSubscribe = false
+					report.RiskLevel = product.RiskLevel
+				}
+			}
+		}
+
 		var wg sync.WaitGroup
-		wg.Add(len(dtoList))
-		for i := 0; i < len(dtoList); i++ {
+		wg.Add(len(filterList))
+		for i := 0; i < len(filterList); i++ {
 			go func(report *reportService.ReportDTO) {
 				defer wg.Done()
+				report.Login = isLogin
 				report.Permissions = getReportPermissionsMap(report.OrgId, report.Source)
 				report.SecondPermission = getReportSecondPermissionsMap(report.OrgId, report.Source)
+				permissions := getReportSecondPermissions(report.OrgId, report.Source)
+				riskNum := getHighestRiskLevel(permissions)
+				if report.RiskLevel == "" {
+					report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
+				} else {
+					reRiskNum, paresErr := parseRiskLevel(report.RiskLevel)
+					if paresErr != nil {
+						logger.Error("解析风险等级失败:%v", err)
+						report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
+					} else {
+						if reRiskNum <= riskNum {
+							report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
+						}
+					}
+				}
 				var label []string
 				for _, permission := range report.Permissions {
 					label = append(label, permission)
 				}
+
 				report.PermissionNames = label
-			}(&dtoList[i])
+			}(&filterList[i])
 		}
 		wg.Wait()
 		reports = make([]HotRankedReport, len(ids))
-		for i := 0; i < len(dtoList); i++ {
-			report := convertToHotRankedReport(dtoList[i])
+		for i := 0; i < len(filterList); i++ {
+			report := convertToHotRankedReport(filterList[i])
 			for j := 0; j < len(hotReports); j++ {
 				if hotReports[j].ReportId == report.Id {
 					report.Count = hotReports[j].Count
@@ -586,26 +751,111 @@ func GetRandedReportByWeeklyHot(limit int) (reports []HotRankedReport, err error
 	return
 }
 
-func GetRandedReportByPublishTimeWeekly(limit int, week bool) (reports []PublishRankedReport, err error) {
+func GetRandedReportByPublishTimeWeekly(limit int, week bool, isLogin bool, userId int, pdRiskLevel string) (reports []PublishRankedReport, err error) {
 	dtoList, err := reportService.GetListOrderByConditionWeekly(week, "published_time", limit, reportService.DESC)
 	if err != nil {
 		logger.Error("获取最新发布的研报列表失败:%v", err)
 		err = exception.New(exception.GetPublishedRandListFailed)
 		return
 	}
+	var filterList []reportService.ReportDTO
+	if pdRiskLevel != "" {
+		for _, report := range dtoList {
+			product, pdErr := productService.GetProductBySourceId(report.ReportID, productDao.Report)
+			if pdErr != nil {
+				if errors.Is(pdErr, gorm.ErrRecordNotFound) {
+					report.Price = defaultProductPrice
+					report.IsFree = true
+					report.IsSubscribe = false
+				} else {
+					logger.Error("查询产品失败:%v", pdErr)
+					report.Price = defaultProductPrice
+					report.IsFree = false
+					report.IsSubscribe = false
+				}
+				filterList = append(filterList, report)
+			} else {
+				pdRiskNum, paresErr := parseRiskLevel(product.RiskLevel)
+				if paresErr != nil {
+					logger.Error("解析风险等级失败:%v", err)
+					continue
+				}
+				reRiskNum, paresErr := parseRiskLevel(pdRiskLevel)
+				if paresErr != nil {
+					logger.Error("解析风险等级失败:%v", err)
+					continue
+				}
+				report.RiskLevel = product.RiskLevel
+				if isLogin {
+					subscribe, subErr := userService.GetUserSubscribe(product.Id, userId)
+					if subErr != nil {
+						logger.Error("查询用户订阅信息失败:%v,productId:%v,userId:%v", err, product.Id, userId)
+						report.Price = product.Price.String()
+						report.IsFree = false
+						report.IsSubscribe = false
+					} else {
+						report.Price = product.Price.String()
+						report.IsFree = false
+						report.IsSubscribe = subscribe.Status == userDao.SubscribeValid
+					}
+				}
+				if pdRiskNum <= reRiskNum {
+					filterList = append(filterList, report)
+				}
+			}
+		}
+	} else {
+		filterList = dtoList
+		for _, report := range filterList {
+			product, pdErr := productService.GetProductBySourceId(report.ReportID, productDao.Report)
+			if pdErr != nil {
+				if errors.Is(pdErr, gorm.ErrRecordNotFound) {
+					report.Price = defaultProductPrice
+					report.IsFree = true
+					report.IsSubscribe = false
+				} else {
+					logger.Error("查询产品失败:%v", pdErr)
+					report.Price = defaultProductPrice
+					report.IsFree = false
+					report.IsSubscribe = false
+				}
+			} else {
+				report.Price = product.Price.String()
+				report.IsFree = false
+				report.IsSubscribe = false
+				report.RiskLevel = product.RiskLevel
+			}
+		}
+	}
 	//并发获取研报的标签
 	var wg sync.WaitGroup
-	wg.Add(len(dtoList))
-	for i := 0; i < len(dtoList); i++ {
+	wg.Add(len(filterList))
+	for i := 0; i < len(filterList); i++ {
 		go func(report *reportService.ReportDTO) {
 			defer wg.Done()
+			report.Login = isLogin
 			report.Permissions = getReportPermissionsMap(report.OrgId, report.Source)
 			report.SecondPermission = getReportSecondPermissionsMap(report.OrgId, report.Source)
 			report.PermissionNames = getReportPermissionNames(report.OrgId, report.Source)
-		}(&dtoList[i])
+			permissions := getReportSecondPermissions(report.OrgId, report.Source)
+			riskNum := getHighestRiskLevel(permissions)
+			if report.RiskLevel == "" {
+				report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
+			} else {
+				reRiskNum, paresErr := parseRiskLevel(report.RiskLevel)
+				if paresErr != nil {
+					logger.Error("解析风险等级失败:%v", err)
+					report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
+				} else {
+					if reRiskNum <= riskNum {
+						report.RiskLevel = strings.Join([]string{"R", strconv.Itoa(riskNum)}, "")
+					}
+				}
+			}
+		}(&filterList[i])
 	}
 	wg.Wait()
-	reports = convertToPublishRankedReportList(dtoList)
+	reports = convertToPublishRankedReportList(filterList)
 	return
 }
 
@@ -624,6 +874,11 @@ func getReportSecondPermissionsMap(id int, source string) (permissionMap map[int
 	}
 	return
 }
+
+func getReportSecondPermissions(id int, source string) (permissionList []permissionService.PermissionDTO) {
+	return reportService.GetReportSecondPermissionsById(id, source)
+
+}
 func getReportPermissionsMap(id int, source string) (permissionMap map[int]string) {
 	permissionMap = make(map[int]string)
 	permissions := reportService.GetReportPermissionsById(id, source)
@@ -634,34 +889,8 @@ func getReportPermissionsMap(id int, source string) (permissionMap map[int]strin
 }
 func GetPermissionList() (root *permissionService.PermissionNode, err error) {
 	return permissionService.GetPermissionList()
-	//if err != nil {
-	//	logger.Error("获取品种列表失败:%v", err)
-	//	err = exception.New(exception.GetPermissionListFailed)
-	//	return
-	//}
-	////root = &PermissionNode{
-	////	ID:       0,
-	////	ParentID: 0,
-	////}
-	////assemblePermissionNode(list, root, 0, 2)
-	//return
 }
 
-//	func assemblePermissionNode(list []reportService.PermissionDTO, node *PermissionNode, current int, level int) {
-//		if node != nil && current < level {
-//			for _, permission := range list {
-//				if permission.ParentID == node.ID {
-//					childNode := &PermissionNode{
-//						ID:       permission.ID,
-//						Name:     permission.Name,
-//						ParentID: permission.ParentID,
-//					}
-//					node.Children = append(node.Children, childNode)
-//					assemblePermissionNode(list, childNode, current+1, level)
-//				}
-//			}
-//		}
-//	}
 func convertToHotRankedReport(dto reportService.ReportDTO) (report HotRankedReport) {
 	src, err := mediaService.GetImageSrc(dto.CoverSrc)
 	if err != nil {
@@ -678,6 +907,11 @@ func convertToHotRankedReport(dto reportService.ReportDTO) (report HotRankedRepo
 		Permissions:       dto.Permissions,
 		PermissionNames:   dto.PermissionNames,
 		CoverUrl:          src,
+		IsSubscribe:       dto.IsSubscribe,
+		IsFree:            dto.IsFree,
+		Price:             dto.Price,
+		RiskLevel:         dto.RiskLevel,
+		Login:             dto.Login,
 	}
 	return
 }
@@ -699,6 +933,11 @@ func convertToPublishRankedReportList(dtoList []reportService.ReportDTO) (report
 			SecondPermissions: dto.SecondPermission,
 			PermissionNames:   dto.PermissionNames,
 			CoverUrl:          src,
+			IsSubscribe:       dto.IsSubscribe,
+			IsFree:            dto.IsFree,
+			Price:             dto.Price,
+			RiskLevel:         dto.RiskLevel,
+			Login:             dto.Login,
 		}
 		reports = append(reports, report)
 	}
@@ -727,7 +966,7 @@ func GetReportByIdListByOrgIds(orgIds map[string][]int) (ids []int, err error) {
 	return
 }
 
-func RangePermissionIds(isLogin bool, userId int) (filterPermissionIds []int, err error) {
+func RangePermissionIds(isLogin bool, userId int) (filterPermissionIds []int, riskLevel string, err error) {
 	if isLogin {
 		userProfile, userErr := user.GetUserProfile(userId)
 		if userErr != nil {
@@ -757,6 +996,7 @@ func RangePermissionIds(isLogin bool, userId int) (filterPermissionIds []int, er
 		//获取所有设置风险等级的品种
 		permissionList, err = permissionService.GetPermissionListWithRisk()
 		permissionList = filterPermissionsByRisk(permissionList, mapping.ProductRiskLevel)
+		riskLevel = mapping.ProductRiskLevel
 		if len(permissionList) == 0 {
 			return
 		}