Przeglądaj źródła

历史联系方式

xuzhiheng 8 miesięcy temu
rodzic
commit
329d8f669f
3 zmienionych plików z 9 dodań i 3 usunięć
  1. 1 0
      customerdata/src/main.go
  2. 1 0
      customerdata/src/task.go
  3. 7 3
      customerdata/src/util.go

+ 1 - 0
customerdata/src/main.go

@@ -222,6 +222,7 @@ func init() {
 		FilterOwnerMap[v] = true
 	}
 }
+
 func main() {
 	go SaveMgo()
 	//flag.StringVar(&SId, "sid", "", "起始id")

+ 1 - 0
customerdata/src/task.go

@@ -28,6 +28,7 @@ import (
 
 func TimeTask() {
 	// StartTask()
+	GetCustomerDatas()
 	c := cron.New()
 	//cronstr := "0 */" + fmt.Sprint(TaskTime) + " * * * ?"
 	cronstr := "0 5 */" + fmt.Sprint(TaskTime) + " * * ?" //每TaskTime小时执行一次

+ 7 - 3
customerdata/src/util.go

@@ -293,7 +293,7 @@ func GetIdRanges() (bson.M, bson.M, bool, int64) {
 	idQuery, endTime := "", int64(0)
 	esquery := `{"query":{"bool":{"must":{"range":{"pici":{"gt":"%d"}}}}},"_source":["id","pici"],"sort":{"pici":"desc"},"from":0,"size":1}`
 	if LatestId == "" {
-		idQuery = strings.Replace(fmt.Sprintf(esquery, LatestTime), `"gt"`, `"gte"`, -1)
+		idQuery = strings.Replace(fmt.Sprintf(esquery, LatestTimes), `"gt"`, `"gte"`, -1)
 	} else {
 		esquerys := `{"query":{"bool":{"must":{"range":{"id":{"gt":"%s"}}}}},"_source":["id","pici"],"sort":{"pici":"desc"},"from":0,"size":1}`
 		idQuery = fmt.Sprintf(esquerys, LatestId)
@@ -309,7 +309,7 @@ func GetIdRanges() (bson.M, bson.M, bool, int64) {
 		"range": bson.M{
 			"pici": bson.M{
 				"lte": endTime,
-				"gt":  LatestTime,
+				"gt":  LatestTimes,
 			},
 		},
 	}
@@ -885,6 +885,10 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, a
 							}
 							ownerByte, _ := json.Marshal(&ownerContact)
 							tmp["owner_contact"] = string(ownerByte)
+						} else {
+							if appid == "jyIypXQAEDAA9SQENJEAdY" {
+								return false
+							}
 						}
 					}
 				}
@@ -952,7 +956,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, a
 		}
 		tmp["industry"] = buyerclass
 	}
-
+	tmp["datasource"] = "增量匹配"
 	if dataSave != "" {
 		rdata := MgoSave.Save(dataSave, tmp)
 		if rdata != nil {