|
@@ -1,6 +1,7 @@
|
|
package extract
|
|
package extract
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "data_ai/clean"
|
|
"data_ai/prompt"
|
|
"data_ai/prompt"
|
|
"data_ai/ul"
|
|
"data_ai/ul"
|
|
"fmt"
|
|
"fmt"
|
|
@@ -8,15 +9,15 @@ import (
|
|
new_xlsx "github.com/tealeg/xlsx/v3"
|
|
new_xlsx "github.com/tealeg/xlsx/v3"
|
|
qu "jygit.jydev.jianyu360.cn/data_processing/common_utils"
|
|
qu "jygit.jydev.jianyu360.cn/data_processing/common_utils"
|
|
"os"
|
|
"os"
|
|
|
|
+ "strings"
|
|
"sync"
|
|
"sync"
|
|
"unicode/utf8"
|
|
"unicode/utf8"
|
|
)
|
|
)
|
|
|
|
|
|
func TestSingleFieldInfo(name string, tmpid string) {
|
|
func TestSingleFieldInfo(name string, tmpid string) {
|
|
- tmp := ul.SourceMgo.FindById(name, tmpid)
|
|
|
|
|
|
+ tmp := ul.BidMgo.FindById(name, tmpid)
|
|
if len(tmp) == 0 || tmp == nil {
|
|
if len(tmp) == 0 || tmp == nil {
|
|
log.Debug("未查询到数据...", tmpid)
|
|
log.Debug("未查询到数据...", tmpid)
|
|
-
|
|
|
|
return
|
|
return
|
|
}
|
|
}
|
|
data := ResolveInfo(tmp)
|
|
data := ResolveInfo(tmp)
|
|
@@ -26,6 +27,398 @@ func TestSingleFieldInfo(name string, tmpid string) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 导出需要修复的
|
|
|
|
+func TestFullJinOrCodeInfo() {
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ pool_mgo := make(chan bool, 20)
|
|
|
|
+ wg_mgo := &sync.WaitGroup{}
|
|
|
|
+ sess := ul.SourceMgo.GetMgoConn()
|
|
|
|
+ defer ul.SourceMgo.DestoryMongoConn(sess)
|
|
|
|
+ total := 0
|
|
|
|
+ it := sess.DB(ul.SourceMgo.DbName).C("result_20220218").Find(&q).Sort("_id").Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total%10000 == 0 {
|
|
|
|
+ log.Debug("cur index ", total)
|
|
|
|
+ }
|
|
|
|
+ pool_mgo <- true
|
|
|
|
+ wg_mgo.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_mgo
|
|
|
|
+ wg_mgo.Done()
|
|
|
|
+ }()
|
|
|
|
+ tmpid := ul.BsonTOStringId(tmp["_id"])
|
|
|
|
+ isPcode, update := false, map[string]interface{}{}
|
|
|
|
+ ext_ai_record := qu.ObjToMap(tmp["ext_ai_record"])
|
|
|
|
+ o_projectcode, o_budget, o_bidamount := "", 0.0, 0.0
|
|
|
|
+ if ext_ai_record != nil {
|
|
|
|
+ o_projectcode = qu.ObjToString((*ext_ai_record)["projectcode"])
|
|
|
|
+ o_budget = qu.Float64All((*ext_ai_record)["budget"])
|
|
|
|
+ o_bidamount = qu.Float64All((*ext_ai_record)["bidamount"])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if r_budget := qu.Float64All(tmp["budget"]); r_budget > 0.0 && o_budget > 0.0 && r_budget < 1000000000.0 {
|
|
|
|
+ if r_budget/o_budget == 10000.0 || o_budget/r_budget == 10000.0 {
|
|
|
|
+ update["budget"] = filterAmount(r_budget, o_budget)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if r_bidamount := qu.Float64All(tmp["bidamount"]); r_bidamount > 0.0 && o_bidamount > 0.0 && r_bidamount < 1000000000.0 {
|
|
|
|
+ if r_bidamount/o_bidamount == 10000.0 || o_bidamount/r_bidamount == 10000.0 {
|
|
|
|
+ update["bidamount"] = filterAmount(r_bidamount, o_bidamount)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //对于编号
|
|
|
|
+ if projectcode := qu.ObjToString(tmp["projectcode"]); projectcode != "" {
|
|
|
|
+ if o_projectcode != projectcode {
|
|
|
|
+ if data := ul.SourceMgo.FindById("bidding", tmpid); data != nil {
|
|
|
|
+ fns := getpnsinfo(data) //获取附件名字
|
|
|
|
+ for _, v := range fns {
|
|
|
|
+ if utf8.RuneCountInString(v) >= utf8.RuneCountInString(projectcode) {
|
|
|
|
+ if strings.Contains(v, projectcode) {
|
|
|
|
+ isPcode = true
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if isPcode {
|
|
|
|
+ update["projectcode"] = o_projectcode
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if len(update) > 0 {
|
|
|
|
+ //更新抽取表
|
|
|
|
+ ul.SourceMgo.UpdateById("result_20220218", tmpid, map[string]interface{}{
|
|
|
|
+ "$set": update,
|
|
|
|
+ })
|
|
|
|
+ //保存待修复表
|
|
|
|
+ update["_id"] = tmp["_id"]
|
|
|
|
+ ul.SourceMgo.Save("zzzzz_kkk_uc_0907", update)
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ wg_mgo.Wait()
|
|
|
|
+ log.Debug("repair ai is over ...")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 修复金额和编号
|
|
|
|
+func TestRepairJinOrCodeInfo() {
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ pool_mgo := make(chan bool, 20)
|
|
|
|
+ wg_mgo := &sync.WaitGroup{}
|
|
|
|
+ sess := ul.SourceMgo.GetMgoConn()
|
|
|
|
+ defer ul.SourceMgo.DestoryMongoConn(sess)
|
|
|
|
+ total := 0
|
|
|
|
+ it := sess.DB(ul.SourceMgo.DbName).C("zktest_repeat_new").Find(&q).Sort("_id").Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total%10000 == 0 {
|
|
|
|
+ log.Debug("cur index ", total)
|
|
|
|
+ }
|
|
|
|
+ pool_mgo <- true
|
|
|
|
+ wg_mgo.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_mgo
|
|
|
|
+ wg_mgo.Done()
|
|
|
|
+ }()
|
|
|
|
+ tmpid := ul.BsonTOStringId(tmp["_id"])
|
|
|
|
+ isPcode, update := false, map[string]interface{}{}
|
|
|
|
+ ext_ai_record := qu.ObjToMap(tmp["ext_ai_record"])
|
|
|
|
+ o_projectcode, o_budget, o_bidamount := "", 0.0, 0.0
|
|
|
|
+ if ext_ai_record != nil {
|
|
|
|
+ o_projectcode = qu.ObjToString((*ext_ai_record)["projectcode"])
|
|
|
|
+ o_budget = qu.Float64All((*ext_ai_record)["budget"])
|
|
|
|
+ o_bidamount = qu.Float64All((*ext_ai_record)["bidamount"])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if r_budget := qu.Float64All(tmp["budget"]); r_budget > 0.0 && o_budget > 0.0 && r_budget < 1000000000.0 {
|
|
|
|
+ if r_budget/o_budget == 10000.0 || o_budget/r_budget == 10000.0 {
|
|
|
|
+ update["budget"] = filterAmount(r_budget, o_budget)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if r_bidamount := qu.Float64All(tmp["bidamount"]); r_bidamount > 0.0 && o_bidamount > 0.0 && r_bidamount < 1000000000.0 {
|
|
|
|
+ if r_bidamount/o_bidamount == 10000.0 || o_bidamount/r_bidamount == 10000.0 {
|
|
|
|
+ update["bidamount"] = filterAmount(r_bidamount, o_bidamount)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //对于编号
|
|
|
|
+ if projectcode := qu.ObjToString(tmp["projectcode"]); projectcode != "" {
|
|
|
|
+ if o_projectcode != projectcode {
|
|
|
|
+ if data := ul.SourceMgo.FindById("bidding", tmpid); data != nil {
|
|
|
|
+ fns := getpnsinfo(data) //获取附件名字
|
|
|
|
+ for _, v := range fns {
|
|
|
|
+ if utf8.RuneCountInString(v) >= utf8.RuneCountInString(projectcode) {
|
|
|
|
+ if strings.Contains(v, projectcode) {
|
|
|
|
+ isPcode = true
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if isPcode {
|
|
|
|
+ update["projectcode"] = o_projectcode
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if len(update) > 0 {
|
|
|
|
+ ul.SourceMgo.UpdateById("zktest_repeat_new", tmpid, map[string]interface{}{
|
|
|
|
+ "$set": update,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ wg_mgo.Wait()
|
|
|
|
+ log.Debug("repair ai is over ...")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 筛选金额
|
|
|
|
+func filterAmount(f1 float64, f2 float64) float64 {
|
|
|
|
+ //选取一个合适的金额 ...
|
|
|
|
+ if f1 > f2 {
|
|
|
|
+ if f1 > 100000000.0 {
|
|
|
|
+ return f2
|
|
|
|
+ } else {
|
|
|
|
+ return f1
|
|
|
|
+ }
|
|
|
|
+ } else if f1 < f2 {
|
|
|
|
+ if f2 > 100000000.0 {
|
|
|
|
+ return f1
|
|
|
|
+ } else {
|
|
|
|
+ return f2
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return f1
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func TestExportJinErInfo() {
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ pool_mgo := make(chan bool, 20)
|
|
|
|
+ wg_mgo := &sync.WaitGroup{}
|
|
|
|
+ sess := ul.SourceMgo.GetMgoConn()
|
|
|
|
+ defer ul.SourceMgo.DestoryMongoConn(sess)
|
|
|
|
+ total, isok := 0, 0
|
|
|
|
+ it := sess.DB(ul.SourceMgo.DbName).C("result_20220218").Find(&q).Sort("_id").Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total%10000 == 0 {
|
|
|
|
+ log.Debug("cur index ", total)
|
|
|
|
+ }
|
|
|
|
+ isok++
|
|
|
|
+ pool_mgo <- true
|
|
|
|
+ wg_mgo.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_mgo
|
|
|
|
+ wg_mgo.Done()
|
|
|
|
+ }()
|
|
|
|
+ tmpid := ul.BsonTOStringId(tmp["_id"])
|
|
|
|
+ budget := qu.Float64All(tmp["budget"])
|
|
|
|
+ bidamount := qu.Float64All(tmp["bidamount"])
|
|
|
|
+ saveinfo := map[string]interface{}{}
|
|
|
|
+ if ext_ai_record := qu.ObjToMap(tmp["ext_ai_record"]); ext_ai_record != nil {
|
|
|
|
+ ext_budget := qu.Float64All((*ext_ai_record)["budget"])
|
|
|
|
+ ext_bidamount := qu.Float64All((*ext_ai_record)["bidamount"])
|
|
|
|
+ if budget > 0.0 && ext_budget > 0.0 {
|
|
|
|
+ if budget/ext_budget == 10000.0 || ext_budget/budget == 10000.0 {
|
|
|
|
+ saveinfo["budget"] = budget
|
|
|
|
+ saveinfo["ext_budget"] = ext_budget
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if bidamount > 0.0 && ext_bidamount > 0.0 {
|
|
|
|
+ if bidamount/ext_bidamount == 10000.0 || ext_bidamount/bidamount == 10000.0 {
|
|
|
|
+ saveinfo["bidamount"] = bidamount
|
|
|
|
+ saveinfo["ext_bidamount"] = ext_bidamount
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if len(saveinfo) > 0 && tmpid != "" {
|
|
|
|
+ saveinfo["toptype"] = tmp["toptype"]
|
|
|
|
+ saveinfo["subtype"] = tmp["subtype"]
|
|
|
|
+ saveinfo["href"] = tmp["href"]
|
|
|
|
+ saveinfo["jyhref"] = tmp["jytest_href"]
|
|
|
|
+ ul.SourceMgo.Save("zktest_zzzzzkkk_0903", saveinfo)
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ wg_mgo.Wait()
|
|
|
|
+ log.Debug("repair ai is over ...", isok)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 修正buyer等字段
|
|
|
|
+func TestRepairBuyerInfo(name string) {
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ pool_mgo := make(chan bool, 20)
|
|
|
|
+ wg_mgo := &sync.WaitGroup{}
|
|
|
|
+ sess := ul.SourceMgo.GetMgoConn()
|
|
|
|
+ defer ul.SourceMgo.DestoryMongoConn(sess)
|
|
|
|
+ total, isok := 0, 0
|
|
|
|
+ it := sess.DB(ul.SourceMgo.DbName).C("zktest_repeat_new").Find(&q).Sort("_id").Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total%10000 == 0 {
|
|
|
|
+ log.Debug("cur index ", total)
|
|
|
|
+ }
|
|
|
|
+ isok++
|
|
|
|
+ pool_mgo <- true
|
|
|
|
+ wg_mgo.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_mgo
|
|
|
|
+ wg_mgo.Done()
|
|
|
|
+ }()
|
|
|
|
+ tmpid := ul.BsonTOStringId(tmp["_id"])
|
|
|
|
+ buyer := qu.ObjToString(tmp["buyer"])
|
|
|
|
+ agency := qu.ObjToString(tmp["agency"])
|
|
|
|
+ winner := qu.ObjToString(tmp["winner"])
|
|
|
|
+ update := map[string]interface{}{}
|
|
|
|
+ if ext_ai_record := qu.ObjToMap(tmp["ext_ai_record"]); ext_ai_record != nil {
|
|
|
|
+ o_buyer := qu.ObjToString((*ext_ai_record)["buyer"])
|
|
|
|
+ if buyer == agency && o_buyer != "" {
|
|
|
|
+ update["buyer"] = o_buyer
|
|
|
|
+ }
|
|
|
|
+ o_winner := qu.ObjToString((*ext_ai_record)["winner"])
|
|
|
|
+ if o_winner != "" && strings.Contains(winner, o_winner) && o_winner != o_winner {
|
|
|
|
+ update["winner"] = o_winner
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if len(update) > 0 && tmpid != "" {
|
|
|
|
+ ul.SourceMgo.UpdateById("zktest_repeat_new", tmpid, map[string]interface{}{
|
|
|
|
+ "$set": update,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ wg_mgo.Wait()
|
|
|
|
+ log.Debug("repair ai is over ...", isok)
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func TestDelUpBuyerAi() {
|
|
|
|
+ dataArr, _ := ul.SourceMgo.Find("zktest_buyer_0828_new", map[string]interface{}{}, nil, nil)
|
|
|
|
+ pool_mgo := make(chan bool, 50)
|
|
|
|
+ wg_mgo := &sync.WaitGroup{}
|
|
|
|
+ for k, v := range dataArr {
|
|
|
|
+ if k%1000 == 0 {
|
|
|
|
+ log.Debug(k, "~", v["_id"])
|
|
|
|
+ }
|
|
|
|
+ pool_mgo <- true
|
|
|
|
+ wg_mgo.Add(1)
|
|
|
|
+ go func(v map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_mgo
|
|
|
|
+ wg_mgo.Done()
|
|
|
|
+ }()
|
|
|
|
+
|
|
|
|
+ buyer := qu.ObjToString(v["buyer"])
|
|
|
|
+ tmpid := ul.BsonTOStringId(v["_id"])
|
|
|
|
+ data1 := ul.SourceMgo.FindById("result_20220218", tmpid)
|
|
|
|
+ if len(data1) > 0 {
|
|
|
|
+ ul.SourceMgo.UpdateById("result_20220218", tmpid, map[string]interface{}{
|
|
|
|
+ "$set": map[string]interface{}{"buyer": buyer},
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ data2 := ul.SourceMgo.FindById("result_20220219", tmpid)
|
|
|
|
+ if len(data2) > 0 {
|
|
|
|
+ ul.SourceMgo.UpdateById("result_20220219", tmpid, map[string]interface{}{
|
|
|
|
+ "$set": map[string]interface{}{"buyer": buyer},
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }(v)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ wg_mgo.Wait()
|
|
|
|
+ log.Debug("del ai is over ...")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func TestAiBuyerInfo() {
|
|
|
|
+ //dataArr, _ := ul.SourceMgo.Find("zktest_buyer_info", map[string]interface{}{}, nil, nil)
|
|
|
|
+
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ pool_mgo := make(chan bool, 50)
|
|
|
|
+ wg_mgo := &sync.WaitGroup{}
|
|
|
|
+ sess := ul.SourceMgo.GetMgoConn()
|
|
|
|
+ defer ul.SourceMgo.DestoryMongoConn(sess)
|
|
|
|
+ total, isok := 0, 0
|
|
|
|
+ it := sess.DB(ul.SourceMgo.DbName).C("zktest_repeat_new").Find(&q).Sort("_id").Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total%1000 == 0 {
|
|
|
|
+ log.Debug("cur index ", total)
|
|
|
|
+ }
|
|
|
|
+ isok++
|
|
|
|
+ pool_mgo <- true
|
|
|
|
+ wg_mgo.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_mgo
|
|
|
|
+ wg_mgo.Done()
|
|
|
|
+ }()
|
|
|
|
+ tmpid := ul.BsonTOStringId(tmp["_id"])
|
|
|
|
+ if buyer := qu.ObjToString(tmp["buyer"]); buyer != "" {
|
|
|
|
+ if zp_buyer := prompt.AcquireBuyerInfo(buyer); zp_buyer["实体单位"] != nil {
|
|
|
|
+ if ns_buyer := clean.CleanBuyer(qu.ObjToString(zp_buyer["实体单位"])); ns_buyer != "" {
|
|
|
|
+ ul.SourceMgo.UpdateById("zktest_repeat_new", tmpid, map[string]interface{}{
|
|
|
|
+ "$set": map[string]interface{}{"buyer": ns_buyer},
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ wg_mgo.Wait()
|
|
|
|
+ log.Debug("repair ai is over ...", isok)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func TestExportAiBuyer() {
|
|
|
|
+ sess := ul.SourceMgo.GetMgoConn()
|
|
|
|
+ defer ul.SourceMgo.DestoryMongoConn(sess)
|
|
|
|
+ pool_mgo := make(chan bool, 10)
|
|
|
|
+ wg_mgo := &sync.WaitGroup{}
|
|
|
|
+ q, total := map[string]interface{}{
|
|
|
|
+ "_id": map[string]interface{}{
|
|
|
|
+ "$lte": ul.StringTOBsonId("66cd8299b25c3e1deb9488dd"),
|
|
|
|
+ },
|
|
|
|
+ }, 0
|
|
|
|
+ it := sess.DB(ul.SourceMgo.DbName).C("result_20220218").Find(&q).Sort("_id").Select(map[string]interface{}{
|
|
|
|
+ "ai_zhipu": 1,
|
|
|
|
+ "ext_ai_record": 1,
|
|
|
|
+ }).Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total%10000 == 0 {
|
|
|
|
+ log.Debug("cur index ", total, "~", tmp["_id"])
|
|
|
|
+ }
|
|
|
|
+ pool_mgo <- true
|
|
|
|
+ wg_mgo.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_mgo
|
|
|
|
+ wg_mgo.Done()
|
|
|
|
+ }()
|
|
|
|
+ ai_buyer, ext_buyer := "", ""
|
|
|
|
+ if ai_zhipu := qu.ObjToMap(tmp["ai_zhipu"]); ai_zhipu != nil {
|
|
|
|
+ ai_buyer = qu.ObjToString((*ai_zhipu)["s_buyer"])
|
|
|
|
+ }
|
|
|
|
+ if ext_ai_record := qu.ObjToMap(tmp["ext_ai_record"]); ext_ai_record != nil {
|
|
|
|
+ ext_buyer = qu.ObjToString((*ext_ai_record)["buyer"])
|
|
|
|
+ }
|
|
|
|
+ if ai_buyer != "" {
|
|
|
|
+ ul.SourceMgo.Save("zktest_buyer_0827", map[string]interface{}{
|
|
|
|
+ "_id": tmp["_id"],
|
|
|
|
+ "ai_buyer": ai_buyer,
|
|
|
|
+ "ext_buyer": ext_buyer,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ wg_mgo.Wait()
|
|
|
|
+ log.Debug("export is over ", total)
|
|
|
|
+}
|
|
|
|
+
|
|
func TestIsPackage() {
|
|
func TestIsPackage() {
|
|
tmpArr := []string{
|
|
tmpArr := []string{
|
|
"669e83fe66cf0db42a6520b3",
|
|
"669e83fe66cf0db42a6520b3",
|