Roc 1 dienu atpakaļ
vecāks
revīzija
87fe6036f4

+ 1 - 1
controllers/data_manage/chart_info_share.go

@@ -155,7 +155,7 @@ func (c *ChartInfoShareController) Save() {
 	}
 
 	// 更新es
-	go data.AddOrEditChartInfoToEs(req.ChartInfoId)
+	data.AddOrEditChartInfoToEs(req.ChartInfoId)
 
 	br.Ret = 200
 	br.Success = true

+ 1 - 1
controllers/data_manage/edb_info_share.go

@@ -153,7 +153,7 @@ func (c *EdbInfoShareController) Save() {
 	}
 
 	// 更新es
-	go data.AddOrEditEdbInfoToEs(req.EdbInfoId)
+	data.AddOrEditEdbInfoToEs(req.EdbInfoId)
 
 	br.Ret = 200
 	br.Success = true

+ 8 - 0
models/data_manage/chart_info_share.go

@@ -214,5 +214,13 @@ MAX(b."sort") AS "sort"
 	sql := baseSql + ` ORDER BY share_time DESC LIMIT ?,? `
 	pars = append(pars, startSize, pageSize)
 	err = global.DmSQL["data"].Raw(sql, pars...).Scan(&list).Error
+	if err != nil {
+		return
+	}
+
+	for _, v := range list {
+		v.ConvertToResp()
+	}
+
 	return
 }

+ 16 - 0
models/data_manage/edb_info_share.go

@@ -156,6 +156,10 @@ MAX(b."edb_info_type") "edb_info_type",
 MAX(b."edb_type") "edb_type",
 MAX(b."source") "source",
 MAX(b."source_name") "source_name",
+MAX(b."latest_date") "latest_date",
+MAX(b."latest_value") "latest_value",
+MAX(b."sys_user_id") "sys_user_id",
+MAX(b."sys_user_real_name") "sys_user_real_name",
 MAX(b."frequency") "frequency",
 MAX(b."unit") "unit",
 MAX(b."classify_id") "classify_id",
@@ -196,6 +200,10 @@ MAX(b."edb_info_type") "edb_info_type",
 MAX(b."edb_type") "edb_type",
 MAX(b."source") "source",
 MAX(b."source_name") "source_name",
+MAX(b."latest_date") "latest_date",
+MAX(b."latest_value") "latest_value",
+MAX(b."sys_user_id") "sys_user_id",
+MAX(b."sys_user_real_name") "sys_user_real_name",
 MAX(b."frequency") "frequency",
 MAX(b."unit") "unit",
 MAX(b."classify_id") "classify_id",
@@ -223,5 +231,13 @@ MAX(b."sort") AS "sort"
 	sql := baseSql + ` ORDER BY share_time DESC LIMIT ?,? `
 	pars = append(pars, startSize, pageSize)
 	err = global.DmSQL["data"].Raw(sql, pars...).Scan(&list).Error
+
+	if err != nil {
+		return
+	}
+	for _, v := range list {
+		v.ConvertToResp()
+	}
+
 	return
 }

+ 5 - 4
services/elastic/chart.go

@@ -472,11 +472,12 @@ func searchChartInfoDataList(indexName string, query elastic.Query, sortList []*
 	}()
 	client := utils.EsClient
 	// 高亮
-	highlight := elastic.NewHighlight()
-	highlight = highlight.Fields(elastic.NewHighlighterField("ChartName"))
-	highlight = highlight.PreTags("<font color='red'>").PostTags("</font>")
+	//highlight := elastic.NewHighlight()
+	//highlight = highlight.Fields(elastic.NewHighlighterField("ChartName"))
+	//highlight = highlight.PreTags("<font color='red'>").PostTags("</font>")
 
-	request := client.Search(indexName).Highlight(highlight).From(from).Size(size) // sets the JSON request
+	//request := client.Search(indexName).Highlight(highlight).From(from).Size(size) // sets the JSON request
+	request := client.Search(indexName).From(from).Size(size) // sets the JSON request
 
 	// 如果有指定排序,那么就按照排序来
 	if len(sortList) > 0 {

+ 5 - 4
services/elastic/edb_info.go

@@ -424,11 +424,12 @@ func searchEdbInfoDataList(indexName string, query elastic.Query, sortList []*el
 	}()
 	client := utils.EsClient
 	// 高亮
-	highlight := elastic.NewHighlight()
-	highlight = highlight.Fields(elastic.NewHighlighterField("EdbCode"), elastic.NewHighlighterField("EdbName"))
-	highlight = highlight.PreTags("<font color='red'>").PostTags("</font>")
+	//highlight := elastic.NewHighlight()
+	//highlight = highlight.Fields(elastic.NewHighlighterField("EdbCode"), elastic.NewHighlighterField("EdbName"))
+	//highlight = highlight.PreTags("<font color='red'>").PostTags("</font>")
 
-	request := client.Search(indexName).Highlight(highlight).From(from).Size(size) // sets the JSON request
+	//request := client.Search(indexName).Highlight(highlight).From(from).Size(size) // sets the JSON request
+	request := client.Search(indexName).From(from).Size(size) // sets the JSON request
 
 	// 如果有指定排序,那么就按照排序来
 	if len(sortList) > 0 {