|
@@ -409,11 +409,45 @@ func (this *UserController) CollectList() {
|
|
|
br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
var articleIds []string
|
|
|
for _, v := range list {
|
|
|
articleIds = append(articleIds, strconv.Itoa(v.ArticleId))
|
|
|
}
|
|
|
articleIdStr := strings.Join(articleIds, ",")
|
|
|
+
|
|
|
+ //获取文章关联的产业
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = ` AND mg.article_id IN ( ` + utils.GetOrmInReplace(len(articleIds)) + ` ) `
|
|
|
+ pars = append(pars, articleIds)
|
|
|
+ industrialList, err := models.GetIndustrialListByarticleId(pars, condition)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,GetSubjectList Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ industrialMap := make(map[int][]*models.IndustrialManagementIdInt)
|
|
|
+ if len(industrialList) > 0 {
|
|
|
+ for _, v := range industrialList {
|
|
|
+ item := new(models.IndustrialManagementIdInt)
|
|
|
+ item.ArticleId = v.ArticleId
|
|
|
+ if v.ArticleId > utils.SummaryArticleId {
|
|
|
+ item.IsResearch = true
|
|
|
+ }
|
|
|
+ item.IndustrialManagementId = v.IndustrialManagementId
|
|
|
+ item.IndustryName = v.IndustryName
|
|
|
+ industrialMap[v.ArticleId] = append(industrialMap[v.ArticleId], item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for k, v := range list {
|
|
|
+ if len(industrialMap[v.ArticleId]) > 0 {
|
|
|
+ list[k].List = industrialMap[v.ArticleId]
|
|
|
+ } else {
|
|
|
+ list[k].List = make([]*models.IndustrialManagementIdInt, 0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
articleMap := make(map[int]*models.ArticleDetail)
|
|
|
if articleIdStr != "" {
|
|
|
articleList, err := models.GetArticleDetailByIdStr(articleIdStr)
|
|
@@ -433,17 +467,19 @@ func (this *UserController) CollectList() {
|
|
|
item := list[i]
|
|
|
article := articleMap[item.ArticleId]
|
|
|
list[i].Title = article.Title
|
|
|
- list[i].TitleEn = article.TitleEn
|
|
|
- list[i].UpdateFrequency = article.UpdateFrequency
|
|
|
- list[i].CreateDate = article.CreateDate
|
|
|
+ list[i].DepartmentId = article.DepartmentId
|
|
|
+ list[i].NickName = article.NickName
|
|
|
+ //list[i].TitleEn = article.TitleEn
|
|
|
+ //list[i].UpdateFrequency = article.UpdateFrequency
|
|
|
+ //list[i].CreateDate = article.CreateDate
|
|
|
list[i].PublishDate = article.PublishDate
|
|
|
- list[i].Body, _ = services.GetReportContentTextSub(article.Body)
|
|
|
- list[i].Abstract = article.Abstract
|
|
|
- list[i].CategoryName = article.CategoryName
|
|
|
- list[i].SubCategoryName = article.SubCategoryName
|
|
|
+ //list[i].Body, _ = services.GetReportContentTextSub(article.Body)
|
|
|
+ //list[i].Abstract = article.Abstract
|
|
|
+ //list[i].CategoryName = article.CategoryName
|
|
|
+ //list[i].SubCategoryName = article.SubCategoryName
|
|
|
}
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
- resp := new(models.ArticleCollectListResp)
|
|
|
+ resp := new(models.ArticleReportBillboardLIstPageResp)
|
|
|
resp.List = list
|
|
|
resp.Paging = page
|
|
|
br.Msg = "获取成功!"
|
|
@@ -572,10 +608,44 @@ func (this *UserController) BrowseHistoryList() {
|
|
|
return
|
|
|
}
|
|
|
var articleIds []string
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
for _, v := range list {
|
|
|
articleIds = append(articleIds, strconv.Itoa(v.ArticleId))
|
|
|
}
|
|
|
articleIdStr := strings.Join(articleIds, ",")
|
|
|
+
|
|
|
+ //获取文章关联的产业
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = ` AND mg.article_id IN ( ` + utils.GetOrmInReplace(len(articleIds)) + ` ) `
|
|
|
+ pars = append(pars, articleIds)
|
|
|
+ industrialList, err := models.GetIndustrialListByarticleId(pars, condition)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,GetSubjectList Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ industrialMap := make(map[int][]*models.IndustrialManagementIdInt)
|
|
|
+ if len(industrialList) > 0 {
|
|
|
+ for _, v := range industrialList {
|
|
|
+ item := new(models.IndustrialManagementIdInt)
|
|
|
+ item.ArticleId = v.ArticleId
|
|
|
+ if v.ArticleId > utils.SummaryArticleId {
|
|
|
+ item.IsResearch = true
|
|
|
+ }
|
|
|
+ item.IndustrialManagementId = v.IndustrialManagementId
|
|
|
+ item.IndustryName = v.IndustryName
|
|
|
+ industrialMap[v.ArticleId] = append(industrialMap[v.ArticleId], item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for k, v := range list {
|
|
|
+ if len(industrialMap[v.ArticleId]) > 0 {
|
|
|
+ list[k].List = industrialMap[v.ArticleId]
|
|
|
+ } else {
|
|
|
+ list[k].List = make([]*models.IndustrialManagementIdInt, 0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
articleMap := make(map[int]*models.ArticleDetail)
|
|
|
if articleIdStr != "" {
|
|
|
articleList, err := models.GetArticleDetailByIdStr(articleIdStr)
|
|
@@ -596,18 +666,20 @@ func (this *UserController) BrowseHistoryList() {
|
|
|
article := articleMap[item.ArticleId]
|
|
|
if article != nil {
|
|
|
list[i].Title = article.Title
|
|
|
- list[i].TitleEn = article.TitleEn
|
|
|
- list[i].UpdateFrequency = article.UpdateFrequency
|
|
|
- list[i].CreateDate = article.CreateDate
|
|
|
list[i].PublishDate = article.PublishDate
|
|
|
- list[i].Body, _ = services.GetReportContentTextSub(article.Body)
|
|
|
- list[i].Abstract = article.Abstract
|
|
|
- list[i].CategoryName = article.CategoryName
|
|
|
- list[i].SubCategoryName = article.SubCategoryName
|
|
|
+ list[i].DepartmentId = article.DepartmentId
|
|
|
+ list[i].NickName = article.NickName
|
|
|
+ //list[i].TitleEn = article.TitleEn
|
|
|
+ //list[i].UpdateFrequency = article.UpdateFrequency
|
|
|
+ //list[i].CreateDate = article.CreateDate
|
|
|
+ //list[i].Body, _ = services.GetReportContentTextSub(article.Body)
|
|
|
+ //list[i].Abstract = article.Abstract
|
|
|
+ //list[i].CategoryName = article.CategoryName
|
|
|
+ //list[i].SubCategoryName = article.SubCategoryName
|
|
|
}
|
|
|
}
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
- resp := new(models.ArticleBrowseHistoryListResp)
|
|
|
+ resp := new(models.ArticleReportBillboardLIstPageResp)
|
|
|
resp.List = list
|
|
|
resp.Paging = page
|
|
|
br.Msg = "获取成功!"
|