Browse Source

Merge branch 'cygx_14.2' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

zhangchuanxing 2 months ago
parent
commit
d1e8cd58f7

+ 1 - 0
models/resource_data.go

@@ -22,6 +22,7 @@ type CygxResourceData struct {
 	SearchContent     string    `description:"搜索匹配用的内容"`
 	SearchOrderTime   string    `description:"搜索排序时间"`
 	TagName           string    `description:"标签名"`
+	Sort              int       `description:"排序"`
 }
 
 // FICC研报小程序

+ 5 - 0
services/article.go

@@ -878,6 +878,11 @@ func HandleArticleListByApi(artcleId int) (err error) {
 							keyword3 = v.Title
 							keyword4 = v.PublishDate.Format(utils.FormatDateTime)
 							SendWxMsgWithArticleClassToAdmin(keyword1, keyword2, keyword3, keyword4, openIdList, articleIdInt)
+
+							for _, vIndustrial := range listIndustrial {
+								IndustrialManagementTimeLineDateList3(vIndustrial.IndustrialManagementId) // 更新时间线报告内容
+							}
+
 						} else {
 							keyword1 = "新报告产业标签:【" + v.FieldName + "】,个股标签:" + subjectStr
 							keyword2 = "未归类"

+ 14 - 0
services/industrial_management.go

@@ -1258,6 +1258,20 @@ func extractTextBeforePeriodOrNewline(htmlContent string) (string, error) {
 	}
 }
 
+// 处理产业管理时间线相关内容的数据
+func UpdateIndustrialManagementTimeLineDateList3ByRedis() (err error) {
+	for {
+		utils.Rc.Brpop(utils.CYGX_ARTICLE_TIME_LINE_KEY, func(b []byte) {
+			var log models.IndustrialManagementCount
+			if err := json.Unmarshal(b, &log); err != nil {
+				fmt.Println("json unmarshal wrong!")
+				go utils.SendAlarmMsg("处理产业管理时间线相关内容的数据处理Redis队列消息失败: UpdateIndustrialManagementTimeLineDateList3ByRedis "+err.Error()+string(b), 2)
+			}
+			IndustrialManagementTimeLineDateList3(log.IndustrialManagementId)
+		})
+	}
+}
+
 //func init_14_2() {
 //SELECT  * FROM cygx_resource_data WHERE  source_id  IN (SELECT article_id  FROM   cygx_article WHERE series_name IN ('行业深度','季度策略') )   AND source = 'article'
 //}

+ 3 - 4
services/resource_data.go

@@ -633,10 +633,6 @@ func Deletenewchart(chartIdsDelete []int) (err error) {
 	return
 }
 
-//func init() {
-//	UpdateArticleResourceData(9050)
-//}
-
 // 更新文章
 func UpdateArticleResourceData(sourceId int) {
 	time.Sleep(1 * time.Second)
@@ -726,6 +722,9 @@ func UpdateArticleResourceData(sourceId int) {
 		item.PublishDate = publishDate
 		item.CreateTime = time.Now()
 		item.SearchTitle = detail.Title
+		if detail.SeriesName == "行业深度" || detail.SeriesName == "季度策略" {
+			item.Sort = 100 // 这两个类型优先展示
+		}
 		annotation, e := utils.GetHtmlContentText(detail.Annotation)
 		if e != nil && e.Error() != utils.ErrNoRow() {
 			err = errors.New("GetHtmlContentText, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))

+ 4 - 3
services/task.go

@@ -179,9 +179,10 @@ func Task() {
 	//	task.AddTask("getArticleListByApi", getArticleListByApi)
 	//}
 
-	go UserLabelLogReduce()              // 处理用户标签的队列消息
-	go YanXuanActivityPointsBillReduce() // 处理研选活动扣点
-	go UpdateArticleByRedis()            // 处理策略平台同步过来的文章
+	go UserLabelLogReduce()                                 // 处理用户标签的队列消息
+	go YanXuanActivityPointsBillReduce()                    // 处理研选活动扣点
+	go UpdateArticleByRedis()                               // 处理策略平台同步过来的文章
+	go UpdateIndustrialManagementTimeLineDateList3ByRedis() // 处理产业管理时间线相关内容的数据
 
 	//GetCygxActivityAttendanceDetail()
 	//CreateIndexNameArticleHistory()

+ 1 - 0
utils/constants.go

@@ -137,6 +137,7 @@ const (
 	CYGX_USER_KEY_LABEL              = "CYGX_USER_KEY_LABEL"              //查研观向用户标签
 	CYGX_YANXUAN_POINTS_KEY          = "CYGX_YANXUAN_POINTS_KEY"          //查研观向研选活动扣点KEY
 	CYGX_ARTICLE_UPDATE_KEY          = "CYGX_ARTICLE_UPDATE_KEY"          //策略平台更新文章key
+	CYGX_ARTICLE_TIME_LINE_KEY       = "CYGX_ARTICLE_TIME_LINE_KEY"       //产业时间线关联的文章key
 	//CYGX_RAI_SERVE_BILL_KEY          = "CYGX_RAI_SERVE_BILL_KEY"          //权益服务记录明细key
 )