xingzai 2 سال پیش
والد
کامیت
bfbcb8d32c
3فایلهای تغییر یافته به همراه226 افزوده شده و 74 حذف شده
  1. 82 4
      controllers/research.go
  2. 98 38
      models/report.go
  3. 46 32
      services/industrial_management.go

+ 82 - 4
controllers/research.go

@@ -4,8 +4,10 @@ import (
 	"errors"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_cygx/models"
+	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/utils"
 	"strconv"
+	"strings"
 	"time"
 )
 
@@ -590,6 +592,9 @@ func (this *ResearchController) ArticleType() {
 
 // @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 *ResearchController) ArticleNewList() {
@@ -604,21 +609,94 @@ func (this *ResearchController) ArticleNewList() {
 		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
-	condition = `   AND a.article_type_id > 0  AND publish_status = 1 GROUP BY a.article_id ORDER BY collect_num_order DESC, publish_date DESC LIMIT 15 `
-	list, err := models.GetArticleCollectionList(condition, user.UserId)
+	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
 	}
+	var articleIds []int
 	for k, v := range list {
 		if v.MyCollectNum > 0 {
 			list[k].IsCollect = true
 		}
+		articleIds = append(articleIds, v.ArticleId)
 	}
-	resp := new(models.ArticleCollectionLIstResp)
-	resp.List = list
+	//处理关联的产业
+	industrialMap, err := services.GetArticleIndustrialByArticleId(articleIds)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取关联的产业信息失败,GetArticleIndustrialByArticleId Err:" + err.Error()
+		return
+	}
+	for k, v := range list {
+		if len(industrialMap[v.ArticleId]) > 0 {
+			list[k].List = industrialMap[v.ArticleId]
+		} else {
+			list[k].List = make([]*models.IndustrialManagementResp, 0)
+		}
+	}
+	//处理对应的文章类型标签按钮
+	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,
+			Title:           v.Title,
+			PublishDate:     v.PublishDate,
+			DepartmentId:    v.DepartmentId,
+			NickName:        v.NickName,
+			IsCollect:       v.IsCollect,
+			Pv:              v.Pv,
+			CollectNum:      v.CollectNum,
+			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 = "获取成功"

+ 98 - 38
models/report.go

@@ -5,7 +5,6 @@ import (
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"strconv"
 	"time"
-
 	//"github.com/rdlucklib/rdluck_tools/paging"
 )
 
@@ -64,7 +63,7 @@ type IndustrialSubject struct {
 	LayoutTime             string `description:"产业布局时间"`
 }
 
-//获取产业报告数量
+// 获取产业报告数量
 func GetReportIndustrialCount(categoryId, industrialManagementId int) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT COUNT(1) count 
@@ -86,7 +85,7 @@ WHERE
 	return
 }
 
-//获取产业报告列表
+// 获取产业报告列表
 func GetReportIndustrialList(pars []interface{}, categoryId, industrialManagementId, userId, startSize, pageSize int) (items []*ReportArticle, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT *,( SELECT COUNT( 1 ) FROM cygx_article_history_record AS rec WHERE rec.user_id = ` + strconv.Itoa(userId) + ` AND rec.article_id = a.article_id ) AS readnum 
@@ -109,7 +108,7 @@ WHERE
 	return
 }
 
-//产业下所关联的文章分类列表
+// 产业下所关联的文章分类列表
 func IndustrialToArticleCategory(industrialManagementId, chartPermissionId int) (items []*IndustrialToArticleCategoryRep, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT map.match_type_name,map.category_id
@@ -127,7 +126,7 @@ func IndustrialToArticleCategory(industrialManagementId, chartPermissionId int)
 	return
 }
 
-//产业下所关联的文章分类列表 2022-10-13
+// 产业下所关联的文章分类列表 2022-10-13
 func IndustrialToArticleCategoryNew(industrialManagementId int) (items []*IndustrialToArticleCategoryRep, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT map.match_type_name,map.category_id
@@ -144,7 +143,7 @@ func IndustrialToArticleCategoryNew(industrialManagementId int) (items []*Indust
 	return
 }
 
-//判断用户是否阅读该产业下,某一分类的文章
+// 判断用户是否阅读该产业下,某一分类的文章
 func IndustrialUserRecordArticleCount(userId, industrialManagementId, categoryId int) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -164,7 +163,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 match_type_name = any( SELECT match_type_name FROM cygx_report_mapping WHERE category_id = ? ) ORDER BY publish_date DESC LIMIT 0, 1`
@@ -179,7 +178,7 @@ WHERE
 	return
 }
 
-//获取最新文章
+// 获取最新文章
 func GetNewArticleByCategoryId(categoryId int) (item *ArticleDetail, err error) {
 	o := orm.NewOrm()
 	sql := ` SELECT * FROM cygx_article WHERE  category_id = ? ORDER BY publish_date DESC LIMIT 0, 1`
@@ -216,7 +215,7 @@ type ReportArticleWhichIndustrialRepList struct {
 	List         []*ReportArticleWhichIndustrial
 }
 
-//列表
+// 列表
 func IndustrialToArticleWhichDepartment(condition string, pars []interface{}, uid, startSize, pageSize int) (items []*ReportArticleWhichIndustrial, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -275,7 +274,7 @@ type SearchTxt struct {
 	TabSearch      string `description:"素材库搜索说明"`
 }
 
-//获取用户是否有查看权限
+// 获取用户是否有查看权限
 func GetUserIsAdminCount(mobile string) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT COUNT(1) count  FROM admin 
@@ -331,7 +330,7 @@ type CygxIndustrySearchListPc struct {
 	IndList        []*IndustrialManagement `description:"产业列表"`
 }
 
-//列表
+// 列表
 func GetCygxIndustryAndArticleList(keyWord string) (items []*CygxIndustryAndArticleList, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -362,7 +361,7 @@ func GetArticleIdsBySubId(subjectId string) (articleIds string, err error) {
 	return
 } //end
 
-//用户收藏榜start
+// 用户收藏榜start
 type ArticleCollectionResp struct {
 	ArticleId              int                         `description:"文章id"`
 	Title                  string                      `description:"标题"`
@@ -376,6 +375,7 @@ type ArticleCollectionResp struct {
 	Pv                     int                         `description:"PV"`
 	CollectNum             int                         `description:"收藏人数"`
 	Source                 int                         `description:"来源 1:弘则资源包(报告)、2:研选主题(报告)"`
+	ArticleTypeId          int                         `description:"文章类型ID"`
 	List                   []*IndustrialManagementResp `description:"产业列表"`
 }
 
@@ -389,7 +389,7 @@ type ArticleCollectionLIstResp struct {
 	List []*ArticleCollectionResp
 }
 
-//列表
+// 列表
 func GetArticleCollectionList(condition string, userId int) (items []*ArticleCollectionResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -418,7 +418,67 @@ func GetArticleCollectionList(condition string, userId int) (items []*ArticleCol
 	return
 } //end
 
-//用户收藏榜start
+type ArticleResearchListResp struct {
+	Paging *paging.PagingItem
+	List   []*ArticleResearchResp
+}
+
+type ArticleResearchResp struct {
+	ArticleId       int                         `description:"文章id"`
+	Title           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:"按钮展示样式"`
+	List            []*IndustrialManagementResp `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 []*ArticleCollectionResp, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			a.article_id,
+			a.title,
+			date_format( a.publish_date, '%Y-%m-%d' ) AS 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
+}
+
+// 用户收藏榜start
 type IndustrialManagementHotResp struct {
 	IndustrialManagementId int                   `orm:"column(industrial_management_id);pk" description:"产业id"`
 	IndustryName           string                `description:"产业名称"`
@@ -442,7 +502,7 @@ type IndustrialManagementHotListResp struct {
 	List   []*IndustrialManagementHotResp
 }
 
-//产业列表
+// 产业列表
 func GetThemeHeatList(userId int, condition string, startSize, pageSize int) (items []*IndustrialManagementHotResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -467,7 +527,7 @@ func GetThemeHeatList(userId int, condition string, startSize, pageSize int) (it
 	return
 }
 
-//获取数量
+// 获取数量
 func GetThemeHeatListCount(condition string) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT   COUNT( DISTINCT m.industrial_management_id ) FROM
@@ -482,7 +542,7 @@ func GetThemeHeatListCount(condition string) (count int, err error) {
 	return
 }
 
-//标的列表
+// 标的列表
 func GetThemeHeatSubjectList(condition string) (items []*IndustrialSubject, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -507,7 +567,7 @@ func GetThemeHeatSubjectList(condition string) (items []*IndustrialSubject, err
 	return
 } //end
 
-//Kol sratr
+// Kol sratr
 type DepartmentResp struct {
 	DepartmentId int    `description:"作者Id"`
 	NickName     string `description:"作者昵称"`
@@ -526,7 +586,7 @@ type IndustrialDepartmentListResp struct {
 	DepartmentId           int    `description:"作者Id"`
 }
 
-//作者列表
+// 作者列表
 func GetDepartmentList(userId int) (items []*DepartmentResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -551,7 +611,7 @@ func GetDepartmentList(userId int) (items []*DepartmentResp, err error) {
 	return
 }
 
-//作者文章所关联的产业列表
+// 作者文章所关联的产业列表
 func GetIndustrialDepartmentList() (items []*IndustrialDepartmentListResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -575,7 +635,7 @@ func GetIndustrialDepartmentList() (items []*IndustrialDepartmentListResp, err e
 	return
 }
 
-//主题详情start
+// 主题详情start
 type GetThemeDetailListResp struct {
 	ArticleId              int    `description:"文章id"`
 	Title                  string `description:"标题"`
@@ -613,7 +673,7 @@ type GetThemeAericleListBuSubjectResp struct {
 	List        []*GetThemeAericleListResp
 }
 
-//主题详情start
+// 主题详情start
 type GetThemeDetailResp struct {
 	IndustrialManagementId int                  `description:"产业Id"`
 	IndustryName           string               `description:"产业名称"`
@@ -622,7 +682,7 @@ type GetThemeDetailResp struct {
 	List                   []*GetThemeAericleListResp
 }
 
-//列表
+// 列表
 func GetThemeDetail(userId, industrialManagementId int, condition string) (items []*GetThemeDetailListResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -656,7 +716,7 @@ func GetThemeDetail(userId, industrialManagementId int, condition string) (items
 	return
 } //end
 
-//用户收藏榜start
+// 用户收藏榜start
 type DepartmentDetailResp struct {
 	DepartmentId   int    `description:"作者Id"`
 	NickName       string `description:"作者昵称"`
@@ -680,7 +740,7 @@ type DepartmentDetail struct {
 	MyFllowNum   int    `description:"本人是否关注"`
 }
 
-//列表
+// 列表
 func GetDepartmentDetail(userId, departmentId int) (item DepartmentDetail, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -699,13 +759,13 @@ func GetDepartmentDetail(userId, departmentId int) (item DepartmentDetail, err e
 	return
 } //end
 
-//报告搜索start
+// 报告搜索start
 type ReoprtSearchResp struct {
 	ListYx []*ArticleCollectionResp `description:"研选报告"`
 	ListHz []*ArticleCollectionResp `description:"弘则报告"`
 }
 
-//列表
+// 列表
 func GetReoprtSearchList(condition string, userId int) (items []*ArticleCollectionResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -730,13 +790,13 @@ func GetReoprtSearchList(condition string, userId int) (items []*ArticleCollecti
 	return
 } //end
 
-//搜索资源包 start
+// 搜索资源包 start
 type SearchResourceResp struct {
 	ListHz []*IndustrialManagementHotResp `description:"弘则"`
 	ListYx []*IndustrialManagementHotResp `description:"研选"`
 }
 
-//搜索资源包 start
+// 搜索资源包 start
 type SearchReportAndResourceResp struct {
 	ListHzResource []*IndustrialManagementHotResp `description:"弘则资源包"`
 	ListYxResource []*IndustrialManagementHotResp `description:"研选资源包"`
@@ -744,7 +804,7 @@ type SearchReportAndResourceResp struct {
 	ListHzReport   []*ArticleCollectionResp       `description:"弘则报告"`
 }
 
-//产业列表
+// 产业列表
 func GetSearchResourceList(userId int, condition string, startSize, pageSize int) (items []*IndustrialManagementHotResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -769,19 +829,19 @@ func GetSearchResourceList(userId int, condition string, startSize, pageSize int
 	return
 }
 
-//切换列表
+// 切换列表
 type ReportBillboardTableResp struct {
 	Name   string `description:"名称"`
 	Source int    `description:"类型"`
 	List   []*ChartPermission
 }
 
-//切换列表
+// 切换列表
 type ReportBillboardTableListResp struct {
 	List []*ReportBillboardTableResp
 }
 
-//报告榜单start
+// 报告榜单start
 type ArticleReportBillboardResp struct {
 	ArticleId      int    `description:"文章id"`
 	Title          string `description:"标题"`
@@ -805,7 +865,7 @@ type ArticleReportBillboardLIstPageResp struct {
 	Paging *paging.PagingItem
 }
 
-//报告收藏榜单列表
+// 报告收藏榜单列表
 func GetReportCollectionBillboardList(limit int, pars []interface{}, condition string) (items []*ArticleReportBillboardResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -831,7 +891,7 @@ func GetReportCollectionBillboardList(limit int, pars []interface{}, condition s
 	return
 }
 
-//报告阅读榜单列表
+// 报告阅读榜单列表
 func GetReportPvBillboardList(pars []interface{}, condition string) (items []*ArticleReportBillboardResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -851,7 +911,7 @@ func GetReportPvBillboardList(pars []interface{}, condition string) (items []*Ar
 	return
 }
 
-//获取产业报告+晨会点评数量
+// 获取产业报告+晨会点评数量
 func GetTimeLineReportIndustrialCount(industrialManagementId int) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT SUM(count) AS count FROM (
@@ -891,7 +951,7 @@ type TimeLineReportItem struct {
 	Readnum         int    `description:"阅读数量"`
 }
 
-//获取产业报告+晨会点评列表
+// 获取产业报告+晨会点评列表
 func GetTimeLineReportIndustrialList(userId, industrialManagementId, startSize, pageSize int) (items []*TimeLineReportItem, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -947,7 +1007,7 @@ type IndustrialReadNum struct {
 	Readnum                int `description:"阅读次数"`
 }
 
-//获取该产业下文章的用户阅读次数-小红点用
+// 获取该产业下文章的用户阅读次数-小红点用
 func GetReportIndustrialReadNumList(userId int, industrialIds string, createtime time.Time) (items []*IndustrialReadNum, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT a.industrial_management_id, MIN(a.readnum) AS readnum FROM (

+ 46 - 32
services/industrial_management.go

@@ -507,35 +507,49 @@ func HandleIndustryList(list []*models.IndustrialManagement, user *models.WxUser
 }
 
 // 通过文章ID获取文章所关联的产业
-//func GetArticleIndustrialByArticleId() {
-//	var condition string
-//	var pars []interface{}
-//	pars = make([]interface{}, 0)
-//	condition = ` AND a.article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
-//	pars = append(pars, articleIds)
-//	articleIds = strings.TrimRight(articleIds, ",")
-//	silcearticleIds := strings.Split(articleIds, ",")
-//	var parsindustrial []interface{}
-//	parsindustrial = make([]interface{}, 0)
-//	articleIdList := make([]string, 0)
-//	for _, v := range silcearticleIds {
-//		articleIdList = append(articleIdList, v)
-//	}
-//	conditionindustrial := ` AND mg.article_id IN (  ` + utils.GetOrmInReplace(len(silcearticleIds)) + ` )  `
-//	parsindustrial = append(parsindustrial, articleIdList)
-//	industrialList, err := models.GetIndustrialListByarticleId(parsindustrial, conditionindustrial)
-//	if err != nil {
-//		return
-//	}
-//	industrialMap := make(map[int][]*models.IndustrialManagementResp)
-//	if len(industrialList) > 0 {
-//		for _, v := range industrialList {
-//			item := new(models.IndustrialManagementResp)
-//			//item.ArticleId = v.ArticleId
-//			item.IndustrialManagementId = v.IndustrialManagementId
-//			item.IndustryName = v.IndustryName
-//			item.ChartPermissionId = v.ChartPermissionId
-//			industrialMap[v.ArticleId] = append(industrialMap[v.ArticleId], item)
-//		}
-//	}
-//}
+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
+}