Browse Source

Merge branch 'cygx_12.8' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 1 year ago
parent
commit
d16acd4774
3 changed files with 18 additions and 5 deletions
  1. 2 1
      controllers/yanxuan_special.go
  2. 4 3
      models/cygx_yanxuan_special.go
  3. 12 1
      services/es_comprehensive.go

+ 2 - 1
controllers/yanxuan_special.go

@@ -606,12 +606,13 @@ func (this *YanxuanSpecialController) Collect() {
 	var sellerName string
 
 	if req.Status == 1 {
-		sellerName, err = models.GetCompanySellerName(user.CompanyId)
+		sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
 		if err != nil {
 			br.Msg = "报名失败!"
 			br.ErrMsg = "获取对应销售失败,Err:" + err.Error()
 			return
 		}
+		sellerName = sellerItem.RealName
 		item := models.CygxYanxuanSpecialCollect{
 			UserId:           user.UserId,
 			Mobile:           user.Mobile,

+ 4 - 3
models/cygx_yanxuan_special.go

@@ -57,9 +57,10 @@ type CygxYanxuanSpecialItem struct {
 	CompanyTags     string
 	IndustryTags    string
 	Docs            []Doc
-	Annotation      string `description:"核心观点"`
-	Pv              string `description:"Pv"`
-	Uv              string `description:"Uv"`
+	Annotation      string   `description:"核心观点"`
+	Pv              string   `description:"Pv"`
+	Uv              string   `description:"Uv"`
+	BodyHighlight   []string `description:"搜索高亮展示结果"`
 }
 
 type CygxYanxuanSpecialResp struct {

+ 12 - 1
services/es_comprehensive.go

@@ -280,6 +280,7 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 	uid := user.UserId
 	titleHighlight := make(map[int]string)
 	bodyHighlight := make(map[int][]string)
+	yanXuanbodyHighlight := make(map[int][]string)
 	mapItems := make(map[string]*models.CygxResourceDataNewResp)
 	for _, v := range list {
 		//预处理文章
@@ -339,6 +340,7 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 			industrialResourceIdsYx = append(industrialResourceIdsYx, v.SourceId)
 		} else if v.Source == utils.CYGX_OBJ_YANXUANSPECIAL {
 			yanxuanSpecialIds = append(yanxuanSpecialIds, v.SourceId)
+			yanXuanbodyHighlight[v.SourceId] = v.Body
 		} else if v.Source == utils.CYGX_OBJ_ASKSERIEVIDEO {
 			askserieVideoIds = append(askserieVideoIds, strconv.Itoa(v.SourceId))
 		}
@@ -766,6 +768,12 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 		for _, v := range listyanxuanSpecial {
 			v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
 			v.Annotation, _ = GetReportContentTextSubNew(v.Content)
+			if len(yanXuanbodyHighlight[v.Id]) > 0 {
+				v.BodyHighlight = yanXuanbodyHighlight[v.Id]
+			} else {
+				v.BodyHighlight = append(v.BodyHighlight, v.Annotation)
+			}
+			v.Annotation = "" //强制置空,兼容前端优先级
 			mapItems[fmt.Sprint(utils.CYGX_OBJ_YANXUANSPECIAL, v.Id)].YanxuanSpecial = v
 		}
 	}
@@ -810,6 +818,9 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
 			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.YanxuanSpecial != nil && v.SourceId == vList.SourceId {
+				v.YanxuanSpecial.Title = vList.Title
+			}
 			if v.SourceId == vList.SourceId && v.Source == vList.Source {
 				items = append(items, v)
 			}
@@ -852,7 +863,7 @@ func EsAddYanxuanSpecial(sourceId int) {
 	item.BodyText = bodyText
 	item.Abstract = bodyText
 	item.IndustryName = detail.IndustryTags
-	item.SubjectNames = detail.SpecialName
+	item.SubjectNames = detail.CompanyTags + detail.Tags
 	if detail.Status == 3 {
 		EsAddOrEditComprehensiveData(item) //如果发布了就新增
 	} else {