浏览代码

Merge branch 'cygx_10.6' of http://8.136.199.33:3000/cxzhang/hongze_clpt

xingzai 1 年之前
父节点
当前提交
336a7509fe

+ 1 - 18
controllers/report.go

@@ -401,26 +401,9 @@ func (this *MobileReportController) ArticleCategoryList() {
 		}
 		categoryMap[v.CategoryId] = v.CategoryId
 		list = append(list, v)
-		//recordCount, err := models.IndustrialUserRecordArticleCount(uid, industrialManagementId, v.CategoryId)
-		//if err != nil && err.Error() != utils.ErrNoRow() {
-		//	br.Msg = "获取信息失败"
-		//	br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-		//	return
-		//}
-		//Newdetail, err := models.GetNewIndustrialUserRecordArticle(industrialManagementId, v.CategoryId)
-		//if err != nil {
-		//	br.Msg = "获取信息失败"
-		//	br.ErrMsg = "获取信息失败,Err:" + err.Error()
-		//	return
-		//}
-		//if Newdetail != nil {
-		//	if recordCount == 0 && user.CreatedTime.Before(utils.StrTimeToTime(Newdetail.PublishDate)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(Newdetail.PublishDate)) {
-		//		list[k].IsRed = true
-		//	}
-		//}
 	}
 	//标的列表
-	industrialSubjectList, err := models.GetIndustrialSubjectAll(industrialManagementId)
+	industrialSubjectList, err := models.GetIndustrialArticleGroupSubjectListByHz(industrialManagementId)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()

+ 75 - 11
controllers/search.go

@@ -250,18 +250,18 @@ func (this *MobileSearchController) ListHomeArtAndChart() {
 	}
 	//ListType   query   int  true       "列表类型,1最新/全部,2 纪要 ,3图表 默认1"
 	//记录用户搜索关键词
-	var source int
-	if listType == 1 {
-		source = 3
-	} else if listType == 2 {
-		source = 1
-	} else {
-		source = 2
-	}
+	//var source int
+	//if listType == 1 {
+	//	source = 3
+	//} else if listType == 2 {
+	//	source = 1
+	//} else {
+	//	source = 2
+	//}
 	//如果是有效用户就记录搜索历史
-	if user.UserId > 0 {
-		go services.AddSearchKeyWord(user, keyWord, source)
-	}
+	//if user.UserId > 0 {
+	//	go services.AddSearchKeyWord(user, keyWord, source)
+	//}
 	if chartTotal > int(total) {
 		total = int64(chartTotal)
 	}
@@ -344,3 +344,67 @@ func (this *MobileSearchController) BrowseHistoryList() {
 	br.Success = true
 	br.Data = resp
 }
+
+// @Title 综合搜索接口
+// @Description 综合搜索接口
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   KeyWord   query   string  true       "搜索关键词"
+// @Success 200 {object} models.SearchItem
+// @router /comprehensive/list [get]
+func (this *MobileSearchController) ComprehensiveList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = paging.StartIndex(currentIndex, pageSize)
+	keyWord := this.GetString("KeyWord")
+	if keyWord == "" {
+		br.Msg = "请输入搜索词"
+		br.ErrMsg = "请输入搜索词"
+		return
+	}
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	resp := new(models.HomeResourceDataListNewResp)
+	tmpResult, tmpTotalResult, err := services.EsComprehensiveSearch(keyWord, startSize, pageSize)
+	if err != nil {
+		br.Msg = "检索失败"
+		br.ErrMsg = "检索失败,Err:" + err.Error()
+		return
+	}
+
+	list, err := services.GetResourceDataEsList(tmpResult, user)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取数据失败,Err:" + err.Error()
+		return
+	}
+	if len(list) == 0 {
+		list = make([]*models.CygxResourceDataNewResp, 0)
+	}
+	if currentIndex == 1 {
+		go services.AddSearchKeyWord(user, keyWord, 1)
+	}
+	resp.List = list
+	page := paging.GetPaging(currentIndex, pageSize, int(tmpTotalResult))
+	resp.Paging = page
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}

+ 26 - 25
models/home.go

@@ -49,31 +49,32 @@ type HomeArticle struct {
 }
 
 type ArticleListResp struct {
-	ArticleId           int    `description:"文章id"`
-	Title               string `description:"标题"`
-	TitleEn             string `description:"英文标题 "`
-	PublishDate         string `description:"发布时间"`
-	Body                string `description:"内容"`
-	Abstract            string `description:"摘要"`
-	ExpertBackground    string `description:"专家背景"`
-	IsResearch          bool   `description:"是否属于研选"`
-	Pv                  int    `description:"PV"`
-	ImgUrlPc            string `description:"图片链接"`
-	CategoryId          string `description:"文章分类"`
-	HttpUrl             string `description:"文章链接跳转地址"`
-	IsNeedJump          bool   `description:"是否需要跳转链接地址"`
-	Source              int    `description:"来源  1:文章, 2:图表"`
-	Annotation          string `description:"核心观点"`
-	ChartPermissionName string `description:"权限名称"`
-	ArticleTypeId       int    `description:"文章类型ID判断是否是研选使用"`
-	BodyImg             string `description:"文章封面图片"`
-	DepartmentId        int    `description:"作者Id"`
-	NickName            string `description:"作者昵称"`
-	IsCollect           bool   `description:"本人是否收藏"`
-	IsRed               bool   `description:"是否标红"`
-	CollectNum          int    `description:"收藏人数"`
-	Resource            int    `description:"来源类型,1:文章、2:产品内测"`
-	Cover               string `description:"封面图片"`
+	ArticleId           int      `description:"文章id"`
+	Title               string   `description:"标题"`
+	TitleEn             string   `description:"英文标题 "`
+	PublishDate         string   `description:"发布时间"`
+	Body                string   `description:"内容"`
+	Abstract            string   `description:"摘要"`
+	ExpertBackground    string   `description:"专家背景"`
+	IsResearch          bool     `description:"是否属于研选"`
+	Pv                  int      `description:"PV"`
+	ImgUrlPc            string   `description:"图片链接"`
+	CategoryId          string   `description:"文章分类"`
+	HttpUrl             string   `description:"文章链接跳转地址"`
+	IsNeedJump          bool     `description:"是否需要跳转链接地址"`
+	Source              int      `description:"来源  1:文章, 2:图表"`
+	Annotation          string   `description:"核心观点"`
+	ChartPermissionName string   `description:"权限名称"`
+	ArticleTypeId       int      `description:"文章类型ID判断是否是研选使用"`
+	BodyImg             string   `description:"文章封面图片"`
+	DepartmentId        int      `description:"作者Id"`
+	NickName            string   `description:"作者昵称"`
+	IsCollect           bool     `description:"本人是否收藏"`
+	IsRed               bool     `description:"是否标红"`
+	CollectNum          int      `description:"收藏人数"`
+	Resource            int      `description:"来源类型,1:文章、2:产品内测"`
+	Cover               string   `description:"封面图片"`
+	BodyHighlight       []string `description:"搜索高亮展示结果"`
 	List                []*IndustrialManagementIdInt
 }
 

+ 23 - 0
models/industrial_article_group_subject.go

@@ -0,0 +1,23 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+)
+
+// 标的列表
+func GetIndustrialArticleGroupSubjectListByHz(IndustrialManagementId int) (items []*IndustrialSubject, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			i.* 
+		FROM
+			cygx_industrial_subject AS i
+			INNER JOIN cygx_industrial_article_group_subject AS sg ON sg.industrial_subject_id = i.industrial_subject_id
+			INNER JOIN cygx_article AS a ON a.article_id = sg.article_id 
+		WHERE
+			i.industrial_management_id = ? 
+			AND a.article_type_id = 0 
+		GROUP BY
+			i.industrial_subject_id `
+	_, err = o.Raw(sql, IndustrialManagementId).QueryRows(&items)
+	return
+}

+ 3 - 0
models/resource_data.go

@@ -86,6 +86,8 @@ type HomeResourceDataListNewResp struct {
 
 type CygxResourceDataNewResp struct {
 	Id                 int                                     `orm:"column(id);pk"`
+	BodyHighlight      []string                                `description:"搜索高亮展示结果"`
+	TitleHighlight     string                                  `description:"搜索高亮展示结果"`
 	SourceId           int                                     `description:"资源ID"`
 	Source             string                                  `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
 	PublishDate        string                                  `description:"发布时间"`
@@ -100,6 +102,7 @@ type CygxResourceDataNewResp struct {
 	Minutessummary     *CygxReportSelectionRep                 `description:"上周纪要汇总"`
 	Meetingreviewchapt *CygxMorningMeetingGatherDetailListResp `description:"晨会精华"`
 	ProductInterior    *CygxProductInteriorResp                `description:"产品内测"`
+	IndustrialResource *IndustrialManagement                   `description:"产业资源包"`
 }
 
 // 列表

+ 9 - 0
routers/commentsRouter.go

@@ -583,6 +583,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileSearchController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MobileSearchController"],
+        beego.ControllerComments{
+            Method: "ComprehensiveList",
+            Router: `/comprehensive/list`,
+            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",

+ 823 - 0
services/es_comprehensive.go

@@ -0,0 +1,823 @@
+package services
+
+import (
+	"context"
+	"encoding/json"
+	"fmt"
+	"hongze/hongze_clpt/models"
+	"hongze/hongze_clpt/utils"
+	"strconv"
+	//"strconv"
+	"errors"
+	"strings"
+	"time"
+)
+
+type SearchComprehensiveItem struct {
+	SourceId     int    `description:"资源ID"`
+	IsSummary    int    `description:"是否是纪要"`
+	Source       string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial 、 本周研究汇总: researchsummary 、 上周纪要汇总 :minutessummary 、晨会精华 :meetingreviewchapt  、 产品内测:productinterior"`
+	Title        string `description:"标题"`
+	BodyText     string `description:"内容"`
+	PublishDate  string `description:"发布时间"`
+	Abstract     string `description:"摘要"`
+	Annotation   string `description:"核心观点"`
+	IndustryName string `description:"产业名称"`
+	SubjectNames string `description:"标的名称"`
+	Body         []string
+}
+
+type ElasticComprehensiveDetail struct {
+	SourceId int `description:"资源ID"`
+	//IsSummary    int    `description:"是否是纪要"`
+	Source       string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial 、 本周研究汇总: researchsummary 、 上周纪要汇总 :minutessummary 、晨会精华 :meetingreviewchapt  、 产品内测:productinterior 、 产业资源包:industrialsource"`
+	Title        string `description:"标题"`
+	BodyText     string `description:"内容"`
+	PublishDate  string `description:"发布时间"`
+	Abstract     string `description:"摘要"`
+	Annotation   string `description:"核心观点"`
+	IndustryName string `description:"产业名称"`
+	SubjectNames string `description:"标的名称"`
+}
+
+func EsComprehensiveSearch(keyWord string, startSize, pageSize int) (result []*SearchComprehensiveItem, total int64, err error) {
+	indexName := utils.IndexNameComprehensive
+	client := utils.Client
+	keyWordArr, err := GetIndustryMapNameSliceV3(keyWord)
+	keyWordArr = RemoveDuplicatesAndEmpty(keyWordArr)
+	keyWordLen := len(keyWordArr)
+	if keyWordLen <= 0 {
+		keyWordArr = append(keyWordArr, keyWord)
+		keyWordLen = len(keyWordArr)
+	}
+
+	//Es 的高级查询有 自定义排序 文档一时半会儿撸不懂,先做多次查询手动过滤 2023.2.2
+	//ikType 查询方式 ,0:查所有 、 1:查询键入词 、 2:查询除了查询键入词之外的联想词
+	mustMap := make([]interface{}, 0)
+	shouldMap := make(map[string]interface{}, 0)
+	shouldMapquery := make([]interface{}, 0)
+
+	mustNotMap := make([]interface{}, 0)
+	shouldNotMap := make(map[string]interface{}, 0)
+	shouldNotMapquery := make([]interface{}, 0)
+	// @Param   OrderColumn   query   int  true       "排序字段 ,Comprehensive综合 ,Matching匹配度 ,PublishDate 发布时间 "
+	//keyWordWeight := GetWeight(keyWordLen)
+	var boost int
+	//lenkeyWordArr := len(keyWordArr)
+	for k, v := range keyWordArr {
+		if k > 0 {
+			continue
+		}
+		if k == 0 {
+			boost = 2 * 1000
+		} else {
+			boost = 1
+		}
+
+		if v != "" {
+			shouldMapquery = append(shouldMapquery, map[string]interface{}{
+				"function_score": map[string]interface{}{
+					"query": map[string]interface{}{
+						"multi_match": map[string]interface{}{
+							//"boost":  (lenkeyWordArr - k) * boost, //给查询的值赋予权重
+							"boost":  boost, //给查询的值赋予权重
+							"fields": []interface{}{"Title"},
+							"query":  v,
+						},
+					},
+				},
+			})
+			shouldMapquery = append(shouldMapquery, map[string]interface{}{
+				"function_score": map[string]interface{}{
+					"query": map[string]interface{}{
+						"multi_match": map[string]interface{}{
+							"boost":  boost, //给查询的值赋予权重
+							"fields": []interface{}{"Abstract"},
+							"query":  v,
+						},
+					},
+				},
+			})
+			shouldMapquery = append(shouldMapquery, map[string]interface{}{
+				"function_score": map[string]interface{}{
+					"query": map[string]interface{}{
+						"multi_match": map[string]interface{}{
+							"boost":  boost, //给查询的值赋予权重
+							"fields": []interface{}{"Annotation"},
+							"query":  v,
+						},
+					},
+				},
+			})
+
+			//shouldMapquery = append(shouldMapquery, map[string]interface{}{
+			//	"function_score": map[string]interface{}{
+			//		"query": map[string]interface{}{
+			//			"multi_match": map[string]interface{}{
+			//				//"boost":  (lenkeyWordArr-k)*boost - 1, //给查询的值赋予权重
+			//				"boost":  boost, //给查询的值赋予权重
+			//				"fields": []interface{}{"BodyText"},
+			//				"query":  v,
+			//			},
+			//		},
+			//	},
+			//})
+
+			shouldMapquery = append(shouldMapquery, map[string]interface{}{
+				"function_score": map[string]interface{}{
+					"query": map[string]interface{}{
+						"multi_match": map[string]interface{}{
+							//"boost":  (lenkeyWordArr-k)*boost - 1, //给查询的值赋予权重
+							"boost":  boost, //给查询的值赋予权重
+							"fields": []interface{}{"IndustryName"},
+							"query":  v,
+						},
+					},
+				},
+			})
+
+			shouldMapquery = append(shouldMapquery, map[string]interface{}{
+				"function_score": map[string]interface{}{
+					"query": map[string]interface{}{
+						"multi_match": map[string]interface{}{
+							//"boost":  (lenkeyWordArr-k)*boost - 1, //给查询的值赋予权重
+							"boost":  boost, //给查询的值赋予权重
+							"fields": []interface{}{"SubjectNames"},
+							"query":  v,
+						},
+					},
+				},
+			})
+		}
+	}
+	shouldMap = map[string]interface{}{
+		"should": shouldMapquery,
+	}
+
+	shouldNotMap = map[string]interface{}{
+		"should": shouldNotMapquery,
+	}
+	//排序
+	sortMap := make([]interface{}, 0)
+
+	//时间
+	sortMap = append(sortMap, map[string]interface{}{
+		"PublishDate": map[string]interface{}{
+			"order": "desc",
+		},
+	})
+	//sortMap = append(sortMap, map[string]interface{}{
+	//	"_score": map[string]interface{}{
+	//		"order": "desc",
+	//	},
+	//})
+	//高亮
+	highlightMap := make(map[string]interface{}, 0)
+	highlightMap = map[string]interface{}{
+		"fields": map[string]interface{}{
+			//"BodyText":   map[string]interface{}{},
+			"Title":      map[string]interface{}{},
+			"Abstract":   map[string]interface{}{},
+			"Annotation": map[string]interface{}{},
+		},
+		//样式 红色
+		"post_tags":     []interface{}{"</font>"},
+		"pre_tags":      []interface{}{"<font color='red'>"},
+		"fragment_size": 50,
+	}
+
+	mustMap = append(mustMap, map[string]interface{}{
+		"bool": shouldMap,
+	})
+	mustNotMap = append(mustNotMap, map[string]interface{}{
+		"bool": shouldNotMap,
+	})
+
+	queryMap := map[string]interface{}{
+		"query": map[string]interface{}{
+			"bool": map[string]interface{}{
+				"must": mustMap,
+			},
+		},
+	}
+
+	queryMap["sort"] = sortMap
+	queryMap["from"] = startSize
+	queryMap["size"] = pageSize
+	queryMap["highlight"] = highlightMap
+	//jsonBytes, _ := json.Marshal(queryMap)
+	//fmt.Println(string(jsonBytes))
+	//utils.FileLog.Info(string(jsonBytes))
+	request := client.Search(indexName).Source(queryMap) // sets the JSON request
+	searchByMatch, err := request.Do(context.Background())
+	if searchByMatch != nil {
+		if searchByMatch.Hits != nil {
+			for _, v := range searchByMatch.Hits.Hits {
+				var isAppend bool
+				articleJson, err := v.Source.MarshalJSON()
+				if err != nil {
+					return nil, 0, err
+				}
+				article := new(ElasticComprehensiveDetail)
+				err = json.Unmarshal(articleJson, &article)
+				if err != nil {
+					return nil, 0, err
+				}
+				//fmt.Println(article.SourceId, article.Title, article.Source)
+				searchItem := new(SearchComprehensiveItem)
+				searchItem.SourceId = article.SourceId
+				if len(v.Highlight["Annotation"]) > 0 {
+					for _, vText := range v.Highlight["Annotation"] {
+						searchItem.Body = append(searchItem.Body, vText)
+					}
+				}
+				if len(v.Highlight["Abstract"]) > 0 {
+					for _, vText := range v.Highlight["Abstract"] {
+						searchItem.Body = append(searchItem.Body, vText)
+					}
+				}
+				if len(v.Highlight["BodyText"]) > 0 {
+					for _, vText := range v.Highlight["BodyText"] {
+						searchItem.Body = append(searchItem.Body, vText)
+					}
+				}
+				//searchItem.IsSummary = article.IsSummary
+				//if len(searchItem.Body) == 0 {
+				//	bodyRune := []rune(article.BodyText)
+				//	bodyRuneLen := len(bodyRune)
+				//	if bodyRuneLen > 100 {
+				//		bodyRuneLen = 100
+				//	}
+				//	body := string(bodyRune[:bodyRuneLen])
+				//	searchItem.Body = []string{body}
+				//}
+				var title string
+				if len(v.Highlight["Title"]) > 0 {
+					title = v.Highlight["Title"][0]
+				} else {
+					title = article.Title
+				}
+				searchItem.Title = title
+				searchItem.Source = article.Source
+				searchItem.PublishDate = article.PublishDate
+
+				if !isAppend {
+					result = append(result, searchItem)
+				}
+			}
+		}
+		total = searchByMatch.Hits.TotalHits.Value
+	}
+	return
+}
+
+func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserItem) (items []*models.CygxResourceDataNewResp, err error) {
+	var condition string
+	var pars []interface{}
+	uid := user.UserId
+	titleHighlight := make(map[int]string)
+	bodyHighlight := make(map[int][]string)
+	mapItems := make(map[string]*models.CygxResourceDataNewResp)
+	for _, v := range list {
+		//预处理文章
+		item := new(models.CygxResourceDataNewResp)
+		item.SourceId = v.SourceId
+		item.Source = v.Source
+		item.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
+		item.BodyHighlight = v.Body
+		item.TitleHighlight = v.Title
+		titleHighlight[v.SourceId] = v.Title
+		bodyHighlight[v.SourceId] = v.Body
+		mapItems[fmt.Sprint(v.Source, v.SourceId)] = item
+	}
+
+	var articleIds []int              //报告
+	var newchartIds []int             //图表
+	var roadshowIds []string          //微路演
+	var activityIds []int             //活动
+	var activityvideoIds []string     // 活动视频
+	var activityvoiceIds []string     //活动音频
+	var activityspecialIds []int      //专项调研活动
+	var researchsummaryIds []int      //本周研究汇总
+	var minutessummaryIds []int       //上周纪要汇总
+	var meetingreviewchaptIds []int   //晨会精华
+	var productinteriorIds []int      //产品内测
+	var industrialResourceIdsHz []int // 弘则产业资源包
+	var industrialResourceIdsYx []int // 研选产业资源包
+	//Source      string    `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial 、 本周研究汇总: researchsummary 、 上周纪要汇总 :minutessummary 、晨会精华 :meetingreviewchapt  、 产品内测:productinterior
+	for _, v := range list {
+		if v.Source == "article" {
+			articleIds = append(articleIds, v.SourceId)
+		} else if v.Source == "newchart" {
+			newchartIds = append(newchartIds, v.SourceId)
+		} else if v.Source == "roadshow" {
+			roadshowIds = append(roadshowIds, strconv.Itoa(v.SourceId))
+		} else if v.Source == "activity" {
+			activityIds = append(activityIds, v.SourceId)
+		} else if v.Source == "activityvideo" {
+			activityvideoIds = append(activityvideoIds, strconv.Itoa(v.SourceId))
+		} else if v.Source == "activityvoice" {
+			activityvoiceIds = append(activityvoiceIds, strconv.Itoa(v.SourceId))
+		} else if v.Source == "activityspecial" {
+			activityspecialIds = append(activityspecialIds, v.SourceId)
+		} else if v.Source == "researchsummary" {
+			researchsummaryIds = append(researchsummaryIds, v.SourceId)
+		} else if v.Source == "minutessummary" {
+			minutessummaryIds = append(minutessummaryIds, v.SourceId)
+		} else if v.Source == "meetingreviewchapt" {
+			meetingreviewchaptIds = append(meetingreviewchaptIds, v.SourceId)
+		} else if v.Source == "productinterior" {
+			productinteriorIds = append(productinteriorIds, v.SourceId)
+		} else if v.Source == "industrialsourceHz" {
+			industrialResourceIdsHz = append(industrialResourceIdsHz, v.SourceId)
+		} else if v.Source == "industrialsourceYx" {
+			industrialResourceIdsYx = append(industrialResourceIdsYx, v.SourceId)
+		}
+	}
+	detail, e := models.GetConfigByCode("city_img_url")
+	if e != nil {
+		err = errors.New("GetResourceDataList, Err: " + e.Error())
+		return
+	}
+	detailChart, e := models.GetConfigByCode("chart_img_url")
+	if e != nil {
+		err = errors.New("GetResourceDataList, Err: " + e.Error())
+		return
+	}
+	addressList := strings.Split(detail.ConfigValue, "{|}")
+	mapAddress := make(map[string]string)
+	chartList := strings.Split(detailChart.ConfigValue, "{|}")
+	mapChart := make(map[string]string)
+	var cityName string
+	var chartName string
+	var imgUrl string
+	var imgUrlChart string
+	for _, v := range addressList {
+		vslice := strings.Split(v, "_")
+		cityName = vslice[0]
+		imgUrl = vslice[len(vslice)-1]
+		mapAddress[cityName] = imgUrl
+	}
+	for _, v := range chartList {
+		vslice := strings.Split(v, "_")
+		chartName = vslice[0]
+		imgUrlChart = vslice[len(vslice)-1]
+		mapChart[chartName] = imgUrlChart
+	}
+	var imgUrlResp string
+
+	//处理文章
+	if len(articleIds) > 0 {
+		pars = make([]interface{}, 0)
+		condition = ` AND a.article_id IN (` + utils.GetOrmInReplace(len(articleIds)) + `)`
+		pars = append(pars, articleIds)
+		articleList, e := models.GetHomeListPublic(condition, pars, 0, len(articleIds))
+		if e != nil {
+			err = errors.New("GetResourceDataList, Err: " + e.Error())
+			return
+		}
+
+		articleList, e = HandleArticleCategoryImg(articleList, user)
+		if e != nil {
+			err = errors.New("HandleArticleCategoryImg, Err: " + e.Error())
+			return
+		}
+		for _, v := range articleList {
+			v.Body = ""
+			if titleHighlight[v.ArticleId] != "" {
+				v.Title = titleHighlight[v.ArticleId]
+			}
+			if len(bodyHighlight[v.ArticleId]) > 0 {
+				v.Abstract = ""
+				v.Annotation = ""
+				v.BodyHighlight = bodyHighlight[v.ArticleId]
+			} else {
+				v.BodyHighlight = make([]string, 0)
+			}
+			mapItems[fmt.Sprint("article", v.ArticleId)].Article = v
+		}
+	}
+
+	//处理晨会精华
+	if len(meetingreviewchaptIds) > 0 {
+		pars = make([]interface{}, 0)
+		condition = ` AND c.id IN (` + utils.GetOrmInReplace(len(meetingreviewchaptIds)) + `)`
+		pars = append(pars, meetingreviewchaptIds)
+
+		listrMeet, e := models.GetCygxMorningMeetingReviewChapterList(condition, pars)
+		if e != nil {
+			err = errors.New("GetResourceDataList, Err: " + e.Error())
+			return
+		}
+		for _, v := range listrMeet {
+			v.Content = AnnotationHtml(v.Content)
+			v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
+			mapItems[fmt.Sprint("meetingreviewchapt", v.Id)].Meetingreviewchapt = v
+		}
+	}
+
+	//处理上周纪要汇总
+	if len(minutessummaryIds) > 0 {
+		pars = make([]interface{}, 0)
+		condition = ` AND article_id IN (` + utils.GetOrmInReplace(len(minutessummaryIds)) + `)`
+		pars = append(pars, minutessummaryIds)
+
+		listresearchsummary, e := models.GetReportSelectionListHome(condition, "cygx_minutes_summary", pars, 0, len(minutessummaryIds))
+		if e != nil {
+			err = errors.New("GetResourceDataList, Err: " + e.Error())
+			return
+		}
+		for _, v := range listresearchsummary {
+			v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
+			mapItems[fmt.Sprint("minutessummary", v.ArticleId)].Minutessummary = v
+		}
+	}
+
+	//处理本周纪要汇总
+	if len(researchsummaryIds) > 0 {
+		pars = make([]interface{}, 0)
+		condition = ` AND article_id IN (` + utils.GetOrmInReplace(len(researchsummaryIds)) + `)`
+		pars = append(pars, researchsummaryIds)
+
+		listresearchsummary, e := models.GetReportSelectionListHome(condition, "cygx_research_summary", pars, 0, len(researchsummaryIds))
+		if e != nil {
+			err = errors.New("GetReportSelectionListHome, Err: " + e.Error())
+			return
+		}
+		for _, v := range listresearchsummary {
+			v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
+			mapItems[fmt.Sprint("researchsummary", v.ArticleId)].Researchsummary = v
+		}
+	}
+
+	//处理产品内测
+	if len(productinteriorIds) > 0 {
+		pars = make([]interface{}, 0)
+		condition = `  AND art.status = 1 AND art.product_interior_id  IN (` + utils.GetOrmInReplace(len(productinteriorIds)) + `)`
+		pars = append(pars, productinteriorIds)
+		listProductInterior, e := models.GetCygxProductInteriorList(condition, pars, 0, len(productinteriorIds))
+		if e != nil {
+			err = errors.New("GetCygxProductInteriorList, Err: " + e.Error())
+			return
+		}
+		for _, v := range listProductInterior {
+			v.Body = ProductInteriorHtml(v.Body)
+			v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
+			mapItems[fmt.Sprint("productinterior", v.ProductInteriorId)].ProductInterior = v
+		}
+	}
+
+	//处理活动
+	if len(activityIds) > 0 {
+		for _, vss := range activityIds {
+			imgUrlResp += strconv.Itoa(vss) + ","
+		}
+		pars = make([]interface{}, 0)
+		condition = ` AND art.activity_id IN (` + utils.GetOrmInReplace(len(activityIds)) + `)   `
+		pars = append(pars, activityIds)
+		activityList, e := models.GetActivityListNew(condition, pars, uid, 0, len(activityIds), 0, 0, "")
+		if e != nil {
+			err = errors.New("GetResourceDataList, Err: " + e.Error())
+			return
+		}
+		var activityListRersp []*models.ActivityListResp
+		for _, v := range activityList {
+			activityListRersp = append(activityListRersp, ActivityButtonShow(v, user, make([]string, 0)))
+		}
+		//处理不同的报名方式按钮回显
+		mapActivitySignup, e := GetActivitySignupResp(activityIds, user)
+		if e != nil {
+			err = errors.New("GetActivitySignupResp, Err: " + e.Error())
+			return
+		}
+		for _, v := range activityListRersp {
+			if v == nil {
+				continue
+			}
+			if v.ActivityType == 0 {
+				if mapAddress[v.City] != "" {
+					imgUrlResp = mapAddress[v.City]
+				} else {
+					imgUrlResp = mapAddress["其它"]
+				}
+			} else {
+				if mapChart[v.ChartPermissionName] != "" {
+					imgUrlResp = mapChart[v.ChartPermissionName]
+				}
+			}
+			v.ImgUrl = imgUrlResp
+			v.SourceType = mapActivitySignup[v.ActivityId]
+			mapItems[fmt.Sprint("activity", v.ActivityId)].Activity = v
+		}
+	}
+
+	//产业资源包
+	if len(industrialResourceIdsHz) > 0 {
+		pars = make([]interface{}, 0)
+
+		var industrialResourceIdstring []string
+		for _, v := range industrialResourceIdsHz {
+			industrialResourceIdstring = append(industrialResourceIdstring, strconv.Itoa(v))
+		}
+		industrialId := strings.Join(industrialResourceIdstring, ",")
+		condition = ` AND  m.industrial_management_id IN  (` + industrialId + `)  AND a.article_type_id = 0 `
+		listIndustrialResourceIds, e := models.GetSearchResourceList(condition)
+		if e != nil {
+			err = errors.New("GetSearchResourceList, Err: " + e.Error())
+			return
+		}
+		conditionSubject := condition + ` AND 	m.industrial_management_id  IN (` + utils.GetOrmInReplace(len(industrialResourceIdsHz)) + `)`
+		pars = append(pars, industrialResourceIdsHz)
+		listSubjcet, e := models.GetIndustrialSubjectAllByIndustrialId(pars, conditionSubject)
+		//合并产业关联的标的
+		if e != nil {
+			e = errors.New("GetIndustrialSubjectAllByIndustrialId, Err: " + e.Error())
+			return
+		}
+		mapIndustrial := make(map[string]int)
+		for _, v := range listSubjcet {
+			for k2, v2 := range listIndustrialResourceIds {
+				if v2.IndustrialManagementId == v.IndustrialManagementId && mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] == 0 {
+					listIndustrialResourceIds[k2].IndustrialSubjectList = append(listIndustrialResourceIds[k2].IndustrialSubjectList, v)
+					mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] = 1
+				}
+			}
+		}
+		//listIndustrialResourceIds, _ = HandleIndustryList(listIndustrialResourceIds, user, "Hz")
+		for _, v := range listIndustrialResourceIds {
+			v.Source = 1
+			mapItems[fmt.Sprint("industrialsourceHz", v.IndustrialManagementId)].IndustrialResource = v
+		}
+	}
+
+	//产业资源包
+	if len(industrialResourceIdsYx) > 0 {
+		pars = make([]interface{}, 0)
+
+		var industrialResourceIdstring []string
+		for _, v := range industrialResourceIdsYx {
+			industrialResourceIdstring = append(industrialResourceIdstring, strconv.Itoa(v))
+		}
+		industrialId := strings.Join(industrialResourceIdstring, ",")
+		condition = ` AND  m.industrial_management_id IN  (` + industrialId + `)  AND a.article_type_id > 0 `
+		listIndustrialResourceIds, e := models.GetSearchResourceList(condition)
+		if e != nil {
+			err = errors.New("GetSearchResourceList, Err: " + e.Error())
+			return
+		}
+		fmt.Println(listIndustrialResourceIds)
+		conditionSubject := condition + ` AND 	m.industrial_management_id  IN (` + utils.GetOrmInReplace(len(industrialResourceIdsYx)) + `)`
+		pars = append(pars, industrialResourceIdsYx)
+		listSubjcet, e := models.GetIndustrialSubjectAllByIndustrialId(pars, conditionSubject)
+		//合并产业关联的标的
+		if e != nil {
+			e = errors.New("GetIndustrialSubjectAllByIndustrialId, Err: " + e.Error())
+			return
+		}
+		mapIndustrial := make(map[string]int)
+		for _, v := range listSubjcet {
+			for k2, v2 := range listIndustrialResourceIds {
+				if v2.IndustrialManagementId == v.IndustrialManagementId && mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] == 0 {
+					listIndustrialResourceIds[k2].IndustrialSubjectList = append(listIndustrialResourceIds[k2].IndustrialSubjectList, v)
+					mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] = 1
+				}
+			}
+		}
+		//listIndustrialResourceIds, _ = HandleIndustryList(listIndustrialResourceIds, user, "Yx")
+		for _, v := range listIndustrialResourceIds {
+			v.Source = 2
+			mapItems[fmt.Sprint("industrialsourceYx", v.IndustrialManagementId)].IndustrialResource = v
+		}
+	}
+
+	//处理图表
+	if len(newchartIds) > 0 {
+		pars = make([]interface{}, 0)
+		condition = ` AND a.chart_id IN (` + utils.GetOrmInReplace(len(newchartIds)) + `)`
+		pars = append(pars, newchartIds)
+		chartDateList, e := models.GetChartListCollection(condition, pars, uid, 0, len(newchartIds))
+		if e != nil {
+			err = errors.New("GetResourceDataList, Err: " + e.Error())
+			return
+		}
+		for _, v := range chartDateList {
+			mapItems[fmt.Sprint("newchart", v.ChartId)].Newchart = v
+		}
+	}
+
+	//处理专项调研
+	if len(activityspecialIds) > 0 {
+		pars = make([]interface{}, 0)
+		condition = ` AND art.activity_id IN (` + utils.GetOrmInReplace(len(activityspecialIds)) + `)`
+		pars = append(pars, activityspecialIds)
+		activitySpeciallist, e := models.GetCygxActivitySpecialDetailList(condition, pars, user.UserId, 0, len(activityspecialIds))
+		if e != nil {
+			err = errors.New("GetCygxActivitySpecialDetailList, Err: " + e.Error())
+			return
+		}
+		UserMap, e := GetSpecialTripUserMap(activityspecialIds, user.UserId)
+		if e != nil {
+			err = errors.New("GetSpecialTripUserMap, Err: " + e.Error())
+			return
+		}
+		for _, v := range activitySpeciallist {
+			if mapChart[v.ChartPermissionName] != "" {
+				imgUrlResp = mapChart[v.ChartPermissionName]
+			}
+			if _, ok := UserMap[v.ActivityId]; ok {
+				v.IsTrip = 1
+			}
+			if v.Days == 0 {
+				v.TripStatus = 1
+				v.TripImgLink = v.TripImgLink
+			} else {
+				v.TripStatus = 2
+				v.TripImgLink = v.TripImgLinkFix
+				v.ActivityTimeText = v.ActivityTimeTextByDay
+			}
+			resultTimeStart := utils.StrTimeToTime(v.ActivityTime)  //时间字符串格式转时间格式
+			resultTimeEnd := utils.StrTimeToTime(v.ActivityTimeEnd) //时间字符串格式转时间格式
+			if resultTimeStart.After(time.Now()) {
+				v.ActiveState = "1"
+			} else if time.Now().After(resultTimeEnd) {
+				v.ActiveState = "3"
+			} else {
+				v.ActiveState = "2"
+			}
+			v.ImgUrl = imgUrlResp
+			mapItems[fmt.Sprint("activityspecial", v.ActivityId)].Activityspecial = v
+
+		}
+	}
+
+	//处理路演 处理路活动视频 处理路活音频
+	if len(roadshowIds)+len(activityvideoIds)+len(activityvoiceIds) > 0 {
+
+		audioIdstr := strings.Join(activityvoiceIds, ",")
+		ideoIdsStr := strings.Join(roadshowIds, ",")
+		activityVideoIdsStr := strings.Join(activityvideoIds, ",")
+
+		list, _, e := GetMicroRoadShowMycollect(len(roadshowIds)+len(activityvideoIds)+len(activityvoiceIds), 0, audioIdstr, ideoIdsStr, activityVideoIdsStr)
+		if e != nil {
+			err = errors.New("GetMicroRoadShowMycollect, Err: " + e.Error())
+			return
+		}
+		fmt.Println("list", list)
+		for _, item := range list {
+			if item.Type == 1 {
+				//音频
+				count, e := models.GetVoiceCollectCount(user.UserId, item.Id)
+				if e != nil {
+					err = errors.New("GetVoiceCollectCount, Err: " + e.Error())
+					return
+				}
+				if count > 0 {
+					item.IsCollect = true
+				}
+			} else if item.Type == 2 {
+				//活动视频
+				count, e := models.GetActivityVideoCollectCount(user.UserId, item.Id)
+				if e != nil {
+					err = errors.New("GetActivityVideoCollectCount, Err: " + e.Error())
+					return
+				}
+				if count > 0 {
+					item.IsCollect = true
+				}
+			} else if item.Type == 3 {
+				//微路演视频
+				count, e := models.GetVideoCollectCount(user.UserId, item.Id)
+				if e != nil {
+					err = errors.New("GetVideoCollectCount, Err: " + e.Error())
+					return
+				}
+				if count > 0 {
+					item.IsCollect = true
+				}
+			}
+		}
+		// 用户权限
+		authInfo, permissionArr, e := GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
+		if e != nil {
+			err = errors.New("GetUserRaiPermissionInfo, Err: " + e.Error())
+			return
+		}
+
+		// 获取默认图配置
+		audioMap, videoMap, audioShareMap, videoShareMap, e := GetMicroRoadShowDefaultImgConfig()
+		if e != nil {
+			err = errors.New("GetMicroRoadShowDefaultImgConfig, Err: " + e.Error())
+			return
+		}
+		//Source      string    `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
+		for i := range list {
+			// 权限
+			au := new(models.UserPermissionAuthInfo)
+			au.SellerName = authInfo.SellerName
+			au.SellerMobile = authInfo.SellerMobile
+			au.HasPermission = authInfo.HasPermission
+			au.OperationMode = authInfo.OperationMode
+			if au.HasPermission == 1 {
+				// 非宏观权限进一步判断是否有权限
+				if list[i].ChartPermissionId != utils.HONG_GUAN_ID && !utils.InArrayByStr(permissionArr, list[i].ChartPermissionName) {
+					au.HasPermission = 2
+				}
+			}
+			// 无权限的弹框提示
+			if au.HasPermission != 1 {
+				if au.OperationMode == UserPermissionOperationModeCall {
+					if list[i].Type == 1 {
+						au.PopupMsg = UserPermissionPopupMsgCallActivity
+					} else {
+						au.PopupMsg = UserPermissionPopupMsgCallMicroVideo
+					}
+				} else {
+					if list[i].Type == 1 {
+						au.PopupMsg = UserPermissionPopupMsgApplyActivity
+					} else {
+						au.PopupMsg = UserPermissionPopupMsgApplyMicroVideo
+					}
+				}
+			}
+			list[i].AuthInfo = au
+			list[i].PublishTime = utils.StrTimeToTime(list[i].PublishTime).Format(utils.FormatDate)
+			// 默认图
+			if list[i].BackgroundImg == "" {
+				if list[i].Type == 1 {
+					list[i].BackgroundImg = audioMap[list[i].ChartPermissionId]
+				} else {
+					list[i].BackgroundImg = videoMap[list[i].ChartPermissionId]
+				}
+			}
+			// 分享图
+			if list[i].ShareImg == "" {
+				if list[i].Type == 1 {
+					list[i].ShareImg = audioShareMap[list[i].ChartPermissionId]
+				} else {
+					list[i].ShareImg = videoShareMap[list[i].ChartPermissionId]
+				}
+			}
+		}
+		//Type                int    `description:"类型: 1-音频; 2-活动视频; 3-产业视频"`
+		for _, item := range list {
+			if item.Type == 1 {
+				mapItems[fmt.Sprint("activityvoice", item.Id)].Activityvoice = item
+			} else if item.Type == 2 {
+				mapItems[fmt.Sprint("activityvideo", item.Id)].Activityvideo = item
+			} else if item.Type == 3 {
+				mapItems[fmt.Sprint("roadshow", item.Id)].Roadshow = item
+			}
+		}
+	}
+	for _, vList := range list {
+		for _, v := range mapItems {
+			//如果这些类型都为空,那么就不合并
+			if v.Article == nil && v.Newchart == nil && v.Roadshow == nil && v.Activity == nil && v.Activityvideo == nil && v.Activityvoice == nil && v.Activityspecial == nil && v.Researchsummary == nil && v.Minutessummary == nil && v.Meetingreviewchapt == nil && v.ProductInterior == nil && v.IndustrialResource == nil {
+				continue
+			}
+			if v.Article != nil && v.SourceId == vList.SourceId {
+				v.Article.Title = vList.Title
+			}
+			if v.Newchart != nil && v.SourceId == vList.SourceId {
+				v.Newchart.Title = vList.Title
+			}
+			if v.Roadshow != nil && v.SourceId == vList.SourceId {
+				v.Roadshow.Title = vList.Title
+			}
+			if v.Activity != nil && v.SourceId == vList.SourceId {
+				v.Activity.ActivityName = vList.Title
+			}
+			if v.Activityvideo != nil && v.SourceId == vList.SourceId {
+				v.Activityvideo.Title = vList.Title
+			}
+			if v.Activityvoice != nil && v.SourceId == vList.SourceId {
+				v.Activityvoice.Title = vList.Title
+			}
+
+			if v.Activityspecial != nil && v.SourceId == vList.SourceId {
+				v.Activityspecial.ResearchTheme = vList.Title
+			}
+			if v.Researchsummary != nil && v.SourceId == vList.SourceId {
+				v.Researchsummary.Title = vList.Title
+			}
+			if v.Minutessummary != nil && v.SourceId == vList.SourceId {
+				v.Minutessummary.Title = vList.Title
+			}
+			if v.ProductInterior != nil && v.SourceId == vList.SourceId {
+				v.ProductInterior.Title = vList.Title
+			}
+			if v.IndustrialResource != nil && v.SourceId == vList.SourceId && v.Source == vList.Source {
+				v.IndustrialResource.UpdateTime = strings.Replace(vList.PublishDate, "00:00:00", "", -1)
+			}
+			if v.SourceId == vList.SourceId && v.Source == vList.Source {
+				items = append(items, v)
+			}
+		}
+	}
+	for _, v := range items {
+		if v.IndustrialResource != nil {
+			v.Source = "industrialsource"
+		}
+	}
+	return
+}

+ 13 - 10
services/keyword.go

@@ -10,11 +10,11 @@ import (
 
 // AddSearchKeyWord 记录用户搜索关键词
 func AddSearchKeyWord(user *models.WxUserItem, keyWord string, source int) (err error) {
-	cacheKey := fmt.Sprint("Search_uid:", user.UserId, "_KeyWord:", keyWord)
-	isExist := utils.Rc.IsExist(cacheKey)
-	if isExist {
-		return err
-	}
+	//cacheKey := fmt.Sprint("Search_uid:", user.UserId, "_KeyWord:", keyWord)
+	//isExist := utils.Rc.IsExist(cacheKey)
+	//if isExist {
+	//	return err
+	//}
 	defer func() {
 		if err != nil {
 			go utils.SendAlarmMsg(" 记录用户搜索关键词失败"+err.Error(), 2)
@@ -32,12 +32,12 @@ func AddSearchKeyWord(user *models.WxUserItem, keyWord string, source int) (err
 	keyWordItem.RealName = user.RealName
 	_, err = models.AddSearchKeyWord(keyWordItem)
 	go AddUserSearchLog(user, keyWord, source)
-	//一分钟之内的相同搜索词不重复记录
-	setNX := utils.Rc.SetNX(cacheKey, keyWord, time.Second*3)
-	if !setNX {
-		go utils.SendAlarmMsg("记录用户搜索关键词失败,设置Redis Key 过期时间失败:key"+cacheKey, 3)
-	}
 	go SearchKeywordUserRmind(user, keyWord)
+	//一分钟之内的相同搜索词不重复记录
+	//setNX := utils.Rc.SetNX(cacheKey, keyWord, time.Second*3)
+	//if !setNX {
+	//	go utils.SendAlarmMsg("记录用户搜索关键词失败,设置Redis Key 过期时间失败:key"+cacheKey, 3)
+	//}
 	return
 }
 
@@ -96,6 +96,9 @@ func SearchKeywordUserRmind(user *models.WxUserItem, keyWord string) (err error)
 			err = errors.New("GetSellerByAdminId, Err: " + e.Error())
 			return
 		}
+		if len(openIdList) == 0 {
+			return
+		}
 		first = fmt.Sprint(user.RealName, "--", user.CompanyName, ",有新的互动:搜索")
 		keyword1 = first
 		keyword2 = "搜索关键词:" + keyWord

+ 3 - 0
utils/config.go

@@ -36,6 +36,7 @@ var (
 	WxMsgTemplateIdAskMsgMobileAll    string //手机号用户【XXX】发送模板消rm --
 	WxMsgTemplateIdAskMsgXzs          string //手机号用户【XXX】发送模板消息模板ID(小助手)
 	IndexName                         string
+	IndexNameComprehensive            string //综合搜索Es索引
 	WxMsgTemplateIdAskMsgMobilePublic string //手机号用户【XXX】发送模板消rm --
 	WxMsgTemplateIdArticleUserRemind  string //用户阅读报告通知-模板ID
 
@@ -109,6 +110,7 @@ func init() {
 		WxOpenAppSecret = "0851cc85027c6eb74a400016648ecda8" //公众平台AppSecret
 
 		IndexName = "cygx_article_v03_23"
+		IndexNameComprehensive = "cygx_comprehensive"
 		ActSendMsgMobile = "15618524605"
 		SendWxTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_template_msg"
 	} else {
@@ -125,6 +127,7 @@ func init() {
 		WxOpenAppSecret = "7bf62d2d037280f8b635c6eca2f31db9" //公众平台AppSecret
 
 		IndexName = "cygx_article_v1"
+		IndexNameComprehensive = "cygx_comprehensive_test"
 		ActSendMsgMobile = "17634786714"
 		SendWxTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_template_msg"
 	}