|
@@ -118,7 +118,7 @@ const (
|
|
biddingIndex = "bidding"
|
|
biddingIndex = "bidding"
|
|
biddingType = "bidding"
|
|
biddingType = "bidding"
|
|
BuyerSupplyInfoRedisKey = "BuyerSupplyInfo_%s" // 采购单位补充信息缓存
|
|
BuyerSupplyInfoRedisKey = "BuyerSupplyInfo_%s" // 采购单位补充信息缓存
|
|
- BuyerSupplyInfoRedisTime = 2*60 * 60 // 采购单位补充信息缓存时间 一个小时
|
|
|
|
|
|
+ BuyerSupplyInfoRedisTime = 2 * 60 * 60 // 采购单位补充信息缓存时间 一个小时
|
|
BuyerProjectInfoRedisKey = "BuyerProjectInfo_%s" // 采购单位补充项目信息缓存Key (项目数量采购规模)
|
|
BuyerProjectInfoRedisKey = "BuyerProjectInfo_%s" // 采购单位补充项目信息缓存Key (项目数量采购规模)
|
|
BuyerProjectInfoRedisTime = 24 * 60 * 60 // 采购单位补充项目信息缓存时间
|
|
BuyerProjectInfoRedisTime = 24 * 60 * 60 // 采购单位补充项目信息缓存时间
|
|
)
|
|
)
|
|
@@ -575,14 +575,7 @@ func BuyerSupplyInfo(buyerNames []string) (resp *bxbuyer.BuyerSupplyResp) {
|
|
func GetProjectContactCount(buyerName string) int64 {
|
|
func GetProjectContactCount(buyerName string) int64 {
|
|
start := time.Now()
|
|
start := time.Now()
|
|
list := []string{}
|
|
list := []string{}
|
|
- var musts []string
|
|
|
|
- if buyerName != "" {
|
|
|
|
- musts = append(musts, fmt.Sprintf(`{"term":{"buyer":"%s"}}`, buyerName))
|
|
|
|
- }
|
|
|
|
- if musts == nil || len(musts) == 0 {
|
|
|
|
- return 0
|
|
|
|
- }
|
|
|
|
- searchSql := fmt.Sprintf(`{"query":{"bool":{"must":[%s]}},"_source":["list"],"sort":[{"zbtime":"desc"}],"size":500}`, strings.Join(musts, ","))
|
|
|
|
|
|
+ searchSql := fmt.Sprintf(`{"query":{"bool":{"filter":[{"term":{"buyer":"%s"}}]}},"_source":["list.buyerperson","list.buyertel"],"sort":[{"zbtime":"desc"}],"size":500}`,buyerName)
|
|
projectList := elastic.Get(P_INDEX, P_TYPE, searchSql)
|
|
projectList := elastic.Get(P_INDEX, P_TYPE, searchSql)
|
|
logx.Info("GetProjectContactCount esget 耗时", time.Since(start), searchSql)
|
|
logx.Info("GetProjectContactCount esget 耗时", time.Since(start), searchSql)
|
|
if projectList == nil || len(*projectList) == 0 {
|
|
if projectList == nil || len(*projectList) == 0 {
|
|
@@ -603,10 +596,8 @@ func GetProjectContactCount(buyerName string) int64 {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
thisPhone, thisPerson := "", ""
|
|
thisPhone, thisPerson := "", ""
|
|
- if buyerName != "" {
|
|
|
|
- if thisPhone, _ = thisMsg["buyertel"].(string); thisPhone != "" {
|
|
|
|
- thisPerson, _ = thisMsg["buyerperson"].(string)
|
|
|
|
- }
|
|
|
|
|
|
+ if thisPhone, _ = thisMsg["buyertel"].(string); thisPhone != "" {
|
|
|
|
+ thisPerson, _ = thisMsg["buyerperson"].(string)
|
|
}
|
|
}
|
|
if thisPhone == "" { //联系人为空则不展示 dev4.7.3联系人为空展示此记录
|
|
if thisPhone == "" { //联系人为空则不展示 dev4.7.3联系人为空展示此记录
|
|
continue
|
|
continue
|