|
@@ -74,23 +74,24 @@ func updateMarkIdHospital() {
|
|
|
it := sess.DB(class.Save_Mgo.DbName).C(merge_hospital_coll_2).Find(&q).Sort("_id").Iter()
|
|
|
total, isok := 0, 0
|
|
|
for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
- if total%1000 == 0 {
|
|
|
+ if total%10000 == 0 {
|
|
|
log.Debug("cur index ", total, isok)
|
|
|
}
|
|
|
tmpid := class.BsonTOStringId(tmp["_id"])
|
|
|
company_id := qu.ObjToString(tmp["company_id"])
|
|
|
mark_id := qu.IntAll(tmp["mark_id"])
|
|
|
if mark_id == 0 && company_id == "" {
|
|
|
+ isok++
|
|
|
c_id := uuid.New().String()
|
|
|
c_id = strings.ReplaceAll(c_id, "-", "")
|
|
|
- class.Save_Mgo.UpdateById(merge_hospital_coll_1, tmpid, map[string]interface{}{
|
|
|
+ class.Save_Mgo.UpdateById(merge_hospital_coll_2, tmpid, map[string]interface{}{
|
|
|
"$set": map[string]interface{}{
|
|
|
"company_id": c_id,
|
|
|
- "mark_id": 0,
|
|
|
+ "mark_id": 3,
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
tmp = make(map[string]interface{})
|
|
|
}
|
|
|
- log.Debug("更新机构~自生id~~over~~ ", total)
|
|
|
+ log.Debug("更新机构~自生id~~over~~ ", total, isok)
|
|
|
}
|