wcc 1 year ago
parent
commit
e2b911d214

BIN
export_bidding/getXiaMenWinner


+ 2 - 2
export_bidding/main.go

@@ -7,7 +7,7 @@ func main() {
 	//bankWinnerStatistic()
 	//getPengWinner()
 
-	//dealXmData() //处理厦门数据
-	CountBidamount()
+	dealXmData() //处理厦门数据
+	//CountBidamount()
 	log.Println("over ---- over")
 }

+ 2 - 1
export_bidding/xiamen.go

@@ -47,7 +47,8 @@ func dealXmData() {
 
 	// 设置查询条件
 	filter := bson.D{
-		{"publishtime", bson.M{"$gte": 1640966400, "$lt": 1704038400}},
+		//{"publishtime", bson.M{"$gte": 1640966400, "$lt": 1672502400}},
+		{"publishtime", bson.M{"$gte": 1640966400}},
 		{"subtype", bson.M{"$in": []string{"中标", "单一", "成交", "合同"}}},
 	}
 

+ 2 - 2
getEs/clickhouse.go

@@ -124,7 +124,7 @@ func click() {
 	sess := Mgo.GetMgoConn()
 	defer Mgo.DestoryMongoConn(sess)
 
-	query := sess.DB("top").C("wcc_allcity_2024Q1").Find(nil).Select(map[string]interface{}{"list": 0}).Iter()
+	query := sess.DB("top").C("wcc_allcity_2024Q2").Find(nil).Select(map[string]interface{}{"list": 0}).Iter()
 	count := 0
 	ch := make(chan bool, 10)
 	wg := &sync.WaitGroup{}
@@ -206,7 +206,7 @@ func click() {
 				indusName := util.ObjToString((*indus)[0]["industry_l1_name"])
 				beijing.IndustryName = &indusName
 			}
-			_, err := g.DB().Insert(gctx.New(), "wcc_allcity_2024Q1", beijing)
+			_, err := g.DB().Insert(gctx.New(), "wcc_allcity_2024Q2", beijing)
 			if err != nil {
 				log.Println("clickhouse 写入失败;", err, companyName, companyID)
 			}

+ 3 - 2
getEs/config.yaml

@@ -1,8 +1,9 @@
 database:
   default:
-#    link: "clickhouse@tcp(127.0.0.1:8123)/default?dial_timeout=2000ms&max_execution_time=60"
-#    link: "clickhouse:jybi_admin:Da#jy20230825@tcp(127.0.0.1:8123)/top_test?dial_timeout=2000ms&max_execution_time=60"
    ## 测试环境
     link: "clickhouse:jytop:pwdTopJy123@tcp(192.168.3.207:18123)/information?dial_timeout=2000ms&max_execution_time=60"
     #    link: "clickhouse:jybi_admin:Da#jy20230825@tcp(cc-2zelp3xmkmsrtjhgp.public.clickhouse.ads.aliyuncs.com:8123)/top_test?dial_timeout=2000ms&max_execution_time=60"
+   ## 正式环境
+#    link: "clickhouse:jybi_admin:Da#jy20230825@tcp(cc-2zelp3xmkmsrtjhgp.clickhouse.ads.aliyuncs.com:9000)/top_test?dial_timeout=2000ms&max_execution_time=60"
+
     debug: true

+ 171 - 6
getEs/es_test.go

@@ -14,6 +14,7 @@ import (
 	"strconv"
 	"strings"
 	"testing"
+	"time"
 )
 
 func TestEs(T *testing.T) {
@@ -142,9 +143,9 @@ func removeDuplicates(data []string) []string {
 // syncEs 同步es 数据道信集群
 func TestSyncEs(T *testing.T) {
 	//url := "http://172.17.4.184:19805"
-	url := "http://127.0.0.1:19805"
-	username := "es_all"
-	password := "TopJkO2E_d1x"
+	url := "http://127.0.0.1:19905"
+	username := "jybid"
+	password := "Top2023_JEB01i@31"
 	index := "bidding" //索引名称
 	// 创建 Elasticsearch 客户端
 	client, err := elastic.NewClient(
@@ -156,9 +157,9 @@ func TestSyncEs(T *testing.T) {
 		log.Fatalf("创建 Elasticsearch 客户端失败:%s", err)
 	}
 
-	url2 := "http://127.0.0.1:19905"
-	username2 := "jybid"
-	password2 := "Top2023_JEB01i@31"
+	url2 := "http://192.168.3.149:9201"
+	username2 := ""
+	password2 := ""
 	// 创建 Elasticsearch 客户端
 	client2, err := elastic.NewClient(
 		elastic.SetURL(url2),
@@ -350,3 +351,167 @@ func TestGetP(T *testing.T) {
 	fmt.Println("结束~~~~~~~~~~~~~~~")
 
 }
+
+// TestSyncEsDataLimit 同步固定数量es 数据
+func TestSyncEsDataLimit(T *testing.T) {
+	url := "http://192.168.3.149:9201"
+	username := ""
+	//username := "jybid"
+	password := ""
+	//password := "Top2023_JEB01i@31"
+	index := "bidding" //索引名称
+	// 创建 Elasticsearch 客户端
+	client, err := elastic.NewClient(
+		elastic.SetURL(url),
+		elastic.SetBasicAuth(username, password),
+		elastic.SetSniff(false),
+	)
+	if err != nil {
+		log.Fatalf("创建 Elasticsearch 客户端失败:%s", err)
+	}
+
+	//url2 := "http://192.168.3.149:9201"
+	//username2 := ""
+	//password2 := ""
+	// 创建 Elasticsearch 客户端
+	//client2, err := elastic.NewClient(
+	//	elastic.SetURL(url2),
+	//	elastic.SetBasicAuth(username2, password2),
+	//	elastic.SetSniff(false),
+	//)
+	//if err != nil {
+	//	log.Fatalf("创建 Elasticsearch 客户端失败:%s", err)
+	//}
+
+	// 构建查询
+	query := elastic.NewBoolQuery().
+		Must(elastic.NewTermQuery("subtype", "采购意向")).
+		Must(elastic.NewMatchQuery("tag_topinformation", "情报_环境采购"))
+	//MustNot(elastic.NewMatchQuery("company_type", "个体工商户"))
+
+	// 执行查询
+	searchResult, err := client.Search().Size(500).
+		Index(index).
+		Query(query).
+		Do(context.Background())
+	if err != nil {
+		log.Fatalf("Error executing search: %s", err)
+	}
+
+	MgoB := &mongodb.MongodbSim{
+		//MongodbAddr: "172.17.189.140:27080",
+		MongodbAddr: "127.0.0.1:27083",
+		Size:        10,
+		DbName:      "qfw",
+		UserName:    "SJZY_RWbid_ES",
+		Password:    "SJZY@B4i4D5e6S",
+		Direct:      true,
+	}
+	MgoB.InitPool()
+
+	////测试环境MongoDB
+	MgoT := &mongodb.MongodbSim{
+		MongodbAddr: "192.168.3.206:27002",
+		DbName:      "qfw_data",
+		Size:        10,
+		UserName:    "root",
+		Password:    "root",
+	}
+	MgoT.InitPool()
+
+	for _, hit := range searchResult.Hits.Hits {
+		var doc map[string]interface{}
+		err := json.Unmarshal(hit.Source, &doc)
+		if err != nil {
+			log.Printf("解析文档失败:%s", err)
+			continue
+		}
+
+		id := util.ObjToString(doc["id"])
+		data, _ := MgoB.FindById("bidding", id, nil)
+		//client2.Index().Index(index).Id(id).BodyJson(doc).Do(context.Background())
+		MgoT.SaveByOriID("bidding", *data)
+	}
+
+	fmt.Println("结束~~~~~~~~~~~~~~~")
+
+}
+
+// TestGetQyDataLimit 导出企业数据 qyxy
+func TestGetQyDataLimit(T *testing.T) {
+	url := "http://127.0.0.1:19908"
+	username := "jybid"
+	password := "Top2023_JEB01i@31"
+	index := "qyxy" //索引名称
+	// 创建 Elasticsearch 客户端
+	client, err := elastic.NewClient(
+		elastic.SetURL(url),
+		elastic.SetBasicAuth(username, password),
+		elastic.SetSniff(false),
+	)
+	if err != nil {
+		log.Fatalf("创建 Elasticsearch 客户端失败:%s", err)
+	}
+	// 构建查询
+	rangeQuery := elastic.NewRangeQuery("establish_date").Gte("1704038400").Lt("1719763200")
+
+	query := elastic.NewBoolQuery().
+		Must(elastic.NewTermQuery("company_city", "长春市")).
+		Must(elastic.NewMatchQuery("company_type", "个体工商户")).
+		Must(elastic.NewMatchQuery("company_status", "存续")).
+		Must(rangeQuery)
+
+	MgoB := &mongodb.MongodbSim{
+		//MongodbAddr: "172.17.189.140:27080",
+		MongodbAddr: "127.0.0.1:27083",
+		Size:        10,
+		DbName:      "qfw",
+		UserName:    "SJZY_RWbid_ES",
+		Password:    "SJZY@B4i4D5e6S",
+		Direct:      true,
+	}
+	MgoB.InitPool()
+
+	// 执行查询
+	searchResult, err := client.Search().Size(200).
+		Index(index).
+		Query(query).
+		Do(context.Background())
+	if err != nil {
+		log.Fatalf("Error executing search: %s", err)
+	}
+
+	for _, hit := range searchResult.Hits.Hits {
+		var doc map[string]interface{}
+		err := json.Unmarshal(hit.Source, &doc)
+		if err != nil {
+			log.Printf("解析文档失败:%s", err)
+			continue
+		}
+
+		timeObj := time.Unix(util.Int64All(doc["establish_date"]), 0)
+		insert := map[string]interface{}{
+			"company_name":        doc["company_name"],
+			"company_type":        doc["company_type"],
+			"company_status":      doc["company_status"],
+			"authority":           doc["authority"],
+			"company_address":     doc["company_address"],
+			"company_code":        doc["company_code"],
+			"credit_no":           doc["credit_no"],
+			"legal_person":        doc["legal_person"],
+			"operation_startdate": doc["operation_startdate"],
+			"operation_enddate":   doc["operation_enddate"],
+			"business_scope":      doc["business_scope"],                 //经营范围
+			"establish_date":      timeObj.Format("2006-01-02 15:04:05"), // 注册时间,
+		}
+
+		MgoB.Save("wcc_qyxy_changchun_200", insert)
+		//id := util.ObjToString(doc["id"])
+		//data, _ := MgoB.FindById("bidding", id, nil)
+		//client2.Index().Index(index).Id(id).BodyJson(doc).Do(context.Background())
+		//MgoT.SaveByOriID("bidding", *data)
+	}
+
+	fmt.Println("结束~~~~~~~~~~~~~~~")
+
+}

+ 14 - 11
getEs/main.go

@@ -14,14 +14,17 @@ import (
 )
 
 func main() {
-	//getProjectData() //从es 拉取数据
-	//click() //写入clickhouse
+	/**
+	getProjectData  click 是一起使用的,统计获取中标企业信息
+	*/
+	getProjectDataFromEs() //1.拉取项目中标成交数据
+	//click() //2.处理项目数据,写入clickhouse
 	//click2()
 	//dealData()
 
 	//getProject()
 	//getQyLimitData()
-	getBiddingData()
+	//getBiddingData()
 	log.Println("over ------------------ over")
 }
 
@@ -171,14 +174,13 @@ func getBiddingData() {
 	fmt.Println("结束~~~~~~~~~~~~~~~")
 }
 
-// getData 处理北京 京津翼数据  投标相关数据
-func getProjectData() {
+// getProjectDataFromEs 获取项目 中标成交数据
+func getProjectDataFromEs() {
 	url := "http://172.17.4.184:19908"
 	//url := "http://127.0.0.1:19908"
 	username := "jybid"
 	password := "Top2023_JEB01i@31"
-	index := "qyxy" //索引名称
-	//index := "projectset" //索引名称
+	index := "projectset" //索引名称
 	// 创建 Elasticsearch 客户端
 	client, err := elastic.NewClient(
 		elastic.SetURL(url),
@@ -212,10 +214,11 @@ func getProjectData() {
 	//2023年01-01  2023-10-01,,1-3季度
 	//2024-1 - 2024-4;1704038400-1711900800
 	//2023-10-1 2024-1-1;1696089600-1704038400
-	areaTermsQuery := elastic.NewTermsQuery("area", "江苏", "安徽", "上海", "天津", "河北", "浙江", "天津市", "上海市", "河北省", "安徽省", "江苏省", "浙江省", "北京", "北京市")
-	rangeQuery := elastic.NewRangeQuery("firsttime").Gte(1696089600).Lt(1704038400)
+	//areaTermsQuery := elastic.NewTermsQuery("area", "江苏", "安徽", "上海", "天津", "河北", "浙江", "天津市", "上海市", "河北省", "安徽省", "江苏省", "浙江省", "北京", "北京市")
+	rangeQuery := elastic.NewRangeQuery("firsttime").Gte(1711900800).Lt(1719763200) //2024年4-7月
 	query := elastic.NewBoolQuery().
-		Must(areaTermsQuery).
+		//Must(areaTermsQuery).
+		Must(elastic.NewTermsQuery("subtype", "中标", "单一", "成交", "合同")).
 		Must(rangeQuery)
 
 	//rangeQuery := elastic.NewRangeQuery("comeintime").Gte("1640966400").Lt("1703952000")
@@ -272,7 +275,7 @@ func getProjectData() {
 				insert := doc
 				insert["s_winner"] = v
 				//存入新表
-				err = Mgo.InsertOrUpdate("top", "wcc_allcity_2024Q1", insert)
+				err = Mgo.InsertOrUpdate("top", "wcc_allcity_2024Q2", insert)
 				if err != nil {
 					log.Println("error", doc["id"])
 				}

+ 63 - 39
project_portrait/main.go

@@ -5,7 +5,6 @@ import (
 	"encoding/json"
 	"fmt"
 	"github.com/olivere/elastic/v7"
-	"github.com/robfig/cron/v3"
 	"github.com/spf13/viper"
 	"io"
 	util "jygit.jydev.jianyu360.cn/data_processing/common_utils"
@@ -21,10 +20,10 @@ var (
 	saveEsSp      = make(chan bool, 5)
 	EsBulkSize    = 50
 	Es            *es.Elastic
-	Mgo           *mongodb.MongodbSim //bidding 地址
-	MgoP          *mongodb.MongodbSim // 项目地址
-	portraitIndex = ""                // 画像索引
-	portraitMgo   = ""                // MongoDB 的表名
+	Mgo           *mongodb.MongodbSim     //bidding 地址
+	MgoP          *mongodb.MongodbSim     // 项目地址
+	portraitIndex = "project_portrait_v1" // 画像索引
+	portraitMgo   = "project_portrait"    // MongoDB 的表名
 	GF            GlobalConf
 	// 情报分类一级标签
 	topInfos = []string{"情报_物业", "情报_环境采购", "情报_印务商机", "情报_家具招投标", "情报_车辆租赁"}
@@ -113,19 +112,30 @@ func Init() {
 
 }
 func main() {
-	Init()
+	//Init()
+	Es = &es.Elastic{
+		S_esurl:  "http://192.168.3.149:9201",
+		I_size:   5,
+		Username: "",
+		Password: "",
+	}
+	Es.InitElasticSize()
+
 	go SaveEsMethod() // 生索引
 
-	//定时任务
-	local, _ := time.LoadLocation("Asia/Shanghai")
-	c := cron.New(cron.WithLocation(local), cron.WithSeconds())
-	_, err := c.AddFunc(GF.Env.Spec, dealIncData)
-	if err != nil {
-		log.Println("AddFunc err", err)
-	}
+	//dealAllDataB()
+	allDataEs()
 
-	c.Start()
-	defer c.Stop()
+	////定时任务
+	//local, _ := time.LoadLocation("Asia/Shanghai")
+	//c := cron.New(cron.WithLocation(local), cron.WithSeconds())
+	//_, err := c.AddFunc(GF.Env.Spec, dealIncData)
+	//if err != nil {
+	//	log.Println("AddFunc err", err)
+	//}
+	//
+	//c.Start()
+	//defer c.Stop()
 
 	select {}
 }
@@ -344,9 +354,14 @@ func dealAllData() {
 
 // dealAllDataB 处理存量数据,协程处理全部类型
 func dealAllDataB() {
-	url := "http://172.17.4.184:19908"
-	username := "jybid"
-	password := "Top2023_JEB01i@31"
+	//url := "http://172.17.4.184:19908"
+	//username := "jybid"
+	//password := "Top2023_JEB01i@31"
+	//index := "buyer"
+
+	url := "http://192.168.3.149:9201"
+	username := ""
+	password := ""
 	index := "buyer"
 
 	// 创建 Elasticsearch 客户端
@@ -359,12 +374,21 @@ func dealAllDataB() {
 		log.Fatalf("创建 Elasticsearch 客户端失败:%s", err)
 	}
 
+	//MgoB := &mongodb.MongodbSim{
+	//	MongodbAddr: "172.17.189.140:27080",
+	//	Size:        10,
+	//	DbName:      "qfw",
+	//	UserName:    "SJZY_RWbid_ES",
+	//	Password:    "SJZY@B4i4D5e6S",
+	//}
+	//MgoB.InitPool()
+
 	MgoB := &mongodb.MongodbSim{
-		MongodbAddr: "172.17.189.140:27080",
+		MongodbAddr: "192.168.3.206:27002",
 		Size:        10,
-		DbName:      "qfw",
-		UserName:    "SJZY_RWbid_ES",
-		Password:    "SJZY@B4i4D5e6S",
+		DbName:      "qfw_data",
+		UserName:    "root",
+		Password:    "root",
 	}
 	MgoB.InitPool()
 
@@ -486,7 +510,7 @@ func processHit(hit *elastic.SearchHit, client *elastic.Client, MgoB *mongodb.Mo
 			} else {
 				log.Println("Aggregation not found")
 			}
-			MgoB.Save(portraitMgo, structToMap(portrait))
+			MgoB.Save("project_portrait", structToMap(portrait))
 		}
 	}
 }
@@ -593,26 +617,26 @@ func incDataEs() {
 
 // allDataEs 处理存量数据到es
 func allDataEs() {
-	MgoB := &mongodb.MongodbSim{
-		MongodbAddr: "172.17.189.140:27080",
-		//MongodbAddr: "127.0.0.1:27083",
-		Size:     10,
-		DbName:   "qfw",
-		UserName: "SJZY_RWbid_ES",
-		Password: "SJZY@B4i4D5e6S",
-		//Direct:      true,
-	}
-	MgoB.InitPool()
-	// 测试环境
 	//MgoB := &mongodb.MongodbSim{
-	//	MongodbAddr: "192.168.3.206:27002",
-	//	Size:        10,
-	//	DbName:      "qfw_data",
-	//	UserName:    "root",
-	//	Password:    "root",
+	//	MongodbAddr: "172.17.189.140:27080",
+	//	//MongodbAddr: "127.0.0.1:27083",
+	//	Size:     10,
+	//	DbName:   "qfw",
+	//	UserName: "SJZY_RWbid_ES",
+	//	Password: "SJZY@B4i4D5e6S",
 	//	//Direct:      true,
 	//}
 	//MgoB.InitPool()
+	// 测试环境
+	MgoB := &mongodb.MongodbSim{
+		MongodbAddr: "192.168.3.206:27002",
+		Size:        10,
+		DbName:      "qfw_data",
+		UserName:    "root",
+		Password:    "root",
+		//Direct:      true,
+	}
+	MgoB.InitPool()
 
 	defer util.Catch()
 	sess := MgoB.GetMgoConn()

+ 52 - 65
updateBidding/main.go

@@ -29,16 +29,16 @@ var (
 
 func main() {
 	//mongodb 163
-	//Mgo = &mongodb.MongodbSim{
-	//	//MongodbAddr: "172.17.189.140:27080",
-	//	MongodbAddr: "127.0.0.1:27083",
-	//	DbName:      "qfw",
-	//	Size:        10,
-	//	UserName:    "SJZY_RWbid_ES",
-	//	Password:    "SJZY@B4i4D5e6S",
-	//	Direct:      true,
-	//}
-	//Mgo.InitPool()
+	Mgo = &mongodb.MongodbSim{
+		//MongodbAddr: "172.17.189.140:27080",
+		MongodbAddr: "127.0.0.1:27083",
+		DbName:      "qfw",
+		Size:        10,
+		UserName:    "SJZY_RWbid_ES",
+		Password:    "SJZY@B4i4D5e6S",
+		Direct:      true,
+	}
+	Mgo.InitPool()
 
 	//85
 	//MgoR = &mongodb.MongodbSim{
@@ -51,53 +51,53 @@ func main() {
 	//MgoR.InitPool()
 
 	////测试环境MongoDB
-	MgoT = &mongodb.MongodbSim{
-		//MongodbAddr: "172.17.189.140:27080",
-		MongodbAddr: "192.168.3.206:27002",
-		DbName:      "qfw_data",
-		Size:        10,
-		UserName:    "root",
-		Password:    "root",
-		//Direct:      true,
-	}
-	MgoT.InitPool()
+	//MgoT = &mongodb.MongodbSim{
+	//	//MongodbAddr: "172.17.189.140:27080",
+	//	MongodbAddr: "192.168.3.206:27002",
+	//	DbName:      "qfw_data",
+	//	Size:        10,
+	//	UserName:    "root",
+	//	Password:    "root",
+	//	//Direct:      true,
+	//}
+	//MgoT.InitPool()
 
 	// 测试环境es
-	Es = &elastic.Elastic{
-		S_esurl: "http://192.168.3.149:9201",
-		//S_esurl:  "http://172.17.4.184:19805",
-		I_size:   5,
-		Username: "",
-		Password: "",
-	}
-	Es.InitElasticSize()
-
-	//es
 	//Es = &elastic.Elastic{
-	//	S_esurl: "http://127.0.0.1:19908",
-	//	//S_esurl:  "http://172.17.4.184:19908",
+	//	S_esurl: "http://192.168.3.149:9201",
+	//	//S_esurl:  "http://172.17.4.184:19805",
 	//	I_size:   5,
-	//	Username: "jybid",
-	//	Password: "Top2023_JEB01i@31",
+	//	Username: "",
+	//	Password: "",
 	//}
 	//Es.InitElasticSize()
 
-	// es 新集群
-	//EsNew = &elastic.Elastic{
-	//	S_esurl: "http://127.0.0.1:19905",
-	//	//S_esurl:  "http://172.17.4.184:19905",
-	//	I_size:   5,
-	//	Username: "jybid",
-	//	Password: "Top2023_JEB01i@31",
-	//}
-	//EsNew.InitElasticSize()
+	//es
+	Es = &elastic.Elastic{
+		S_esurl: "http://127.0.0.1:19908",
+		//S_esurl:  "http://172.17.4.184:19908",
+		I_size:   5,
+		Username: "jybid",
+		Password: "Top2023_JEB01i@31",
+	}
+	Es.InitElasticSize()
+
+	//es 新集群
+	EsNew = &elastic.Elastic{
+		S_esurl: "http://127.0.0.1:19905",
+		//S_esurl:  "http://172.17.4.184:19905",
+		I_size:   5,
+		Username: "jybid",
+		Password: "Top2023_JEB01i@31",
+	}
+	EsNew.InitElasticSize()
 
 	//go updateMethod()   //更新mongodb
-	go updateEsMethod() //更新es
+	//go updateEsMethod() //更新es
 	//go updateProjectEsMethod()
 	//taskRunProject()
-	//taskRunBidding()
-	dealBiddingTest() // 测试环境数据处理
+	taskRunBidding()
+	//dealBiddingTest() // 测试环境数据处理
 
 	//updateProject()
 	fmt.Println("over")
@@ -130,7 +130,7 @@ func taskRunBidding() {
 	//}
 
 	//selected := map[string]interface{}{"contenthtml": 0, "detail": 0}
-	it := sess.DB("qfw").C("zktest_bidding_0619_compare").Find(nil).Select(nil).Sort("_id").Iter()
+	it := sess.DB("qfw").C("zktest_bidding_0706").Find(nil).Select(nil).Sort("_id").Iter()
 
 	fmt.Println("taskRun 开始")
 	count := 0
@@ -161,25 +161,12 @@ func taskRunBidding() {
 		//	update["district"] = ""
 		//}
 
-		// 2.更新中标单位,中标金额
-		if winner, ok := tmp["winner"]; ok && winner != nil {
-			update["winner"] = winner
-		} else {
-			update["winner"] = ""
-		}
-		if s_winner, ok := tmp["s_winner"]; ok && s_winner != nil {
-			update["s_winner"] = s_winner
-		} else {
-			update["s_winner"] = ""
-		}
-		if bidamount, ok := tmp["bidamount"]; ok && bidamount != nil {
-			update["bidamount"] = bidamount
-		} else {
-			update["bidamount"] = nil
-		}
+		// 2.更新中标单位
 
-		//biddingID := util.ObjToString(tmp["id"])
-		biddingID := mongodb.BsonIdToSId(tmp["_id"])
+		biddingID := util.ObjToString(tmp["id"])
+		//biddingID := mongodb.BsonIdToSId(tmp["_id"])
+		update["winner"] = ""
+		update["s_winner"] = ""
 
 		if len(update) > 0 {
 			//Mgo.UpdateById("bidding", biddingID, map[string]interface{}{"$set": update})

+ 2 - 2
xlsx/xlsx_test.go

@@ -196,7 +196,7 @@ func TestAAA(t *testing.T) {
 	sess := Mgo.GetMgoConn()
 	defer Mgo.DestoryMongoConn(sess)
 
-	f, err := excelize.OpenFile("./河南新增专项债-06.xlsx")
+	f, err := excelize.OpenFile("./湖北新增专项债.xlsx")
 	if err != nil {
 		fmt.Println(err)
 		return
@@ -243,7 +243,7 @@ func TestAAA(t *testing.T) {
 		where := map[string]interface{}{
 			"project.jcxx.projectName": projectName,
 		}
-		detail, _ := Mgo.FindOne("specialbond_detail_202406", where)
+		detail, _ := Mgo.FindOne("specialbond_detail_202407", where)
 		if len(*detail) == 0 {
 			continue
 		}

BIN
xlsx/河南新增专项债-07.xlsx


BIN
xlsx/湖北新增专项债.xlsx


BIN
xlsx/长春-个体.xlsx