xingzai 2 anos atrás
pai
commit
7f8ee7c62a

+ 156 - 0
controllers/research.go

@@ -0,0 +1,156 @@
+package controllers
+
+import (
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"hongze/hongze_clpt/models"
+	"hongze/hongze_clpt/services"
+	"hongze/hongze_clpt/utils"
+	"strconv"
+	"strings"
+)
+
+type MobileResearchController struct {
+	BaseAuthMobileController
+}
+
+// @Title 研选文章类型列表
+// @Description 研选文章类型列表接口
+// @Success 200 {object} models.CygxArticleTypeListResp
+// @router /article/typeList [get]
+func (this *MobileResearchController) ArticleType() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	var condition string
+	condition = " AND is_show_yanx  = 1 "
+	list, err := models.GetCygxArticleTypeListCondition(condition)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+		return
+	}
+	resp := new(models.CygxArticleTypeListResp)
+	for _, v := range list {
+		item := models.CygxArticleTypeResp{
+			ArticleTypeId:   v.ArticleTypeId,
+			ArticleTypeName: v.ArticleTypeName,
+			ButtonStyle:     v.ButtonStyle,
+		}
+		resp.List = append(resp.List, &item)
+	}
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}
+
+// @Title 研选最新报告列表
+// @Description 研选最新报告列表接口
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   ArticleTypeIds   query   array  true       "文章类型ID多个用  , 隔开"
+// @Success 200 {object} models.IndustrialManagementNewList
+// @router /article/newList [get]
+func (this *MobileResearchController) ArticleNewList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	articleTypeIds := this.GetString("ArticleTypeIds")
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = paging.StartIndex(currentIndex, pageSize)
+	var condition string
+	var pars []interface{}
+	condition = `    AND publish_status = 1  `
+	if articleTypeIds == "" {
+		var conditiontype string
+		conditiontype = " AND is_show_yanx  = 1 "
+		listType, err := models.GetCygxArticleTypeListCondition(conditiontype)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+			return
+		}
+		for _, v := range listType {
+			articleTypeIds += strconv.Itoa(v.ArticleTypeId) + ","
+		}
+		articleTypeIds = strings.TrimRight(articleTypeIds, ",")
+	}
+	condition += `   AND a.article_type_id IN (` + articleTypeIds + `) `
+	total, err := models.GetArticleResearchCount(condition, pars)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "GetArticleResearchCount,Err:" + err.Error()
+		return
+	}
+
+	list, err := models.GetArticleResearchList(condition, pars, startSize, pageSize, user.UserId)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+		return
+	}
+	list, err = services.HandleArticleCategoryImg(list)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "HandleArticleCategoryImg,Err:" + err.Error()
+		return
+	}
+	//处理对应的文章类型标签按钮
+	nameMap, styleMap, err := services.GetArticleTypeMap()
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "GetArticleTypeMap Err:" + err.Error()
+		return
+	}
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	resp := new(models.ArticleResearchListResp)
+	for _, v := range list {
+		item := models.ArticleResearchResp{
+			ArticleId:       v.ArticleId,
+			ArticleTypeId:   v.ArticleTypeId,
+			Title:           v.Title,
+			PublishDate:     v.PublishDate,
+			DepartmentId:    v.DepartmentId,
+			NickName:        v.NickName,
+			IsCollect:       v.IsCollect,
+			Pv:              v.Pv,
+			CollectNum:      v.CollectNum,
+			Abstract:        v.Abstract,
+			Annotation:      v.Annotation,
+			ImgUrlPc:        v.ImgUrlPc,
+			ArticleTypeName: nameMap[v.ArticleTypeId],
+			ButtonStyle:     styleMap[v.ArticleTypeId],
+			List:            v.List,
+		}
+		resp.List = append(resp.List, &item)
+	}
+	resp.Paging = page
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}

+ 6 - 5
models/article.go

@@ -76,7 +76,7 @@ type ArticleFollowDetail struct {
 	MacNum int `description:"本人是否收藏这个文章"`
 }
 
-//获取文章被关注被收藏的详情
+// 获取文章被关注被收藏的详情
 func GetArticleFollowDetail(articleId, uid int) (item *ArticleFollowDetail, err error) {
 	//d_num 作者被关注的数量 、 md_num 本人是否关注这个作者 、ac_num 文章被收藏的数量 、 mac_num 本人是否收藏这个文章
 	o := orm.NewOrm()
@@ -103,7 +103,7 @@ func GetArticleCountById(articleId int) (count int, err error) {
 	return
 }
 
-//用户收藏榜start
+// 用户收藏榜start
 type ArticleCollectionResp struct {
 	ArticleId       int                         `description:"文章id"`
 	Title           string                      `description:"标题"`
@@ -126,9 +126,10 @@ type ArticleCollectionResp struct {
 	HttpUrl         string                      `description:"文章链接跳转地址"`
 	IsNeedJump      bool                        `description:"是否需要跳转链接地址"`
 	MyCollectNum    int                         `description:"本人是否收藏数量"`
+	ArticleTypeId   int                         `description:"文章类型ID"`
 }
 
-//列表
+// 列表
 func GetArticleCollectionList(condition string, userId int) (items []*ArticleCollectionResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -189,7 +190,7 @@ type CygxArticleEs struct {
 	MatchTypeName    string `description:"匹配类型"`
 }
 
-//获取文章列表
+// 获取文章列表
 func GetArticleList(condition string, pars []interface{}) (items []*ArticleDetail, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT	article_id FROM cygx_article  WHERE 1= 1 ` + condition
@@ -204,4 +205,4 @@ func GetArticleDetailByIdStr(articleIdStr string) (items []*ArticleDetail, err e
 			LEFT JOIN cygx_article_department AS d ON d.department_id = art.department_id  WHERE article_id IN(` + articleIdStr + `) `
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
-}
+}

+ 70 - 0
models/article_type.go

@@ -0,0 +1,70 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type CygxArticleType struct {
+	ArticleTypeId      int       `orm:"column(article_type_id);pk";description:"文章类型ID"`
+	ArticleTypeName    string    `description:"类型名称"`
+	Sort               int       `description:"排序字段"`
+	CreateTime         time.Time `description:"创建时间"`
+	ModifyTime         time.Time `description:"最后修改时间"`
+	IsSendEs           int       `description:"这种报告类型是否同步到Es"`
+	YanxPermissionId   int       `description:"研选类型所对应的ID"`
+	YanxPermissionName string    `description:"研选类型所对应的名称"`
+	IcoLink            string    `description:"图标链接地址"`
+	IcoLinkM           string    `description:"移动端图标链接地址"`
+	IsShowLinkButton   int       `description:"这种报告类型是否展示查看报告链接"`
+	ButtonStyle        string    `description:"按钮展示样式"`
+}
+
+type CygxArticleTypeResp struct {
+	ArticleTypeId   int    `description:"文章类型ID"`
+	ArticleTypeName string `description:"类型名称"`
+	ButtonStyle     string `description:"按钮展示样式"`
+}
+
+type CygxArticleTypeListResp struct {
+	List []*CygxArticleTypeResp
+}
+
+// 详情
+func GetCygxArticleTypeDetailById(activityTypeId int) (item *CygxArticleType, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_article_type WHERE article_type_id = ? `
+	err = o.Raw(sql, activityTypeId).QueryRow(&item)
+	return
+}
+
+// 获取数量
+func GetCygxArticleTypeCount(condition string) (count int, err error) {
+	o := orm.NewOrm()
+	sqlCount := `SELECT COUNT(1) AS count  FROM cygx_article_type WHERE  1=1 ` + condition
+	err = o.Raw(sqlCount).QueryRow(&count)
+	return
+}
+
+// 报告类型列表
+func GetCygxArticleTypeList() (items []*CygxArticleType, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_article_type ORDER BY sort DESC`
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}
+
+// 报告类型列表
+func GetCygxArticleTypeListCondition(condition string) (items []*CygxArticleType, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_article_type   WHERE  1=1 ` + condition + ` ORDER BY sort DESC`
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}
+
+func GetArticleTypeInfo(activityTypeId int) (item *CygxArticleType, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_article_type   WHERE  article_type_id=? `
+	err = o.Raw(sql, activityTypeId).QueryRow(&item)
+	return
+}

+ 4 - 0
models/home.go

@@ -63,6 +63,10 @@ type ArticleListResp struct {
 	ChartPermissionName string `description:"权限名称"`
 	ArticleTypeId       int    `description:"文章类型ID判断是否是研选使用"`
 	BodyImg             string `description:"文章封面图片"`
+	DepartmentId        int    `description:"作者Id"`
+	NickName            string `description:"作者昵称"`
+	IsCollect           bool   `description:"本人是否收藏"`
+	CollectNum          int    `description:"收藏人数"`
 	List                []*IndustrialManagementIdInt
 }
 

+ 85 - 19
models/report.go

@@ -51,13 +51,13 @@ type TacticsListResp struct {
 	List             []*HomeArticle
 }
 
-//报告搜索start
+// 报告搜索start
 type ReoprtSearchResp struct {
 	Paging *paging.PagingItem
 	ListHz []*ArticleCollectionResp `description:"弘则报告"`
 }
 
-//搜索资源包 start
+// 搜索资源包 start
 type SearchResourceResp struct {
 	ListHz []*IndustrialManagement `description:"弘则"`
 }
@@ -76,7 +76,7 @@ type SearchResourceResp struct {
 //	IndustrialSubjectList  []*IndustrialSubject `description:"标的列表"`
 //}
 
-//获取列表数量
+// 获取列表数量
 func GetReoprtSearchCount(condition string) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -93,7 +93,7 @@ func GetReoprtSearchCount(condition string) (count int, err error) {
 	return
 }
 
-//列表
+// 列表
 func GetReoprtSearchList(condition string, userId, startSize, pageSize int) (items []*ArticleCollectionResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -124,7 +124,7 @@ func GetReoprtSearchList(condition string, userId, startSize, pageSize int) (ite
 	return
 } //end
 
-//列表
+// 列表
 func GetSearchResourceList(condition string) (items []*IndustrialManagement, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -145,7 +145,7 @@ func GetSearchResourceList(condition string) (items []*IndustrialManagement, err
 	return
 }
 
-//标的列表
+// 标的列表
 func GetThemeHeatSubjectList(condition string) (items []*IndustrialSubject, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -170,7 +170,7 @@ func GetThemeHeatSubjectList(condition string) (items []*IndustrialSubject, err
 	return
 } //end
 
-//产业下所关联的文章分类列表
+// 产业下所关联的文章分类列表
 func IndustrialToArticleCategory(industrialManagementId, chartPermissionId int) (items []*IndustrialToArticleCategoryRep, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT map.match_type_name,map.category_id
@@ -188,7 +188,7 @@ func IndustrialToArticleCategory(industrialManagementId, chartPermissionId int)
 	return
 }
 
-//判断用户是否阅读该产业下,某一分类的文章
+// 判断用户是否阅读该产业下,某一分类的文章
 func IndustrialUserRecordArticleCount(userId, industrialManagementId, categoryId int) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -202,7 +202,7 @@ WHERE
 	return
 }
 
-//获取最新文章
+// 获取最新文章
 func GetNewIndustrialUserRecordArticle(industrialManagementId, categoryId int) (item *ArticleDetail, err error) {
 	o := orm.NewOrm()
 	sql := ` SELECT * FROM cygx_article WHERE article_id IN (SELECT article_id FROM cygx_industrial_article_group_management WHERE industrial_management_id = ? ) AND category_id = ? ORDER BY publish_date DESC LIMIT 0, 1`
@@ -210,7 +210,7 @@ func GetNewIndustrialUserRecordArticle(industrialManagementId, categoryId int) (
 	return
 }
 
-//列表
+// 列表
 func GetReoprtSearchListHz(condition string, userId int) (items []*ArticleCollectionResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -236,7 +236,7 @@ func GetReoprtSearchListHz(condition string, userId int) (items []*ArticleCollec
 	return
 } //end
 
-//产业列表
+// 产业列表
 func GetSearchResourceListHz(condition string, startSize, pageSize int) (items []*IndustrialManagementHotResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -259,7 +259,7 @@ func GetSearchResourceListHz(condition string, startSize, pageSize int) (items [
 	return
 }
 
-//用户收藏榜start
+// 用户收藏榜start
 type IndustrialManagementHotResp struct {
 	IndustrialManagementId int                  `orm:"column(industrial_management_id);pk" description:"产业id"`
 	IndustryName           string               `description:"产业名称"`
@@ -273,14 +273,14 @@ type IndustrialManagementHotResp struct {
 	IndustrialSubjectList  []*IndustrialSubject `description:"标的列表"`
 }
 
-//搜索资源包 start
+// 搜索资源包 start
 type SearchReportAndResourceResp struct {
 	ListHzResource []*IndustrialManagement  `description:"弘则资源包"`
 	ListHzReport   []*ArticleCollectionResp `description:"弘则报告"`
 	Paging         *paging.PagingItem       `description:"弘则报告分页"`
 }
 
-//报告收藏榜单列表
+// 报告收藏榜单列表
 func GetReportCollectionBillboardList(limit int, pars []interface{}, condition string) (items []*ArticleListResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -308,7 +308,7 @@ func GetReportCollectionBillboardList(limit int, pars []interface{}, condition s
 	return
 }
 
-//研选报告收藏榜单列表
+// 研选报告收藏榜单列表
 func GetReportCollectionBillboardListYx(limit int, pars []interface{}, condition string) (items []*ArticleListResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -335,7 +335,7 @@ func GetReportCollectionBillboardListYx(limit int, pars []interface{}, condition
 	return
 }
 
-//获取产业报告+晨会点评列表
+// 获取产业报告+晨会点评列表
 func GetTimeLineReportIndustrialList(industrialManagementId, startSize, pageSize int) (items []*HomeArticle, total int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -374,7 +374,7 @@ type IndustrialPublishdate struct {
 	IndustrialManagementId int    `description:"产业D"`
 }
 
-//标的列表
+// 标的列表
 func GetTimeLineReportIndustrialPublishdateList(industrialIdArr []int) (items []*IndustrialPublishdate, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT	
@@ -395,7 +395,7 @@ func GetTimeLineReportIndustrialPublishdateList(industrialIdArr []int) (items []
 	return
 }
 
-//报告榜单start
+// 报告榜单start
 type ArticleReportBillboardResp struct {
 	ArticleId      int    `description:"文章id"`
 	Title          string `description:"标题"`
@@ -413,4 +413,70 @@ type ArticleReportBillboardResp struct {
 type ArticleReportBillboardLIstPageResp struct {
 	List   []*ArticleReportBillboardResp
 	Paging *paging.PagingItem
-}
+}
+
+type ArticleResearchListResp struct {
+	Paging *paging.PagingItem
+	List   []*ArticleResearchResp
+}
+
+type ArticleResearchResp struct {
+	ArticleId       int                          `description:"文章id"`
+	Title           string                       `description:"标题"`
+	Annotation      string                       `description:"核心观点"`
+	Abstract        string                       `description:"摘要"`
+	PublishDate     string                       `description:"发布时间"`
+	DepartmentId    int                          `description:"作者Id"`
+	NickName        string                       `description:"作者昵称"`
+	IsCollect       bool                         `description:"本人是否收藏"`
+	Pv              int                          `description:"PV"`
+	CollectNum      int                          `description:"收藏人数"`
+	Source          int                          `description:"来源 1:弘则资源包(报告)、2:研选主题(报告)"`
+	ArticleTypeId   int                          `description:"文章类型ID"`
+	ArticleTypeName string                       `description:"类型名称"`
+	ButtonStyle     string                       `description:"按钮展示样式"`
+	ImgUrlPc        string                       `description:"图片链接"`
+	List            []*IndustrialManagementIdInt `description:"产业列表"`
+}
+
+// 获取数量
+func GetArticleResearchCount(condition string, pars []interface{}) (count int, err error) {
+	o := orm.NewOrm()
+	sqlCount := `SELECT COUNT( 1 ) AS count FROM
+			cygx_article AS a
+		WHERE
+			1 = 1  AND a.publish_status = 1` + condition
+	err = o.Raw(sqlCount, pars).QueryRow(&count)
+	return
+}
+
+func GetArticleResearchList(condition string, pars []interface{}, startSize, pageSize, userId int) (items []*ArticleListResp, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			a.article_id,
+			a.title,
+			a.body,
+			a.annotation,
+			a.abstract,
+			a.publish_date,
+			a.article_type_id,
+			d.nick_name,
+			d.department_id,
+			( SELECT count( 1 ) FROM cygx_article_history_record_newpv AS h WHERE h.article_id = a.article_id ) AS pv,
+			( SELECT count( 1 ) FROM cygx_article_collect AS ac  INNER JOIN wx_user as u ON  u.user_id = ac.user_id  WHERE ac.article_id = a.article_id  ) AS collect_num, 
+			( SELECT count( 1 ) FROM cygx_article_collect AS ac  INNER JOIN wx_user as u ON  u.user_id = ac.user_id  WHERE ac.article_id = a.article_id AND DATE_SUB( CURDATE(), INTERVAL 30 DAY ) <= date( ac.create_time )  ) AS collect_num_order, 
+			( SELECT count( 1 ) FROM cygx_article_collect AS ac WHERE ac.article_id = a.article_id  AND user_id = ? ) AS my_collect_num
+		FROM
+			cygx_article AS a
+			INNER JOIN cygx_industrial_article_group_management AS mg ON mg.article_id = a.article_id
+			INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id
+			INNER JOIN cygx_article_department AS d ON d.department_id = a.department_id 
+		WHERE
+			1 = 1  AND a.publish_status = 1  `
+	if condition != "" {
+		sql += condition
+	}
+	sql += ` GROUP BY a.article_id ORDER  BY   a.publish_date DESC  LIMIT ?,? `
+	_, err = o.Raw(sql, userId, pars, startSize, pageSize).QueryRows(&items)
+	return
+}

+ 18 - 0
routers/commentsRouter.go

@@ -385,6 +385,24 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileResearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileResearchController"],
+        beego.ControllerComments{
+            Method: "ArticleNewList",
+            Router: `/article/newList`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileResearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileResearchController"],
+        beego.ControllerComments{
+            Method: "ArticleType",
+            Router: `/article/typeList`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileSearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileSearchController"],
         beego.ControllerComments{
             Method: "BrowseHistoryList",

+ 5 - 1
routers/router.go

@@ -101,7 +101,11 @@ func init() {
 				&controllers.AdviceController{},
 			),
 		),
-
+		web.NSNamespace("/research",
+			web.NSInclude(
+				&controllers.MobileResearchController{},
+			),
+		),
 	)
 	web.AddNamespace(ns)
 }

+ 51 - 3
services/industrial_management.go

@@ -8,7 +8,7 @@ import (
 	"time"
 )
 
-//根据行业处理所选的全部赛道字段
+// 根据行业处理所选的全部赛道字段
 func DoXzsChooseSend(chartPermissionName string) string {
 	var allIn string
 	if chartPermissionName == utils.YI_YAO_NAME {
@@ -25,7 +25,7 @@ func DoXzsChooseSend(chartPermissionName string) string {
 	return allIn
 }
 
-//行业关注或者取消关注的时候,对于用户全部赛道的影响
+// 行业关注或者取消关注的时候,对于用户全部赛道的影响
 func IndustryFllowWithTrack(industrialManagementId, count, uid int) (err error) {
 	defer func() {
 		if err != nil {
@@ -76,7 +76,7 @@ func IndustryFllowWithTrack(industrialManagementId, count, uid int) (err error)
 	return err
 }
 
-//HandleIndustryList预处理产业列表字段
+// HandleIndustryList预处理产业列表字段
 func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUserItem) (items []*models.IndustrialManagement, err error) {
 	userId := user.UserId
 	fllowList, err := models.GetUserFllowIndustrialList(userId)
@@ -220,3 +220,51 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
 	items = list
 	return
 }
+
+// 通过文章ID获取文章所关联的产业
+func GetArticleIndustrialByArticleId(articleIds []int) (itemMap map[int][]*models.IndustrialManagementResp, err error) {
+	lenarticleIds := len(articleIds)
+	if lenarticleIds == 0 {
+		return
+	}
+	var condition string
+	var pars []interface{}
+	condition = ` AND mg.article_id IN (` + utils.GetOrmInReplace(lenarticleIds) + `)`
+	pars = append(pars, articleIds)
+	industrialList, err := models.GetIndustrialListByarticleId(pars, condition)
+	if err != nil {
+		return
+	}
+	industrialMap := make(map[int][]*models.IndustrialManagementResp)
+	if len(industrialList) > 0 {
+		for _, v := range industrialList {
+			item := new(models.IndustrialManagementResp)
+			item.IndustrialManagementId = v.IndustrialManagementId
+			item.IndustryName = v.IndustryName
+			item.ChartPermissionId = v.ChartPermissionId
+			industrialMap[v.ArticleId] = append(industrialMap[v.ArticleId], item)
+		}
+	}
+	itemMap = industrialMap
+	return
+}
+
+func GetArticleTypeMap() (nameMapResp map[int]string, buttonStyleMapResp map[int]string, err error) {
+	condition := " AND is_show_yanx  = 1 "
+	list, e := models.GetCygxArticleTypeListCondition(condition)
+	if e != nil {
+		err = errors.New("报告最早发布时间有误,GetindustryVideo " + e.Error())
+		return
+	}
+	nameMap := make(map[int]string)
+	buttonStyleMap := make(map[int]string)
+	if len(list) > 0 {
+		for _, v := range list {
+			nameMap[v.ArticleTypeId] = v.ArticleTypeName
+			buttonStyleMap[v.ArticleTypeId] = v.ButtonStyle
+		}
+	}
+	nameMapResp = nameMap
+	buttonStyleMapResp = buttonStyleMap
+	return
+}