|
@@ -17,49 +17,44 @@ func saveBiddingPurMysql() {
|
|
|
log.Debug("分析数据-保存两个mysql表...")
|
|
|
sess := save_mgo.GetMgoConn()
|
|
|
defer save_mgo.DestoryMongoConn(sess)
|
|
|
- q,total,isok:=map[string]interface{}{},0,0
|
|
|
+ q, total, isok := map[string]interface{}{}, 0, 0
|
|
|
it := sess.DB(save_mgo.DbName).C(o_bidding_coll).Find(&q).Iter()
|
|
|
- for tmp := make(map[string]interface{}); it.Next(&tmp);total++{
|
|
|
- if total%1000==0 {
|
|
|
- log.Debug("curent index ",total,isok)
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
+ if total%1000 == 0 {
|
|
|
+ log.Debug("curent index ", total, isok)
|
|
|
}
|
|
|
tmpid := BsonTOStringId(tmp["_id"])
|
|
|
- repeat:= qu.IntAll(tmp["repeat"])
|
|
|
- subtype:= qu.ObjToString(tmp["subtype"])
|
|
|
- if repeat!=1 {
|
|
|
- if subtype=="单一"||subtype=="中标"||subtype=="成交"||subtype=="合同" {
|
|
|
+ repeat := qu.IntAll(tmp["repeat"])
|
|
|
+ subtype := qu.ObjToString(tmp["subtype"])
|
|
|
+ if repeat != 1 {
|
|
|
+ if subtype == "单一" || subtype == "中标" || subtype == "成交" || subtype == "合同" {
|
|
|
isok++
|
|
|
- dealWithBidData(tmp,tmpid)
|
|
|
- dealWithPurData(tmp,tmpid)
|
|
|
+ dealWithBidData(tmp, tmpid)
|
|
|
+ dealWithPurData(tmp, tmpid)
|
|
|
}
|
|
|
}
|
|
|
tmp = make(map[string]interface{})
|
|
|
}
|
|
|
- log.Debug("is over ",total,isok)
|
|
|
+ log.Debug("is over ", total, isok)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//构建-招投标数据-无异常
|
|
|
-func dealWithBidData(tmp map[string]interface{},tmpid string){
|
|
|
+func dealWithBidData(tmp map[string]interface{}, tmpid string) {
|
|
|
data := map[string]interface{}{}
|
|
|
data["info_id"] = tmp["info_id"]
|
|
|
data["projectname"] = tmp["projectname"]
|
|
|
publishtime := qu.Int64All(tmp["publishtime"])
|
|
|
- new_publishtime := ""//转日期
|
|
|
- if publishtime>0 {
|
|
|
+ new_publishtime := "" //转日期
|
|
|
+ if publishtime > 0 {
|
|
|
new_publishtime = time.Unix(publishtime, 0).Format(timeLayout)
|
|
|
data["publishtime"] = new_publishtime
|
|
|
}
|
|
|
data["buyer_name"] = qu.ObjToString(tmp["buyer"])
|
|
|
data["buyer_depart"] = ""
|
|
|
- if tmp["budget"]!=nil && qu.Float64All(tmp["budget"]) < 1000000000.0 {
|
|
|
+ if tmp["budget"] != nil && qu.Float64All(tmp["budget"]) < 1000000000.0 {
|
|
|
data["budget"] = qu.Float64All(tmp["budget"])
|
|
|
}
|
|
|
- if tmp["bidamount"]!=nil && qu.Float64All(tmp["bidamount"]) < 1000000000.0 {
|
|
|
+ if tmp["bidamount"] != nil && qu.Float64All(tmp["bidamount"]) < 1000000000.0 {
|
|
|
data["bidamount"] = qu.Float64All(tmp["bidamount"])
|
|
|
}
|
|
|
data["agency_name"] = qu.ObjToString(tmp["agency"])
|
|
@@ -69,33 +64,32 @@ func dealWithBidData(tmp map[string]interface{},tmpid string){
|
|
|
data["updatetime"] = updatetime
|
|
|
|
|
|
// info_type buyer_classcode area_code industry_code
|
|
|
- info_type_key :=qu.ObjToString(tmp["toptype"])+"_"+qu.ObjToString(tmp["subtype"])
|
|
|
+ info_type_key := qu.ObjToString(tmp["toptype"]) + "_" + qu.ObjToString(tmp["subtype"])
|
|
|
data["info_type"] = bidclass_dict[info_type_key]
|
|
|
|
|
|
buyerclass := qu.ObjToString(tmp["buyerclass"])
|
|
|
- data["buyer_classcode"] =buyerclass_dict[buyerclass]
|
|
|
-
|
|
|
- area_key := qu.ObjToString(tmp["area"])+"_"+qu.ObjToString(tmp["city"])+"_"+qu.ObjToString(tmp["district"])
|
|
|
- data["area_code"] =area_dict[area_key]
|
|
|
+ data["buyer_classcode"] = buyerclass_dict[buyerclass]
|
|
|
|
|
|
+ area_key := qu.ObjToString(tmp["area"]) + "_" + qu.ObjToString(tmp["city"]) + "_" + qu.ObjToString(tmp["district"])
|
|
|
+ data["area_code"] = area_dict[area_key]
|
|
|
|
|
|
subscopeclass := []string{}
|
|
|
if res, ok := tmp["subscopeclass"].(primitive.A); ok {
|
|
|
subscopeclass = qu.ObjArrToStringArr(res)
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
if res, ok := tmp["subscopeclass"].([]interface{}); ok {
|
|
|
subscopeclass = qu.ObjArrToStringArr(res)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- industry_code,industry_code_other:="",""
|
|
|
- for _,v := range subscopeclass{
|
|
|
- if strings.Contains(v,"医疗卫生") {
|
|
|
+ industry_code, industry_code_other := "", ""
|
|
|
+ for _, v := range subscopeclass {
|
|
|
+ if strings.Contains(v, "医疗卫生") {
|
|
|
industry_code = industry_dict[v]
|
|
|
- }else {
|
|
|
- if industry_code_other!="" {
|
|
|
- industry_code_other = industry_code_other+","+industry_dict[v]
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
+ if industry_code_other != "" {
|
|
|
+ industry_code_other = industry_code_other + "," + industry_dict[v]
|
|
|
+ } else {
|
|
|
industry_code_other = industry_dict[v]
|
|
|
}
|
|
|
}
|
|
@@ -103,14 +97,15 @@ func dealWithBidData(tmp map[string]interface{},tmpid string){
|
|
|
data["industry_code"] = industry_code
|
|
|
data["industry_code_other"] = industry_code_other
|
|
|
|
|
|
- insertMysqlData("f_bidding",data,tmpid)
|
|
|
+ insertMysqlData("f_bidding", data, tmpid)
|
|
|
}
|
|
|
+
|
|
|
//构建-标的物信息-关联企业信息
|
|
|
-func dealWithPurData(tmp map[string]interface{},tmpid string){
|
|
|
+func dealWithPurData(tmp map[string]interface{}, tmpid string) {
|
|
|
p_list := []map[string]interface{}{}
|
|
|
if yl_purchasinglist, ok := tmp["yl_purchasinglist"].(primitive.A); ok {
|
|
|
p_list = qu.ObjArrToMapArr(yl_purchasinglist)
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
if yl_purchasinglist, ok := tmp["yl_purchasinglist"].([]interface{}); ok {
|
|
|
p_list = qu.ObjArrToMapArr(yl_purchasinglist)
|
|
|
}
|
|
@@ -118,7 +113,7 @@ func dealWithPurData(tmp map[string]interface{},tmpid string){
|
|
|
|
|
|
info_id := qu.ObjToString(tmp["info_id"])
|
|
|
s_winner := qu.ObjToString(tmp["s_winner"])
|
|
|
- for _,v:=range p_list{
|
|
|
+ for _, v := range p_list {
|
|
|
data := map[string]interface{}{}
|
|
|
product_name := qu.ObjToString(v["product_name"])
|
|
|
brandname := qu.ObjToString(v["brandname"])
|
|
@@ -129,46 +124,45 @@ func dealWithPurData(tmp map[string]interface{},tmpid string){
|
|
|
data["product_specs"] = ""
|
|
|
|
|
|
product_model := qu.ObjToString(v["model"])
|
|
|
- if utf8.RuneCountInString(product_model)>100 {
|
|
|
+ if utf8.RuneCountInString(product_model) > 100 {
|
|
|
product_model = ""
|
|
|
}
|
|
|
data["product_model"] = product_model
|
|
|
|
|
|
-
|
|
|
- if v["unitprice"]!=nil {
|
|
|
+ if v["unitprice"] != nil {
|
|
|
data["product_price"] = qu.Float64All(v["unitprice"])
|
|
|
}
|
|
|
- if v["number"]!=nil {
|
|
|
+ if v["number"] != nil {
|
|
|
data["product_num"] = qu.Float64All(v["number"])
|
|
|
}
|
|
|
- if v["totalprice"]!=nil {
|
|
|
+ if v["totalprice"] != nil {
|
|
|
data["product_totalprice"] = qu.Float64All(v["totalprice"])
|
|
|
}
|
|
|
|
|
|
- if v["unitname"]!=nil {
|
|
|
+ if v["unitname"] != nil {
|
|
|
data["product_unit"] = qu.ObjToString(v["unitname"])
|
|
|
}
|
|
|
|
|
|
//涉及-bid_company_name bid_company_id bid_company_ysname -关联f_company
|
|
|
- if s_winner != "" {
|
|
|
- if strings.Contains(s_winner,",") {
|
|
|
+ if s_winner != "" {
|
|
|
+ if strings.Contains(s_winner, ",") {
|
|
|
data["bid_company_id"] = ""
|
|
|
data["bid_company_name"] = ""
|
|
|
data["bid_company_ysname"] = s_winner
|
|
|
- }else {//查询f_company...
|
|
|
- query:= map[string]interface{}{"company_name":s_winner}
|
|
|
- find_data := MysqlTool.FindOne("f_company", query,"company_id","")
|
|
|
- if find_data==nil {
|
|
|
+ } else { //查询f_company...
|
|
|
+ query := map[string]interface{}{"company_name": s_winner}
|
|
|
+ find_data := MysqlTool.FindOne("f_company", query, "company_id", "")
|
|
|
+ if find_data == nil {
|
|
|
data["bid_company_id"] = ""
|
|
|
data["bid_company_name"] = s_winner
|
|
|
data["bid_company_ysname"] = ""
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
data["bid_company_id"] = qu.ObjToString((*find_data)["company_id"])
|
|
|
data["bid_company_name"] = s_winner
|
|
|
data["bid_company_ysname"] = ""
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
data["bid_company_id"] = ""
|
|
|
data["bid_company_name"] = ""
|
|
|
data["bid_company_ysname"] = ""
|
|
@@ -176,24 +170,24 @@ func dealWithPurData(tmp map[string]interface{},tmpid string){
|
|
|
|
|
|
//涉及-make_company_id make_company_name make_company_ysname -关联f_product
|
|
|
query := "SELECT company_id,company_name FROM f_product WHERE product_name = ? and (business_type = ? or business_type = ?)"
|
|
|
- proinfo := MysqlTool.SelectBySql(query, product_name,"1","3")
|
|
|
+ proinfo := MysqlTool.SelectBySql(query, product_name, "1", "3")
|
|
|
if len(*proinfo) == 1 { //查询到多条-同产品信息
|
|
|
- info :=(*proinfo)[0]
|
|
|
+ info := (*proinfo)[0]
|
|
|
data["make_company_id"] = qu.ObjToString(info["company_id"])
|
|
|
data["make_company_name"] = qu.ObjToString(info["company_name"])
|
|
|
data["make_company_ysname"] = ""
|
|
|
- }else if len(*proinfo) > 1 {//如果有多个企业-生产信息
|
|
|
- isUse,c_name,c_id := matchedManufacturer(brandname,*proinfo)
|
|
|
+ } else if len(*proinfo) > 1 { //如果有多个企业-生产信息
|
|
|
+ isUse, c_name, c_id := matchedManufacturer(brandname, *proinfo)
|
|
|
if isUse {
|
|
|
data["make_company_id"] = c_id
|
|
|
data["make_company_name"] = c_name
|
|
|
data["make_company_ysname"] = ""
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
data["make_company_id"] = ""
|
|
|
data["make_company_name"] = ""
|
|
|
data["make_company_ysname"] = c_name
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
data["make_company_id"] = ""
|
|
|
data["make_company_name"] = ""
|
|
|
data["make_company_ysname"] = ""
|
|
@@ -204,90 +198,85 @@ func dealWithPurData(tmp map[string]interface{},tmpid string){
|
|
|
product_class_2 := qu.ObjToString(v["product_class_2"])
|
|
|
product_class_3 := qu.ObjToString(v["product_class_3"])
|
|
|
|
|
|
- key_4 := "四级_"+product_name
|
|
|
- if proclass_name_dict[key_4]!="" {
|
|
|
+ key_4 := "四级_" + product_name
|
|
|
+ if proclass_name_dict[key_4] != "" {
|
|
|
data["product_code"] = proclass_name_dict[key_4]
|
|
|
- }else {
|
|
|
- pro_key := fmt.Sprintf("%s_%s_%s",product_class_1,product_class_2,product_class_3)
|
|
|
+ } else {
|
|
|
+ pro_key := fmt.Sprintf("%s_%s_%s", product_class_1, product_class_2, product_class_3)
|
|
|
data["product_code"] = proclass_name_dict[pro_key]
|
|
|
}
|
|
|
- insertMysqlData("f_bidproduct",data,tmpid)
|
|
|
+ insertMysqlData("f_bidproduct", data, tmpid)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//根据品牌字段匹配-有效生产企业-过多10条
|
|
|
-func matchedManufacturer(brandName string,infoArr []map[string]interface{}) (bool,string,string) {
|
|
|
- c_name :=""
|
|
|
+func matchedManufacturer(brandName string, infoArr []map[string]interface{}) (bool, string, string) {
|
|
|
+ c_name := ""
|
|
|
namedict := map[string]string{}
|
|
|
- for i:=0;i<len(infoArr);i++{
|
|
|
+ for i := 0; i < len(infoArr); i++ {
|
|
|
info := infoArr[i]
|
|
|
company_name := qu.ObjToString(info["company_name"])
|
|
|
company_id := qu.ObjToString(info["company_id"])
|
|
|
- if brandName!="" { //品牌匹配
|
|
|
+ if brandName != "" { //品牌匹配
|
|
|
if strings.
|
|
|
- Contains(company_name,brandName) {
|
|
|
- return true,company_name,company_id
|
|
|
+ Contains(company_name, brandName) {
|
|
|
+ return true, company_name, company_id
|
|
|
}
|
|
|
}
|
|
|
if len(namedict) < 10 {
|
|
|
- if c_name=="" {
|
|
|
+ if c_name == "" {
|
|
|
c_name = company_name
|
|
|
namedict[company_name] = company_id
|
|
|
- }else {
|
|
|
- if namedict[company_name]=="" {
|
|
|
- c_name += ","+company_name
|
|
|
+ } else {
|
|
|
+ if namedict[company_name] == "" {
|
|
|
+ c_name += "," + company_name
|
|
|
namedict[company_name] = company_id
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if len(namedict)==1 {
|
|
|
- return true,c_name,namedict[c_name]
|
|
|
+ if len(namedict) == 1 {
|
|
|
+ return true, c_name, namedict[c_name]
|
|
|
}
|
|
|
- return false,c_name,""
|
|
|
+ return false, c_name, ""
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//准备工作-导出源数据很重要... 163
|
|
|
func exportUsefulPurBidData() {
|
|
|
sess := qy_mgo.GetMgoConn()
|
|
|
defer qy_mgo.DestoryMongoConn(sess)
|
|
|
//构建标准产品数据
|
|
|
- dataArr,_ := save_mgo.Find("zktest_mairui",nil,nil,nil)
|
|
|
- for _,v := range dataArr {
|
|
|
+ dataArr, _ := save_mgo.Find("zktest_mairui", nil, nil, nil)
|
|
|
+ for _, v := range dataArr {
|
|
|
name := qu.ObjToString(v["name"])
|
|
|
proNameDict[name] = name
|
|
|
}
|
|
|
- log.Debug("迈瑞产品...",len(proNameDict))
|
|
|
- q,total:=map[string]interface{}{
|
|
|
+ log.Debug("迈瑞产品...", len(proNameDict))
|
|
|
+ q, total := map[string]interface{}{
|
|
|
"publishtime": map[string]interface{}{
|
|
|
- "$gte":1546272000,
|
|
|
+ "$gte": 1546272000,
|
|
|
},
|
|
|
- },0
|
|
|
- isok:=0
|
|
|
+ }, 0
|
|
|
+ isok := 0
|
|
|
it := sess.DB("qfw").C(s_bidding_coll).Find(&q).Sort("_id").Iter()
|
|
|
- for tmp := make(map[string]interface{}); it.Next(&tmp);total++{
|
|
|
- if total%10000==0 {
|
|
|
- log.Debug("curent index ",total,tmp["_id"],"~",isok)
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
+ if total%10000 == 0 {
|
|
|
+ log.Debug("curent index ", total, tmp["_id"], "~", isok)
|
|
|
}
|
|
|
p_list := []map[string]interface{}{}
|
|
|
new_data := map[string]interface{}{}
|
|
|
if yl_purchasinglist, ok := tmp["yl_purchasinglist"].(primitive.A); ok {
|
|
|
p_list = qu.ObjArrToMapArr(yl_purchasinglist)
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
if yl_purchasinglist, ok := tmp["yl_purchasinglist"].([]interface{}); ok {
|
|
|
p_list = qu.ObjArrToMapArr(yl_purchasinglist)
|
|
|
}
|
|
|
}
|
|
|
//临时-匹配是不是含有-有效迈瑞-产品
|
|
|
- if len(p_list)>0 {
|
|
|
+ if len(p_list) > 0 {
|
|
|
new_p_list := matchUsefulMrBidProduct(p_list)
|
|
|
- if len(new_p_list)>0 {
|
|
|
+ if len(new_p_list) > 0 {
|
|
|
isok++
|
|
|
s_winner := qu.ObjToString(tmp["s_winner"])
|
|
|
new_data["yl_purchasinglist"] = p_list
|
|
@@ -296,121 +285,103 @@ func exportUsefulPurBidData() {
|
|
|
new_data["_id"] = tmp["_id"]
|
|
|
new_data["subtype"] = qu.ObjToString(tmp["subtype"])
|
|
|
new_data["toptype"] = qu.ObjToString(tmp["toptype"])
|
|
|
- new_data["projectname"] =qu.ObjToString(tmp["projectname"])
|
|
|
+ new_data["projectname"] = qu.ObjToString(tmp["projectname"])
|
|
|
new_data["publishtime"] = qu.IntAll(tmp["publishtime"])
|
|
|
- new_data["buyer"] =qu.ObjToString(tmp["buyer"])
|
|
|
- new_data["buyerclass"] =qu.ObjToString(tmp["buyerclass"])
|
|
|
- if tmp["budget"]!=nil {
|
|
|
- new_data["budget"] =tmp["budget"]
|
|
|
+ new_data["buyer"] = qu.ObjToString(tmp["buyer"])
|
|
|
+ new_data["buyerclass"] = qu.ObjToString(tmp["buyerclass"])
|
|
|
+ if tmp["budget"] != nil {
|
|
|
+ new_data["budget"] = tmp["budget"]
|
|
|
}
|
|
|
- if tmp["bidamount"]!=nil {
|
|
|
- new_data["bidamount"] =tmp["bidamount"]
|
|
|
+ if tmp["bidamount"] != nil {
|
|
|
+ new_data["bidamount"] = tmp["bidamount"]
|
|
|
}
|
|
|
- new_data["s_winner"] =s_winner
|
|
|
- new_data["agency"] =qu.ObjToString(tmp["agency"])
|
|
|
- new_data["area"] =qu.ObjToString(tmp["area"])
|
|
|
- new_data["city"] =qu.ObjToString(tmp["city"])
|
|
|
- new_data["district"] =qu.ObjToString(tmp["district"])
|
|
|
+ new_data["s_winner"] = s_winner
|
|
|
+ new_data["agency"] = qu.ObjToString(tmp["agency"])
|
|
|
+ new_data["area"] = qu.ObjToString(tmp["area"])
|
|
|
+ new_data["city"] = qu.ObjToString(tmp["city"])
|
|
|
+ new_data["district"] = qu.ObjToString(tmp["district"])
|
|
|
new_data["jyhref"] = fmt.Sprintf(Url, qu.CommonEncodeArticle("content", tmpid))
|
|
|
|
|
|
- if tmp["subscopeclass"]!=nil {
|
|
|
+ if tmp["subscopeclass"] != nil {
|
|
|
new_data["subscopeclass"] = tmp["subscopeclass"]
|
|
|
}
|
|
|
- save_mgo.Save(o_bidding_coll,new_data)
|
|
|
- save_mgo.Save("zktest_mysql_bidding_repeat",tmp) //业务判重需要-
|
|
|
+ save_mgo.Save(o_bidding_coll, new_data)
|
|
|
+ save_mgo.Save("zktest_mysql_bidding_repeat", tmp) //业务判重需要-
|
|
|
}
|
|
|
}
|
|
|
tmp = make(map[string]interface{})
|
|
|
}
|
|
|
-
|
|
|
- log.Debug("is bidding over ",total,isok)
|
|
|
+ log.Debug("is bidding over ", total, isok)
|
|
|
}
|
|
|
-func matchUsefulMrBidProduct(p_list []map[string]interface{})(new_p_list []map[string]interface{}){
|
|
|
- for _,v := range p_list {
|
|
|
+func matchUsefulMrBidProduct(p_list []map[string]interface{}) (new_p_list []map[string]interface{}) {
|
|
|
+ for _, v := range p_list {
|
|
|
product_name := qu.ObjToString(v["product_name"])
|
|
|
if proNameDict[product_name] != "" {
|
|
|
- new_p_list =append(new_p_list,v)
|
|
|
+ new_p_list = append(new_p_list, v)
|
|
|
}
|
|
|
}
|
|
|
return new_p_list
|
|
|
}
|
|
|
+
|
|
|
//根据目标数据,去掉重复 - 重新导出数据
|
|
|
-func exportNewPurBidData() {
|
|
|
+func exportNewPurBidData() {
|
|
|
sess := save_mgo.GetMgoConn()
|
|
|
defer save_mgo.DestoryMongoConn(sess)
|
|
|
- q,total:=map[string]interface{}{},0
|
|
|
- isok:=0
|
|
|
+ q, total := map[string]interface{}{}, 0
|
|
|
+ isok := 0
|
|
|
it := sess.DB(save_mgo.DbName).C("zktest_mysql_bidding_repeat").Find(&q).Sort("_id").Select(map[string]interface{}{
|
|
|
- "repeat":1,
|
|
|
+ "repeat": 1,
|
|
|
}).Iter()
|
|
|
- for tmp := make(map[string]interface{}); it.Next(&tmp);total++{
|
|
|
- if total%1000==0 {
|
|
|
- log.Debug("curent index ",total,tmp["_id"],"~",isok)
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
+ if total%1000 == 0 {
|
|
|
+ log.Debug("curent index ", total, tmp["_id"], "~", isok)
|
|
|
}
|
|
|
tmpid := BsonTOStringId(tmp["_id"])
|
|
|
repeat := tmp["repeat"].(bool)
|
|
|
if repeat {
|
|
|
isok++
|
|
|
- save_mgo.UpdateById(o_bidding_coll,tmpid, map[string]interface{}{
|
|
|
+ save_mgo.UpdateById(o_bidding_coll, tmpid, map[string]interface{}{
|
|
|
"$set": map[string]interface{}{
|
|
|
- "repeat":1,
|
|
|
+ "repeat": 1,
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
tmp = make(map[string]interface{})
|
|
|
}
|
|
|
- log.Debug("is over ",total,isok)
|
|
|
+ log.Debug("is over ", total, isok)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//导出指定-迈瑞相关数据-已弃用
|
|
|
-func exportMaiRuiInfoId(){
|
|
|
+func exportMaiRuiInfoId() {
|
|
|
query := "SELECT product_name FROM f_product WHERE company_name LIKE CONCAT('%',?,'%')"
|
|
|
proinfo := MysqlTool.SelectBySql(query, "迈瑞")
|
|
|
log.Debug(len(*proinfo))
|
|
|
- proNameArr :=[]string{}
|
|
|
+ proNameArr := []string{}
|
|
|
proNameDict := map[string]string{}
|
|
|
- for _,v := range *proinfo{
|
|
|
+ for _, v := range *proinfo {
|
|
|
product_name := qu.ObjToString(v["product_name"])
|
|
|
- if proNameDict[product_name]==""{
|
|
|
+ if proNameDict[product_name] == "" {
|
|
|
proNameDict[product_name] = product_name
|
|
|
- proNameArr = append(proNameArr,product_name)
|
|
|
+ proNameArr = append(proNameArr, product_name)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//812个产品名称 - -
|
|
|
bid_infoDict := map[string]string{}
|
|
|
- for k,v := range proNameArr {
|
|
|
- if k%100==0 {
|
|
|
- log.Debug("当前:",len(bid_infoDict))
|
|
|
+ for k, v := range proNameArr {
|
|
|
+ if k%100 == 0 {
|
|
|
+ log.Debug("当前:", len(bid_infoDict))
|
|
|
}
|
|
|
q := "SELECT info_id FROM f_bidproduct WHERE product_name=?"
|
|
|
infoArr := MysqlTool.SelectBySql(q, v)
|
|
|
- for _,info := range *infoArr {
|
|
|
+ for _, info := range *infoArr {
|
|
|
info_id := qu.ObjToString(info["info_id"])
|
|
|
- if bid_infoDict[info_id]==""{
|
|
|
+ if bid_infoDict[info_id] == "" {
|
|
|
bid_infoDict[info_id] = info_id
|
|
|
save_mgo.Save("a_mairui", map[string]interface{}{
|
|
|
- "info_id":info_id,
|
|
|
+ "info_id": info_id,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|