xingzai преди 1 година
родител
ревизия
79976afe96
променени са 2 файла, в които са добавени 8 реда и са изтрити 4 реда
  1. 2 0
      models/article.go
  2. 6 4
      services/article.go

+ 2 - 0
models/article.go

@@ -645,6 +645,8 @@ type ArticleApiMap struct {
 	IsClass   int `description:"是否自动归类,1是,0否"`
 	IsReport  int `description:"是否属于报告,1是,0否"`
 	IsSummary int `description:"是否属于纪要,1是,0否"`
+	SeriesId  int `description:"策略平台那边的报告分类ID"`
+	OldIdMap  int `description:"策略平台老的分类ID样式map映射"`
 }
 
 func GetArticleApiMap() (item []*ArticleApiMap, err error) {

+ 6 - 4
services/article.go

@@ -750,6 +750,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 	articleResult := articleResultDate.Data
 
 	exitMap := make(map[int]int)
+	categoryIdMap := make(map[int]int)
 	classMap := make(map[int]int)
 	reportMap := make(map[int]int)
 	summaryMap := make(map[int]int)
@@ -766,7 +767,8 @@ func HandleArticleListByApi(artcleId int) (err error) {
 	fmt.Println(openIdList)
 	//新旧分类 反向隐射,是否归类,是否是报告,是否是纪要库
 	for _, v := range listMap {
-		exitMap[v.Id] = v.OldId
+		exitMap[v.SeriesId] = v.OldId
+		categoryIdMap[v.SeriesId] = v.OldIdMap
 		if v.IsClass == 1 {
 			classMap[v.OldId] = 1
 		}
@@ -827,7 +829,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 		item.Abstract = articleResult.Content.Abstract
 		item.Annotation = articleResult.Content.Annotation
 		item.CategoryName = articleResult.Industry.Name
-		item.CategoryId = exitMap[articleResult.SeriesId]
+		item.CategoryId = categoryIdMap[articleResult.SeriesId]
 		item.CategoryIdTwo = exitMap[articleResult.SeriesId]
 		item.SubCategoryName = articleResult.Series.Name
 		item.Cover = cover
@@ -917,9 +919,9 @@ func HandleArticleListByApi(artcleId int) (err error) {
 				v.IsSummary = 0
 			}
 		}
-		if _, has := reportMap[v.CategoryId]; has {
+		if _, has := reportMap[v.CategoryIdTwo]; has {
 			v.IsReport = 1
-			if _, ok := classMap[v.CategoryId]; ok {
+			if _, ok := classMap[v.CategoryIdTwo]; ok {
 				v.IsClass = 1
 				v.ReportType = 1 //是否属于行业报告
 			} else {