|
@@ -380,7 +380,10 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
|
|
|
}
|
|
|
}
|
|
|
// 2024-02-21 徐志恒 情报标签字段
|
|
|
- if tmp["tag_topinformation"] != nil && util.ObjToString(tmp["subtype"]) == "合同" {
|
|
|
+ toptype := util.ObjToString(tmp["toptype"])
|
|
|
+ subtype := util.ObjToString(tmp["subtype"])
|
|
|
+ s_topscopeclass := util.ObjToString(update["s_topscopeclass"])
|
|
|
+ if (tmp["tag_topinformation"] != nil && (subtype == "合同" || subtype == "中标" || subtype == "成交")) || (tmp["tag_topinformation"] == nil && toptype == "拟建" && strings.Contains(s_topscopeclass, "建筑工程")) {
|
|
|
update["tag_set"] = getTagSet(tmp, compare)
|
|
|
}
|
|
|
if len(update) > 0 {
|
|
@@ -767,9 +770,11 @@ func getTagSet(tmp, compare map[string]interface{}) map[string]map[string]interf
|
|
|
buyer := util.ObjToString(compare["buyer"])
|
|
|
publishtime := util.Int64All(tmp["publishtime"])
|
|
|
bidamount := util.Float64All(compare["bidamount"])
|
|
|
- wuye["isfirsthand"] = 62
|
|
|
- if buyer != "" {
|
|
|
- sql := `{
|
|
|
+ subtype := util.ObjToString(tmp["subtype"])
|
|
|
+ if subtype == "合同" {
|
|
|
+ wuye["isfirsthand"] = 62
|
|
|
+ if buyer != "" {
|
|
|
+ sql := `{
|
|
|
"query": {
|
|
|
"bool": {
|
|
|
"must": [
|
|
@@ -806,27 +811,29 @@ func getTagSet(tmp, compare map[string]interface{}) map[string]map[string]interf
|
|
|
],
|
|
|
"size": 10000
|
|
|
}`
|
|
|
- data := Es.Get("bidding", "bidding", sql)
|
|
|
- if data != nil && len(*data) > 0 {
|
|
|
- count := 0
|
|
|
- first := util.ObjToString((*data)[0]["s_winner"])
|
|
|
- for k, v := range *data {
|
|
|
- winner := util.ObjToString(v["s_winner"])
|
|
|
- if k > 0 && first != winner {
|
|
|
- first = winner
|
|
|
- count++
|
|
|
+ data := Es.Get("bidding", "bidding", sql)
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
+ count := 0
|
|
|
+ first := util.ObjToString((*data)[0]["s_winner"])
|
|
|
+ for k, v := range *data {
|
|
|
+ winner := util.ObjToString(v["s_winner"])
|
|
|
+ if k > 0 && first != winner {
|
|
|
+ first = winner
|
|
|
+ count++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ changehand := fmt.Sprintf("%.2f", float64(count)/float64(len(*data)))
|
|
|
+ changehands, _ := strconv.ParseFloat(changehand, 64)
|
|
|
+ wuye["changehand"] = changehands
|
|
|
+ if changehands > 0.3 {
|
|
|
+ wuye["changehandindex"] = 61
|
|
|
+ }
|
|
|
+ if len(*data) > 1 {
|
|
|
+ wuye["isfirsthand"] = 0
|
|
|
}
|
|
|
- }
|
|
|
- changehand := fmt.Sprintf("%.2f", float64(count)/float64(len(*data)))
|
|
|
- changehands, _ := strconv.ParseFloat(changehand, 64)
|
|
|
- wuye["changehand"] = changehands
|
|
|
- if changehands > 0.3 {
|
|
|
- wuye["changehandindex"] = 61
|
|
|
- }
|
|
|
- if len(*data) > 1 {
|
|
|
- wuye["isfirsthand"] = 0
|
|
|
}
|
|
|
}
|
|
|
+ wuye["period"] = getperiod(compare)
|
|
|
}
|
|
|
if tmp["projectinfo"] != nil {
|
|
|
projectInfo := util.ObjToMap(tmp["projectinfo"])
|
|
@@ -836,7 +843,6 @@ func getTagSet(tmp, compare map[string]interface{}) map[string]map[string]interf
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- wuye["period"] = getperiod(compare)
|
|
|
wuye["scale"] = getBidamountRange(bidamount)
|
|
|
if tmp["property_form"] != nil {
|
|
|
property_form := util.ObjArrToStringArr(tmp["property_form"].([]interface{}))
|