Ver código fonte

Merge branch 'need_p2_838' of http://8.136.199.33:3000/eta_server/eta_api into debug

xingzai 1 ano atrás
pai
commit
bea1644b89
3 arquivos alterados com 17 adições e 0 exclusões
  1. 1 0
      models/report.go
  2. 1 0
      services/elastic.go
  3. 15 0
      services/report.go

+ 1 - 0
models/report.go

@@ -613,6 +613,7 @@ type ElasticReportDetail struct {
 	ClassifyNameSecond string `description:"二级分类名称"`
 	Categories         string `description:"关联的品种名称(包括品种别名)"`
 	StageStr           string `description:"报告期数"`
+	BodyMd5            string `description:"MD5加密之后的内容"`
 }
 
 // GetLastPublishedDayWeekReport 获取上一篇已发布的晨周报

+ 1 - 0
services/elastic.go

@@ -109,6 +109,7 @@ func EsAddOrEditReport(indexName, docId string, item *models.ElasticReportDetail
 			"ClassifyNameSecond": item.ClassifyNameSecond,
 			"Categories":         item.Categories,
 			"StageStr":           item.StageStr,
+			"BodyMd5":            utils.MD5(item.BodyContent), // 对内容进行Md5加密,keywords类型,处理分组查询
 		}).Do(context.Background())
 		if err != nil {
 			return err

+ 15 - 0
services/report.go

@@ -353,6 +353,21 @@ func PublishTodayDayReport() (err error) {
 	return
 }
 
+func initp2_838 (){
+	var condition string
+	var pars []interface{}
+	condition = " AND  state =  2 "
+	list ,err:= models.GetReportByCondition(condition,pars,[]string{},"",false,0,0)
+	if err != nil{
+		fmt.Println(err)
+	}
+	fmt.Println(len(list))
+	for  _,v:=  range  list{
+		fmt.Println(v.Id)
+		UpdateReportEs(v.Id,2)
+	}
+}
+
 // UpdateReportEs 更新报告/章节Es
 func UpdateReportEs(reportId int, publishState int) (err error) {
 	if reportId <= 0 {