|
@@ -5,6 +5,7 @@ import (
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
"leadGeneration/public"
|
|
"leadGeneration/public"
|
|
|
|
+ "leadGeneration/vars"
|
|
"log"
|
|
"log"
|
|
"strings"
|
|
"strings"
|
|
"sync"
|
|
"sync"
|
|
@@ -21,13 +22,12 @@ func PotentialCustomizeAnalysis(userid, keyWord string) map[string]interface{} {
|
|
aggs = append(aggs, aggs_buyerclass, buyer_procurement_scale, winner_procurement_scale)
|
|
aggs = append(aggs, aggs_buyerclass, buyer_procurement_scale, winner_procurement_scale)
|
|
mae.Types = 1
|
|
mae.Types = 1
|
|
mae.FormatParam.STime = time.Now().AddDate(-1, 0, 0).Unix()
|
|
mae.FormatParam.STime = time.Now().AddDate(-1, 0, 0).Unix()
|
|
- log.Println("[SEARCH-INFO]定制化分析报告数据参数:", userid)
|
|
|
|
if !mae.KeyWordFormat(userid, keyWord) {
|
|
if !mae.KeyWordFormat(userid, keyWord) {
|
|
log.Printf("[SEARCH-ERR]关键词格式化化失败 userid:%s,keyWord:%s", userid, keyWord)
|
|
log.Printf("[SEARCH-ERR]关键词格式化化失败 userid:%s,keyWord:%s", userid, keyWord)
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
finalSql := fmt.Sprintf(mae.GetCommonQuerySqlWithAggs(), strings.Join(aggs, ","), mae.Size, "")
|
|
finalSql := fmt.Sprintf(mae.GetCommonQuerySqlWithAggs(), strings.Join(aggs, ","), mae.Size, "")
|
|
- log.Println("[SEARCH-INFO]定制化分析报告es查询:", finalSql)
|
|
|
|
|
|
+ log.Printf("[SEARCH-INFO]定制化分析报告userid:%s,es查询:%s", userid, finalSql)
|
|
res, _, _ := public.GetAggs("projectset", "projectset", finalSql)
|
|
res, _, _ := public.GetAggs("projectset", "projectset", finalSql)
|
|
if res == nil || len(res) == 0 {
|
|
if res == nil || len(res) == 0 {
|
|
return nil
|
|
return nil
|
|
@@ -42,6 +42,10 @@ func PotentialCustomizeAnalysis(userid, keyWord string) map[string]interface{} {
|
|
if json.Unmarshal(bArr, &thisRow.ProjectAmount) != nil {
|
|
if json.Unmarshal(bArr, &thisRow.ProjectAmount) != nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
+ } else if name == "project_count" {
|
|
|
|
+ if json.Unmarshal(bArr, &thisRow.ProjectCount) != nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
} else if name == "buyer_amount_distribution" {
|
|
} else if name == "buyer_amount_distribution" {
|
|
if json.Unmarshal(bArr, &thisRow.BuyerAmountDistribution) != nil {
|
|
if json.Unmarshal(bArr, &thisRow.BuyerAmountDistribution) != nil {
|
|
continue
|
|
continue
|
|
@@ -56,6 +60,14 @@ func PotentialCustomizeAnalysis(userid, keyWord string) map[string]interface{} {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if thisRow.ProjectCount.DocCount == 0 {
|
|
|
|
+ log.Println("未查询到项目数据", userid)
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ if thisRow.ProjectCount.DocCount > vars.Config.ProjectNumLimit {
|
|
|
|
+ log.Println("项目数量超出上限", userid, vars.Config.ProjectNumLimit)
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
var rMap = sync.Map{}
|
|
var rMap = sync.Map{}
|
|
sy := sync.WaitGroup{}
|
|
sy := sync.WaitGroup{}
|
|
sy.Add(3)
|
|
sy.Add(3)
|