Эх сурвалжийг харах

更新省级项目 标签规则

wcc 1 жил өмнө
parent
commit
dbf29cdc07

+ 7 - 7
escheck/main.go

@@ -1,15 +1,15 @@
 package main
 
 import (
-	util "jygit.jydev.jianyu360.cn/data_processing/common_utils"
-	"jygit.jydev.jianyu360.cn/data_processing/common_utils/elastic"
-	"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
 	"encoding/json"
 	"fmt"
 	es "github.com/olivere/elastic/v7"
 	"github.com/robfig/cron/v3"
 	"go.mongodb.org/mongo-driver/bson"
 	"go.mongodb.org/mongo-driver/bson/primitive"
+	util "jygit.jydev.jianyu360.cn/data_processing/common_utils"
+	"jygit.jydev.jianyu360.cn/data_processing/common_utils/elastic"
+	"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
 	"log"
 	"net/http"
 	"strconv"
@@ -29,7 +29,7 @@ type T struct {
 	Mgo     string
 }
 
-//es数据最报警
+// es数据最报警
 var (
 	config                      map[string]interface{}
 	to                          string
@@ -125,9 +125,9 @@ func (t *T) task() {
 	es3 := elastic.Elastic{S_esurl: esAddr3, I_size: 5, Username: username3, Password: password3}
 	es3.InitElasticSize()
 
-	count := int(es2.Count(esIndex2, esIndex2, countQuery))    //公司 es集群 数量统计
-	count1 := int(es2.Count(esIndex, esIndex, count1Query))    //竞品网站 数量统计
-	countNew := int(es3.Count(esIndex3, esIndex3, countQuery)) //华为云 新集群
+	count := int(es2.Count(esIndex2, countQuery))    //公司 es集群 数量统计
+	count1 := int(es2.Count(esIndex, count1Query))   //竞品网站 数量统计
+	countNew := int(es3.Count(esIndex3, countQuery)) //华为云 新集群
 	fmt.Println("count", count)
 	fmt.Println("count1", count1)
 	fmt.Println("countNew", countNew)

+ 7 - 7
website_columns/utils.go

@@ -12,7 +12,7 @@ import (
 	"strings"
 )
 
-//SendMail 发送邮件
+// SendMail 发送邮件
 func SendMail(title, content string) {
 	url := fmt.Sprintf("%s?to=%s&title=%s&body=%s", GF.Email.Api, GF.Email.To, title, content)
 	fmt.Println("url=>", url)
@@ -24,7 +24,7 @@ func SendMail(title, content string) {
 	}
 }
 
-//calculateFlag 根据数据,返回被标注的字段数字
+// calculateFlag 根据数据,返回被标注的字段数字
 func calculateFlag(marked map[string]interface{}, data []map[string]interface{}) int {
 	var result int
 	for _, item := range data {
@@ -52,7 +52,7 @@ func calculateFlag(marked map[string]interface{}, data []map[string]interface{})
 	return result
 }
 
-//IsInStringArray 判断数组中是否存在字符串
+// IsInStringArray 判断数组中是否存在字符串
 func IsInStringArray(str string, arr []string) bool {
 	// 先对字符串数组进行排序
 	sort.Strings(arr)
@@ -62,7 +62,7 @@ func IsInStringArray(str string, arr []string) bool {
 	return pos < len(arr) && arr[pos] == str
 }
 
-//TagBidding 根据bidding数据打标签
+// TagBidding 根据bidding数据打标签
 func TagBidding(tmp map[string]interface{}) (res map[string]interface{}) {
 	res = make(map[string]interface{}, 0)
 	toptype := util.ObjToString(tmp["toptype"])
@@ -166,9 +166,9 @@ func TagBidding(tmp map[string]interface{}) (res map[string]interface{}) {
 		}
 	}
 
-	fundsWors2 := []string{"省份自筹"}
+	fundsWors2 := []string{"省份财政资金"}
 	for _, v := range fundsWors2 {
-		if strings.Contains(funds, v) {
+		if strings.Contains(title, v) {
 			res["省级项目"] = 1
 			break
 		}
@@ -177,7 +177,7 @@ func TagBidding(tmp map[string]interface{}) (res map[string]interface{}) {
 	return
 }
 
-//TagProject 给拟建项目表 打标签
+// TagProject 给拟建项目表 打标签
 func TagProject(tmp map[string]interface{}) (res map[string]interface{}) {
 	res = make(map[string]interface{}, 0)
 	id := mongodb.BsonIdToSId(tmp["_id"])