|
@@ -124,8 +124,8 @@ func TaskBuyer(mapinfo *map[string]interface{}) {
|
|
//拿到合并后的qyk
|
|
//拿到合并后的qyk
|
|
FClient.DbName = Config["mgodb_extract_kf"]
|
|
FClient.DbName = Config["mgodb_extract_kf"]
|
|
oldTmp, b := FClient.FindById(Config["mgo_qyk_buyer"], reply, nil)
|
|
oldTmp, b := FClient.FindById(Config["mgo_qyk_buyer"], reply, nil)
|
|
- if !b || oldTmp == nil {
|
|
|
|
- log.Println(redisCName, "存量 redis id 不存在", reply)
|
|
|
|
|
|
+ if !b || (*oldTmp) == nil|| reply==""||(*oldTmp)["_id"]==nil{
|
|
|
|
+ log.Println(redisCName, "存量 redis id 不存在", reply,"数据:",oldTmp)
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
tmpTopscopeclass := []string{}
|
|
tmpTopscopeclass := []string{}
|
|
@@ -254,7 +254,7 @@ func TaskBuyer(mapinfo *map[string]interface{}) {
|
|
//拿到合并后的qyk
|
|
//拿到合并后的qyk
|
|
FClient.DbName = Config["mgodb_extract_kf"]
|
|
FClient.DbName = Config["mgodb_extract_kf"]
|
|
oldTmp, b := FClient.FindById(Config["mgo_qyk_buyer"], reply, bson.M{})
|
|
oldTmp, b := FClient.FindById(Config["mgo_qyk_buyer"], reply, bson.M{})
|
|
- if !b || oldTmp == nil {
|
|
|
|
|
|
+ if !b || (*oldTmp) == nil|| reply==""||(*oldTmp)["_id"]==nil{
|
|
log.Println("redis id 不存在")
|
|
log.Println("redis id 不存在")
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -375,7 +375,7 @@ func TimedTaskBuyer() {
|
|
if !iter.Next(&tmpLast) {
|
|
if !iter.Next(&tmpLast) {
|
|
//临时表无数据
|
|
//临时表无数据
|
|
log.Println("临时表无数据:")
|
|
log.Println("临时表无数据:")
|
|
- t2.Reset(time.Second * 15)
|
|
|
|
|
|
+ t2.Reset(time.Minute * 5)
|
|
FClient.DestoryMongoConn(Fcconn)
|
|
FClient.DestoryMongoConn(Fcconn)
|
|
continue
|
|
continue
|
|
} else {
|
|
} else {
|
|
@@ -388,7 +388,7 @@ func TimedTaskBuyer() {
|
|
}).Sort("_id").Iter()
|
|
}).Sort("_id").Iter()
|
|
if cursor == nil {
|
|
if cursor == nil {
|
|
log.Println("查询失败")
|
|
log.Println("查询失败")
|
|
- t2.Reset(time.Second * 15)
|
|
|
|
|
|
+ t2.Reset(time.Second * 5)
|
|
FClient.DestoryMongoConn(fconn)
|
|
FClient.DestoryMongoConn(fconn)
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -461,7 +461,7 @@ func TimedTaskBuyer() {
|
|
continue
|
|
continue
|
|
} else {
|
|
} else {
|
|
//log.Println(123)
|
|
//log.Println(123)
|
|
- //匹配到原始库,新增 resulttmp
|
|
|
|
|
|
+ //匹配到原始库,新增 resulttmp buyer
|
|
if (*resulttmp)["credit_no"] != nil {
|
|
if (*resulttmp)["credit_no"] != nil {
|
|
if credit_no, ok := (*resulttmp)["credit_no"].(string); ok && strings.TrimSpace(credit_no) != "" &&
|
|
if credit_no, ok := (*resulttmp)["credit_no"].(string); ok && strings.TrimSpace(credit_no) != "" &&
|
|
len(strings.TrimSpace(credit_no)) > 8 {
|
|
len(strings.TrimSpace(credit_no)) > 8 {
|
|
@@ -593,10 +593,18 @@ func TimedTaskBuyer() {
|
|
savetmp[sk] = (*resulttmp)["company_address"]
|
|
savetmp[sk] = (*resulttmp)["company_address"]
|
|
}
|
|
}
|
|
continue
|
|
continue
|
|
|
|
+ }else if sk == "buyerclass" {
|
|
|
|
+ if tmp["buyerclass"]==nil {
|
|
|
|
+ savetmp[sk] = ""
|
|
|
|
+ }else {
|
|
|
|
+ savetmp[sk] = tmp["buyerclass"]
|
|
|
|
+ }
|
|
|
|
+ continue
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
if (*resulttmp)[sk] == nil && sk != "history_name" && sk != "wechat_accounts" &&
|
|
if (*resulttmp)[sk] == nil && sk != "history_name" && sk != "wechat_accounts" &&
|
|
- sk != "buyer_name" && sk != "address" &&
|
|
|
|
|
|
+ sk != "buyer_name" && sk != "address" && sk != "buyerclass"&&
|
|
sk != "contact" && sk != "report_websites" {
|
|
sk != "contact" && sk != "report_websites" {
|
|
savetmp[sk] = ""
|
|
savetmp[sk] = ""
|
|
} else {
|
|
} else {
|
|
@@ -648,6 +656,7 @@ func TimedTaskBuyer() {
|
|
|
|
|
|
}
|
|
}
|
|
FClient.DestoryMongoConn(fconn)
|
|
FClient.DestoryMongoConn(fconn)
|
|
|
|
+ log.Println("buyer_new,遍历完成")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
FClient.DestoryMongoConn(Fcconn)
|
|
FClient.DestoryMongoConn(Fcconn)
|