浏览代码

Merge branch 'master' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

zhangchuanxing 4 月之前
父节点
当前提交
5afce236d1

+ 13 - 2
controllers/report.go

@@ -4019,13 +4019,24 @@ func (this *ReportController) ZhouqiTacticsList() {
 		return
 	}
 	var matchTypeName = []string{}
+	var seriesName = []string{}
 	for _, v := range listCategory {
-		matchTypeName = append(matchTypeName, v.MatchTypeName)
+		if v.MatchTypeName != "" {
+			matchTypeName = append(matchTypeName, v.MatchTypeName)
+		}
+
+		if v.SeriesName != "" {
+			seriesName = append(seriesName, v.SeriesName)
+		}
 	}
 
 	var condition string
 	//var pars []interface{}
-	condition = " AND field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')"
+	if len(seriesName) == 0 {
+		condition = " AND field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')"
+	} else {
+		condition = " AND  ( field_name  IN  ('" + strings.Join(matchTypeName, "','") + "')   OR series_name IN  ('" + strings.Join(seriesName, "','") + "')   )"
+	}
 
 	list, total, err = models.GetReportAndproductIndustrylListimgZhouqi(condition, startSize, pageSize)
 	if err != nil {

+ 1 - 0
models/article.go

@@ -45,6 +45,7 @@ type CygxArticle struct {
 	VideoPlaySeconds string `description:"音频播放时长"`
 	Stock            string `description:"个股标签"`
 	FieldName        string `description:"产业标签"`
+	SeriesName       string `description:"系列名称"`
 	Annotation       string `description:"核心观点"`
 	TypeName         string `description:"策略平台报告类型"`
 	ModifyTimeByCl   string `description:"策略平台报告更新时间"`

+ 8 - 0
models/cygx_yanxuan_special.go

@@ -395,3 +395,11 @@ func UpdateYanxuanSpecialLikeCountHistory() (err error) {
 	_, err = o.Raw(sql).Exec()
 	return
 }
+
+// UpdateYanxuanSpecialHzPv 修改研选专栏的阅读弘则Pv
+func Need_1006INIT(hz_pv, hz_uv, id int) (err error) {
+	o := orm.NewOrm()
+	sql := `UPDATE cygx_yanxuan_special SET hz_pv= ? , hz_uv = ?  WHERE id = ? `
+	_, err = o.Raw(sql, hz_pv, hz_uv, id).Exec()
+	return
+}

+ 1 - 1
models/report.go

@@ -1556,7 +1556,7 @@ func GetReportAndproductIndustrylListimgZhouqi(condition string, startSize, page
 		FROM
 			cygx_article AS art 
 		WHERE
-			art.publish_status = 1  ` + condition
+			art.publish_status = 1 	AND category_name = '周期'  ` + condition
 	totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
 	err = o.Raw(totalSql).QueryRow(&total)
 	sql += `    ORDER BY publish_date DESC LIMIT ?,? `

+ 1 - 0
models/tactics.go

@@ -80,6 +80,7 @@ type Tactics2 struct {
 	ReportType      int       `description:"报告类型,1行业报告,2产业报告,0无"`
 	Stock           string    `description:"个股标签"`
 	FieldName       string    `description:"产业标签"`
+	SeriesName      string    `description:"系列名称"`
 	File            string    `description:"Pdf下载链接"`
 	TypeName        string    `description:"策略平台报告类型"`
 	UpdateDate      string    `description:"策略平台报告更新时间"`

+ 3 - 0
models/zhouqi_article_map.go

@@ -8,6 +8,7 @@ type CygxZhouqiArticleMap struct {
 	CategoryId        int    `description:"产业Id"`
 	ParentId          int    `description:"父级ID"`
 	MatchTypeName     string `description:"行业名称"`
+	SeriesName        string `description:"系列名称"`
 	ArticleUpdateTime string `description:"对应文章的更新时间"`
 }
 
@@ -18,6 +19,7 @@ func GetCygxZhouqiArticleMapFirst() (items []*CygxZhouqiArticleMap, err error) {
 			category_id,
 			parent_id,
 			match_type_name,
+			series_name,
 			article_update_time 
 		FROM
 			cygx_zhouqi_article_map 
@@ -36,6 +38,7 @@ func GetCygxZhouqiArticleMapByParentId(parentId int) (items []*CygxZhouqiArticle
 	sql := `SELECT
 			category_id,
 			match_type_name,
+			series_name,
 			article_update_time 
 		FROM
 			cygx_zhouqi_article_map 

+ 3 - 0
services/article.go

@@ -970,6 +970,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			item.Stock = stock
 		}
 		item.FieldName = articleResult.Field.Name
+		item.SeriesName = articleResult.Series.Name
 		item.TypeName = articleResult.Type.Name
 		item.UpdateDate = articleResult.UpdateDate
 		item.CeLueFieldId = articleResult.Field.Id
@@ -1160,6 +1161,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			updateParams["FileLink"] = v.File
 			updateParams["Stock"] = v.Stock
 			updateParams["FieldName"] = v.FieldName
+			updateParams["SeriesName"] = v.SeriesName
 			updateParams["Annotation"] = v.Annotation
 			updateParams["TypeName"] = v.TypeName
 			updateParams["ModifyTimeByCl"] = v.UpdateDate
@@ -1204,6 +1206,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 			item.MatchTypeName = matchTypeName
 			item.Stock = v.Stock
 			item.FieldName = v.FieldName
+			item.SeriesName = v.SeriesName
 			item.Annotation = v.Annotation
 			item.TypeName = v.TypeName
 			item.ModifyTimeByCl = v.UpdateDate

+ 49 - 0
services/cygx_yanxuan_special.go

@@ -617,3 +617,52 @@ func GetYanxuanSpecialLikeCountDifferent(cont context.Context) (err error) {
 
 	return
 }
+
+//func init() {
+//	need_1006INIT()
+//}
+
+// 获取专栏用户最新的一篇文章信息
+func need_1006INIT() (mapResp map[int]*models.CygxYanxuanSpecialCenterAuthorResp) {
+
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg(fmt.Sprint("获取研选专栏用户信息失败,GetBestNewYanxuanSpecialByUserId Err ", err, "userIds"), 2)
+		}
+	}()
+	var condition string
+	var pars []interface{}
+
+	list, e := models.GetYanxuanSpecialListBycondition(condition, pars, 0, 999)
+	if e != nil && e.Error() != utils.ErrNoRow() {
+		err = errors.New("GetYanxuanSpecialListBycondition, Err: " + e.Error())
+		return
+	}
+	mapResp = make(map[int]*models.CygxYanxuanSpecialCenterAuthorResp, 0)
+	for _, v := range list {
+		fmt.Println(v.Id)
+		pars = make([]interface{}, 0)
+		condition = " AND  yanxuan_special_id = ?  AND company_id =  16  "
+		pars = append(pars, v.Id)
+		listYanxuanSpecialRecord, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition, pars)
+		if e != nil {
+			fmt.Println(e)
+			return
+		}
+		listYanxuanSpecialRecordUv, e := models.GetCygxYanxuanSpecialRecordRespListAll(condition+"  GROUP BY user_id ", pars)
+		if e != nil {
+			fmt.Println(e)
+			return
+		}
+
+		e = models.Need_1006INIT(len(listYanxuanSpecialRecord), len(listYanxuanSpecialRecordUv), v.Id)
+
+		if e != nil {
+			fmt.Println(e)
+			return
+		}
+	}
+	return
+}

+ 7 - 7
services/tactics.go

@@ -671,13 +671,13 @@ func BodyAnalysis2(body string) (expertNumStr, expertContentStr, interviewDateSt
 		expertContentStr = expertContentArr[0]
 	}
 	//当处理过之后的专家背景长度大于600的时候,说明他的格式跟之前的不一样,还要做二次处理 600 是一个约值,先运行看看
-	if len(expertContentStr) > 600 {
-		strnum := strings.Index(expertContentStr, "#专家评价:")
-		content := expertContentStr[strnum:len(expertContentStr)]
-		strnum2 := strings.Index(content, "(")
-		content = content[strnum2+9 : len(content)] //中文括号3位 专家编号6位
-		expertContentStr = content
-	}
+	//if len(expertContentStr) > 600 {
+	//	strnum := strings.Index(expertContentStr, "#专家评价:")
+	//	content := expertContentStr[strnum:len(expertContentStr)]
+	//	strnum2 := strings.Index(content, "(")
+	//	content = content[strnum2+9 : len(content)] //中文括号3位 专家编号6位
+	//	expertContentStr = content
+	//}
 	//if strings.Index(body, "报告全文(") > 0 && strings.Index(body, "PDF格式报告下载.pdf") > 0 {
 	//	numStar := strings.Index(body, "http")
 	//	numEnd := strings.Index(body, ".pdf")