소스 검색

jsondata中国政府采购网

fengweiqiang 5 년 전
부모
커밋
5632a746d4
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      src/jy/extract/score_jsondata.go
  2. 4 2
      udp_winner/main.go

+ 1 - 1
src/jy/extract/score_jsondata.go

@@ -12,7 +12,7 @@ import (
 )
 
 func JsonDataMergeProcessing(j *util.Job, e *ExtractTask) map[string][]*util.ExtField {
-	if len(j.Result) <= 0 || j.Jsondata == nil || len(*j.Jsondata) <= 0 || j.Site =="中国政府采购网"{
+	if len(j.Result) <= 0 || j.Jsondata == nil || len(*j.Jsondata) <= 0 {
 		return j.Result
 	}
 	jdextweight := util2.IntAll((*j.Jsondata)["extweight"])

+ 4 - 2
udp_winner/main.go

@@ -185,7 +185,7 @@ func task(mapinfo *map[string]interface{}) {
 		log.Println(err)
 		return
 	}
-	overid := ""
+	overid := gtid
 	c2, _ := context.WithTimeout(context.Background(), 9999*time.Hour)
 	for cursor.Next(c2) {
 		if err := cursor.Err(); err != nil {
@@ -196,6 +196,7 @@ func task(mapinfo *map[string]interface{}) {
 			if tmp["winner"] == nil || tmp["winner"] == "" {
 				continue
 			}
+			overid = tmp["_id"].(primitive.ObjectID).Hex()
 			//redis查询是否存在
 			rdb := RedisPool.Get()
 			if reply, err := redis.String(rdb.Do("GET", tmp["winner"])); err != nil {
@@ -237,7 +238,7 @@ func task(mapinfo *map[string]interface{}) {
 				tmpTopscopeclass := []string{}
 				tmpTopscopeclassMap := make(map[string]bool)
 				log.Println(tmp["_id"])
-				overid = tmp["_id"].(primitive.ObjectID).Hex()
+
 				if oldTmp["industry"] == nil {
 					//log.Println(reflect.ValueOf(tmp["topscopeclass"]))
 					if v, ok := tmp["topscopeclass"].(primitive.A); ok {
@@ -372,6 +373,7 @@ func task(mapinfo *map[string]interface{}) {
 			log.Println(e)
 		}
 		log.Println("重新发送udp:", string(by))
+		return
 	}
 	log.Println("合并执行完成 ok", gtid, lteid, overid)