|
@@ -493,7 +493,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
|
|
|
projectId := GetProjectId(id)
|
|
|
if projectId != "" {
|
|
|
//projectIds := strings.Split(projectId, ",")
|
|
|
- tmp["projectId"] = projectId
|
|
|
+ tmp["projectId"] = SE.EncodeString(projectId)
|
|
|
} else {
|
|
|
tmp["projectId"] = ""
|
|
|
}
|
|
@@ -502,58 +502,61 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
|
|
|
querys := map[string]interface{}{
|
|
|
"_id": mongodb.StringTOBsonId(id),
|
|
|
}
|
|
|
- datas := MgoExtract.FindOne(ExtractColl, querys)
|
|
|
- if datas != nil && len(datas) > 0 {
|
|
|
+ s_winner := qu.ObjToString(tmp["s_winner"])
|
|
|
+ if s_winner != "" && len(strings.Split(s_winner, ",")) > 1 {
|
|
|
+ datas := MgoExtract.FindOne(ExtractColl, querys)
|
|
|
indexdata := []map[string]interface{}{}
|
|
|
index := 1
|
|
|
- if (datas)["package"] != nil {
|
|
|
- packages := (datas)["package"].(map[string]interface{})
|
|
|
- for _, vv := range packages {
|
|
|
- vs := vv.(map[string]interface{})
|
|
|
- if qu.ObjToString(tmp["toptype"]) == "结果" || qu.ObjToString(tmp["toptype"]) == "其它" {
|
|
|
- if vs["winner"] != nil && qu.ObjToString(vs["winner"]) != "" {
|
|
|
- winner := strings.Split(qu.ObjToString(vs["winner"]), ",")
|
|
|
- for _, w := range winner {
|
|
|
- // if MactchWinner(w) {
|
|
|
- if index > 1 {
|
|
|
- s_data := map[string]interface{}{}
|
|
|
- for ks, vks := range tmp {
|
|
|
- s_data[ks] = vks
|
|
|
- }
|
|
|
- s_data["s_winner"] = w
|
|
|
- GetWinnerType(w, s_data)
|
|
|
- if vs["bidamount"] != nil {
|
|
|
- s_data["bidamount"] = vs["bidamount"]
|
|
|
- }
|
|
|
- if vs["budget"] != nil {
|
|
|
- s_data["budget"] = vs["budget"]
|
|
|
- }
|
|
|
- SearchEnterpriseInfo(s_data)
|
|
|
- indexdata = append(indexdata, s_data)
|
|
|
- log.Println("index", index, " ", id, " ", w)
|
|
|
- } else {
|
|
|
- tmp["s_winner"] = w
|
|
|
- GetWinnerType(w, tmp)
|
|
|
- if vs["bidamount"] != nil {
|
|
|
- tmp["bidamount"] = vs["bidamount"]
|
|
|
+ if datas != nil && len(datas) > 0 {
|
|
|
+ if (datas)["package"] != nil {
|
|
|
+ packages := (datas)["package"].(map[string]interface{})
|
|
|
+ for _, vv := range packages {
|
|
|
+ vs := vv.(map[string]interface{})
|
|
|
+ if qu.ObjToString(tmp["toptype"]) == "结果" || qu.ObjToString(tmp["toptype"]) == "其它" {
|
|
|
+ if vs["winner"] != nil && qu.ObjToString(vs["winner"]) != "" {
|
|
|
+ winner := strings.Split(qu.ObjToString(vs["winner"]), ",")
|
|
|
+ for _, w := range winner {
|
|
|
+ // if MactchWinner(w) {
|
|
|
+ if index > 1 {
|
|
|
+ s_data := map[string]interface{}{}
|
|
|
+ for ks, vks := range tmp {
|
|
|
+ s_data[ks] = vks
|
|
|
+ }
|
|
|
+ s_data["s_winner"] = w
|
|
|
+ GetWinnerType(w, s_data)
|
|
|
+ if vs["bidamount"] != nil {
|
|
|
+ s_data["bidamount"] = vs["bidamount"]
|
|
|
+ }
|
|
|
+ if vs["budget"] != nil {
|
|
|
+ s_data["budget"] = vs["budget"]
|
|
|
+ }
|
|
|
+ SearchEnterpriseInfo(s_data)
|
|
|
+ indexdata = append(indexdata, s_data)
|
|
|
+ log.Println("index", index, " ", id, " ", w)
|
|
|
+ } else {
|
|
|
+ tmp["s_winner"] = w
|
|
|
+ GetWinnerType(w, tmp)
|
|
|
+ if vs["bidamount"] != nil {
|
|
|
+ tmp["bidamount"] = vs["bidamount"]
|
|
|
+ }
|
|
|
+ if vs["budget"] != nil {
|
|
|
+ tmp["budget"] = vs["budget"]
|
|
|
+ }
|
|
|
+ log.Println("index", index, " ", id, " ", w)
|
|
|
}
|
|
|
- if vs["budget"] != nil {
|
|
|
- tmp["budget"] = vs["budget"]
|
|
|
- }
|
|
|
- log.Println("index", index, " ", id, " ", w)
|
|
|
+ index++
|
|
|
+ // }
|
|
|
}
|
|
|
- index++
|
|
|
- // }
|
|
|
}
|
|
|
- }
|
|
|
- } else {
|
|
|
- if vs["budget"] != nil {
|
|
|
- s_data := map[string]interface{}{}
|
|
|
- for ks, vks := range tmp {
|
|
|
- s_data[ks] = vks
|
|
|
+ } else {
|
|
|
+ if vs["budget"] != nil {
|
|
|
+ s_data := map[string]interface{}{}
|
|
|
+ for ks, vks := range tmp {
|
|
|
+ s_data[ks] = vks
|
|
|
+ }
|
|
|
+ s_data["budget"] = vs["budget"]
|
|
|
+ indexdata = append(indexdata, s_data)
|
|
|
}
|
|
|
- s_data["budget"] = vs["budget"]
|
|
|
- indexdata = append(indexdata, s_data)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -569,7 +572,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- log.Println("查result为空id:", id)
|
|
|
+ GetWinnerType(qu.ObjToString(tmp["s_winner"]), tmp)
|
|
|
}
|
|
|
}
|
|
|
if isDup == 1 {
|
|
@@ -1137,7 +1140,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHen
|
|
|
row.AddCell().SetValue(v["district"]) //县区
|
|
|
row.AddCell().SetValue(v["projectname"]) //项目名称
|
|
|
row.AddCell().SetValue(v["buyer"]) //采购单位
|
|
|
- row.AddCell().SetValue(v["buyer_type"]) //采购单位类别---私有标签tagname
|
|
|
+ row.AddCell().SetValue(v["buyer_type"]) //采购单位类别---私有标签tagname
|
|
|
if v["bidamount"] != nil { //中标金额
|
|
|
row.AddCell().SetFloat(qu.Float64All(v["bidamount"]))
|
|
|
} else {
|
|
@@ -1176,7 +1179,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHen
|
|
|
row.AddCell().SetValue(v["company_email"]) //中标企业邮箱
|
|
|
ids := SE.EncodeString(qu.ObjToString(v["id"])) //唯一标识
|
|
|
row.AddCell().SetValue(ids)
|
|
|
- row.AddCell().SetValue(SE.EncodeString(qu.ObjToString(v["projectId"]))) //项目标识
|
|
|
+ row.AddCell().SetValue(v["projectId"]) //项目标识
|
|
|
row.AddCell().SetValue(v["jybxhref"]) //剑鱼标讯地址
|
|
|
|
|
|
//row.AddCell().SetValue(v["projectcode"])
|
|
@@ -1279,33 +1282,49 @@ func checkBidId(appid, id string) bool {
|
|
|
}
|
|
|
|
|
|
func GetWinnerType(s_winner string, v map[string]interface{}) {
|
|
|
- isMatch := false
|
|
|
if s_winner != "" {
|
|
|
- for _, vs := range Sysconfig["dis_package_config"].(map[string]interface{}) {
|
|
|
- vvs := vs.(map[string]interface{})
|
|
|
- keyWord := qu.ObjToString(vvs["keyWord"])
|
|
|
- exclued := qu.ObjToString(vvs["exclued"])
|
|
|
- name := qu.ObjToString(vvs["name"])
|
|
|
- for _, key := range strings.Split(keyWord, ",") {
|
|
|
- if strings.Contains(s_winner, key) {
|
|
|
- isMatch = true
|
|
|
- if exclued != "" {
|
|
|
- for _, keys := range strings.Split(exclued, ",") {
|
|
|
- if strings.Contains(s_winner, keys) {
|
|
|
- isMatch = false
|
|
|
+ winnerModel := []string{}
|
|
|
+ for _, vw := range strings.Split(s_winner, ",") {
|
|
|
+ j := 1
|
|
|
+ for _, vs := range Sysconfig["dis_package_config"].(map[string]interface{}) {
|
|
|
+ vvs := vs.(map[string]interface{})
|
|
|
+ keyWord := qu.ObjToString(vvs["keyWord"])
|
|
|
+ exclued := qu.ObjToString(vvs["exclued"])
|
|
|
+ name := qu.ObjToString(vvs["name"])
|
|
|
+ isMatch := false
|
|
|
+ for _, key := range strings.Split(keyWord, ",") {
|
|
|
+ if strings.Contains(vw, key) {
|
|
|
+ isMatch = true
|
|
|
+ if exclued != "" {
|
|
|
+ for _, keys := range strings.Split(exclued, ",") {
|
|
|
+ if strings.Contains(vw, keys) {
|
|
|
+ isMatch = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if isMatch {
|
|
|
- v["winner_type"] = name
|
|
|
- break
|
|
|
+ if isMatch {
|
|
|
+ winnerModel = append(winnerModel, name)
|
|
|
+ //v["winner_type"] = name
|
|
|
+ break
|
|
|
+ } else {
|
|
|
+ if j == len(Sysconfig["dis_package_config"].(map[string]interface{})){
|
|
|
+ winnerModel = append(winnerModel, "集成商")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ j++
|
|
|
}
|
|
|
}
|
|
|
- if !isMatch {
|
|
|
- v["winner_type"] = "集成商"
|
|
|
+ wname := ""
|
|
|
+ for key, val := range winnerModel {
|
|
|
+ if key < len(winnerModel)-1 {
|
|
|
+ wname += val + ","
|
|
|
+ } else {
|
|
|
+ wname += val
|
|
|
+ }
|
|
|
}
|
|
|
+ v["winner_type"] = wname
|
|
|
} else {
|
|
|
v["winner_type"] = ""
|
|
|
}
|