|
@@ -41,13 +41,13 @@ var (
|
|
|
|
|
|
func Init() {
|
|
|
MgoB = &mongodb.MongodbSim{
|
|
|
- MongodbAddr: "172.31.31.202:27081,172.20.45.128:27080",
|
|
|
- //MongodbAddr: "127.0.0.1:27083",
|
|
|
- DbName: "qfw",
|
|
|
- Size: 10,
|
|
|
- UserName: "SJZY_RWbid_ES",
|
|
|
- Password: "SJZY@B4i4D5e6S",
|
|
|
- //Direct: true,
|
|
|
+ //MongodbAddr: "172.31.31.202:27081,172.20.45.128:27080",
|
|
|
+ MongodbAddr: "127.0.0.1:27083",
|
|
|
+ DbName: "qfw",
|
|
|
+ Size: 10,
|
|
|
+ UserName: "SJZY_RWbid_ES",
|
|
|
+ Password: "SJZY@B4i4D5e6S",
|
|
|
+ Direct: true,
|
|
|
}
|
|
|
MgoB.InitPool()
|
|
|
|
|
@@ -108,8 +108,8 @@ func Init() {
|
|
|
|
|
|
//es
|
|
|
Es = &elastic.Elastic{
|
|
|
- //S_esurl: "http://127.0.0.1:19908",
|
|
|
- S_esurl: "http://172.17.4.184:19908",
|
|
|
+ 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",
|
|
@@ -118,8 +118,8 @@ func Init() {
|
|
|
|
|
|
//es 新集群
|
|
|
EsNew = &elastic.Elastic{
|
|
|
- //S_esurl: "http://127.0.0.1:19905",
|
|
|
- S_esurl: "http://172.17.4.184:19905",
|
|
|
+ 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",
|
|
@@ -197,7 +197,7 @@ func taskRunBidding() {
|
|
|
//}
|
|
|
|
|
|
//selected := map[string]interface{}{"contenthtml": 0, "detail": 0}
|
|
|
- it := sess.DB("qfw").C("zktest_0401").Find(nil).Select(nil).Iter()
|
|
|
+ it := sess.DB("qfw").C("zktest_0428").Find(nil).Select(nil).Iter()
|
|
|
|
|
|
fmt.Println("taskRun 开始")
|
|
|
count := 0
|
|
@@ -222,34 +222,37 @@ func taskRunBidding() {
|
|
|
// update["city"] = ""
|
|
|
//}
|
|
|
//
|
|
|
- if district, ok := tmp["district"]; ok && district != nil {
|
|
|
- if district == "乌拉盖管委会" {
|
|
|
- update["district"] = "乌拉盖管理区管委会"
|
|
|
- } else if district == "错那县" {
|
|
|
- update["district"] = "错那市"
|
|
|
- } else if district == "河南周口经济开发区" {
|
|
|
- update["district"] = "周口临港开发区"
|
|
|
- } else if district == "米林县" {
|
|
|
- update["district"] = "米林市"
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ //if district, ok := tmp["district"]; ok && district != nil {
|
|
|
+ // if district == "乌拉盖管委会" {
|
|
|
+ // update["district"] = "乌拉盖管理区管委会"
|
|
|
+ // } else if district == "错那县" {
|
|
|
+ // update["district"] = "错那市"
|
|
|
+ // } else if district == "河南周口经济开发区" {
|
|
|
+ // update["district"] = "周口临港开发区"
|
|
|
+ // } else if district == "米林县" {
|
|
|
+ // update["district"] = "米林市"
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //}
|
|
|
+ //-------------------------------------------//
|
|
|
// 2.更新中标单位
|
|
|
-
|
|
|
- biddingID := util.ObjToString(tmp["id"])
|
|
|
+ //biddingID := util.ObjToString(tmp["id"])
|
|
|
////biddingID := mongodb.BsonIdToSId(tmp["_id"])
|
|
|
//update["winner"] = ""
|
|
|
//update["s_winner"] = ""
|
|
|
- //
|
|
|
+ //-------------------------------------------//
|
|
|
+ //3. 更新中标金额
|
|
|
+ biddingID := util.ObjToString(tmp["tmpid"])
|
|
|
+ update["bidamount"] = tmp["bidamount"]
|
|
|
+ // 更新 MongoDB + ES
|
|
|
if len(update) > 0 {
|
|
|
- //Mgo.UpdateById("bidding", biddingID, map[string]interface{}{"$set": update})
|
|
|
+ MgoB.UpdateById("bidding", biddingID, map[string]interface{}{"$set": update})
|
|
|
//2.es 项目 更新字段
|
|
|
- err := Es.UpdateDocument("bidding", biddingID, update)
|
|
|
- err = EsNew.UpdateDocument("bidding", biddingID, update)
|
|
|
- if err != nil && err.Error() != "Document not updated: noop" {
|
|
|
- log.Info("bidding es update err", err, biddingID)
|
|
|
- }
|
|
|
+ //err := Es.UpdateDocument("bidding", biddingID, update)
|
|
|
+ //err = EsNew.UpdateDocument("bidding", biddingID, update)
|
|
|
+ //if err != nil && err.Error() != "Document not updated: noop" {
|
|
|
+ // log.Info("bidding es update err", err, biddingID)
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
}
|