|
@@ -859,15 +859,6 @@ func pcVRT(sid, industry, content string, isPayUser bool, isLogin bool) (po, bo,
|
|
obj["stypeadd"], obj["areaadd"], obj["indadd"] = classify(finalType, area, industry)
|
|
obj["stypeadd"], obj["areaadd"], obj["indadd"] = classify(finalType, area, industry)
|
|
//增加处理信息逻辑
|
|
//增加处理信息逻辑
|
|
objdata = obj
|
|
objdata = obj
|
|
- queryStr := ""
|
|
|
|
- commonQuery := func(mustquery string) *[]map[string]interface{} {
|
|
|
|
- //付费用户可查看 详情页关联信息
|
|
|
|
- if util.IntAll(config.Sysconfig["biddingRelatesLevel"]) > 0 && (!isPayUser || content == "bdcontent" || content == "advancedProject") {
|
|
|
|
- return nil //elastic.GetPage("bidding", "bidding", queryStr, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"`, 0, 11)
|
|
|
|
- }
|
|
|
|
- return elastic.Get("bidding", "bidding", queryStr)
|
|
|
|
- //, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"`, 0, 11)
|
|
|
|
- }
|
|
|
|
// p397 收回未登录查看拟建权限调整
|
|
// p397 收回未登录查看拟建权限调整
|
|
mustNotStr := ""
|
|
mustNotStr := ""
|
|
if isLogin {
|
|
if isLogin {
|
|
@@ -875,81 +866,92 @@ func pcVRT(sid, industry, content string, isPayUser bool, isLogin bool) (po, bo,
|
|
} else {
|
|
} else {
|
|
mustNotStr = `{"terms":{"subtype":["采购意向","拟建"]}}`
|
|
mustNotStr = `{"terms":{"subtype":["采购意向","拟建"]}}`
|
|
}
|
|
}
|
|
- baseQuery := `{"query":{"bool":{"must":%s,"must_not":[` + mustNotStr + `]}},"sort":[{"dataweight":"desc","publishtime":"desc"}],"size":11,"_source":["_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"]}`
|
|
|
|
- //同一个项目的其他招标信息
|
|
|
|
- projectName, _ := obj["projectname"].(string)
|
|
|
|
- projectCode, _ := obj["projectcode"].(string)
|
|
|
|
- if projectName != "" || projectCode != "" {
|
|
|
|
- // p397 收回未登录查看拟建权限调整
|
|
|
|
- // 缓存登录和未登录分开存 因为未登录的不查拟建采购意向
|
|
|
|
- projectNameCode := ""
|
|
|
|
- if isLogin {
|
|
|
|
- projectNameCode = fmt.Sprintf("projectNameCode_%s_%s_%s", projectName, projectCode, util.If(isPayUser, "pay", "free"))
|
|
|
|
- } else {
|
|
|
|
- projectNameCode = fmt.Sprintf("projectNameCode_%s_%s_noLogin", projectName, projectCode)
|
|
|
|
|
|
+ if isLogin {
|
|
|
|
+ queryStr := ""
|
|
|
|
+ commonQuery := func(mustquery string) *[]map[string]interface{} {
|
|
|
|
+ //付费用户可查看 详情页关联信息
|
|
|
|
+ if util.IntAll(config.Sysconfig["biddingRelatesLevel"]) > 0 && (!isPayUser || content == "bdcontent" || content == "advancedProject") {
|
|
|
|
+ return nil //elastic.GetPage("bidding", "bidding", queryStr, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"`, 0, 11)
|
|
|
|
+ }
|
|
|
|
+ return elastic.Get("bidding", "bidding", queryStr)
|
|
|
|
+ //, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"`, 0, 11)
|
|
}
|
|
}
|
|
- projectOther = EntAssociated(projectNameCode)
|
|
|
|
- if projectOther == nil {
|
|
|
|
- tmpQuery := ""
|
|
|
|
- if projectName != "" && projectCode != "" {
|
|
|
|
- projectName = strings.ReplaceAll(projectName, "\"", "###剑鱼###")
|
|
|
|
- projectCode = strings.ReplaceAll(projectCode, "\"", "###剑鱼###")
|
|
|
|
- tmpQuery = fmt.Sprintf(`{"bool": {"should": [{"term": {"projectname": "%s"}}, {"term": {"projectcode": "%s"}}]}}`, projectName, projectCode)
|
|
|
|
- } else if projectName != "" && projectCode == "" {
|
|
|
|
- projectName = strings.ReplaceAll(projectName, "\"", "###剑鱼###")
|
|
|
|
- tmpQuery = `{"term":{"projectname":"` + projectName + `"}}`
|
|
|
|
- } else if projectName == "" && projectCode != "" {
|
|
|
|
- projectCode = strings.ReplaceAll(projectCode, "\"", "###剑鱼###")
|
|
|
|
- tmpQuery = `{"term":{"projectcode":"` + projectCode + `"}}`
|
|
|
|
|
|
+ baseQuery := `{"query":{"bool":{"must":%s,"must_not":[` + mustNotStr + `]}},"sort":[{"dataweight":"desc","publishtime":"desc"}],"size":11,"_source":["_id","title","publishtime","toptype","subtype","type","area","href","s_subscopeclass","spidercode","site"]}`
|
|
|
|
+ //同一个项目的其他招标信息
|
|
|
|
+ projectName, _ := obj["projectname"].(string)
|
|
|
|
+ projectCode, _ := obj["projectcode"].(string)
|
|
|
|
+ if projectName != "" || projectCode != "" {
|
|
|
|
+ // p397 收回未登录查看拟建权限调整
|
|
|
|
+ // 缓存登录和未登录分开存 因为未登录的不查拟建采购意向
|
|
|
|
+ projectNameCode := ""
|
|
|
|
+ if isLogin {
|
|
|
|
+ projectNameCode = fmt.Sprintf("projectNameCode_%s_%s_%s", projectName, projectCode, util.If(isPayUser, "pay", "free"))
|
|
|
|
+ } else {
|
|
|
|
+ projectNameCode = fmt.Sprintf("projectNameCode_%s_%s_noLogin", projectName, projectCode)
|
|
}
|
|
}
|
|
- queryStr = fmt.Sprintf(baseQuery, tmpQuery)
|
|
|
|
- projectOther = bidDataConvert(sid, commonQuery(queryStr))
|
|
|
|
- if projectOther != nil && len(projectOther) > 0 {
|
|
|
|
- if bytes, err := json.Marshal(projectOther); err == nil && len(bytes) > 0 {
|
|
|
|
- _ = redis.PutBytes(RedisNameNew, projectNameCode, &bytes, 24*60*60)
|
|
|
|
|
|
+ projectOther = EntAssociated(projectNameCode)
|
|
|
|
+ if projectOther == nil {
|
|
|
|
+ tmpQuery := ""
|
|
|
|
+ if projectName != "" && projectCode != "" {
|
|
|
|
+ projectName = strings.ReplaceAll(projectName, "\"", "###剑鱼###")
|
|
|
|
+ projectCode = strings.ReplaceAll(projectCode, "\"", "###剑鱼###")
|
|
|
|
+ tmpQuery = fmt.Sprintf(`{"bool": {"should": [{"term": {"projectname": "%s"}}, {"term": {"projectcode": "%s"}}]}}`, projectName, projectCode)
|
|
|
|
+ } else if projectName != "" && projectCode == "" {
|
|
|
|
+ projectName = strings.ReplaceAll(projectName, "\"", "###剑鱼###")
|
|
|
|
+ tmpQuery = `{"term":{"projectname":"` + projectName + `"}}`
|
|
|
|
+ } else if projectName == "" && projectCode != "" {
|
|
|
|
+ projectCode = strings.ReplaceAll(projectCode, "\"", "###剑鱼###")
|
|
|
|
+ tmpQuery = `{"term":{"projectcode":"` + projectCode + `"}}`
|
|
|
|
+ }
|
|
|
|
+ queryStr = fmt.Sprintf(baseQuery, tmpQuery)
|
|
|
|
+ projectOther = bidDataConvert(sid, commonQuery(queryStr))
|
|
|
|
+ if projectOther != nil && len(projectOther) > 0 {
|
|
|
|
+ if bytes, err := json.Marshal(projectOther); err == nil && len(bytes) > 0 {
|
|
|
|
+ _ = redis.PutBytes(RedisNameNew, projectNameCode, &bytes, 24*60*60)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //同一个业主最近的其他招标信息
|
|
|
|
- buyer, _ := obj["buyer"].(string) //采购单位
|
|
|
|
- if buyer != "" {
|
|
|
|
- // P397 调整
|
|
|
|
- buyerNameOther := ""
|
|
|
|
- if isLogin {
|
|
|
|
- buyerNameOther = fmt.Sprintf("buyerNameOther_%s_%s", buyer, util.If(isPayUser, "pay", "free"))
|
|
|
|
- } else {
|
|
|
|
- buyerNameOther = fmt.Sprintf("buyerNameOther_%s_noLogin", buyer)
|
|
|
|
- }
|
|
|
|
- buyerOther = EntAssociated(buyerNameOther)
|
|
|
|
- if buyerOther == nil {
|
|
|
|
- tmpQuery := `[{"term":{"buyer":"` + buyer + `"}}]`
|
|
|
|
- queryStr = fmt.Sprintf(baseQuery, tmpQuery)
|
|
|
|
- buyerOther = bidDataConvert(sid, commonQuery(queryStr))
|
|
|
|
- if buyerOther != nil && len(buyerOther) > 0 {
|
|
|
|
- if bytes, err := json.Marshal(buyerOther); err == nil && len(bytes) > 0 {
|
|
|
|
- _ = redis.PutBytes(RedisNameNew, buyerNameOther, &bytes, 24*60*60)
|
|
|
|
|
|
+ //同一个业主最近的其他招标信息
|
|
|
|
+ buyer, _ := obj["buyer"].(string) //采购单位
|
|
|
|
+ if buyer != "" {
|
|
|
|
+ // P397 调整
|
|
|
|
+ buyerNameOther := ""
|
|
|
|
+ if isLogin {
|
|
|
|
+ buyerNameOther = fmt.Sprintf("buyerNameOther_%s_%s", buyer, util.If(isPayUser, "pay", "free"))
|
|
|
|
+ } else {
|
|
|
|
+ buyerNameOther = fmt.Sprintf("buyerNameOther_%s_noLogin", buyer)
|
|
|
|
+ }
|
|
|
|
+ buyerOther = EntAssociated(buyerNameOther)
|
|
|
|
+ if buyerOther == nil {
|
|
|
|
+ tmpQuery := `[{"term":{"buyer":"` + buyer + `"}}]`
|
|
|
|
+ queryStr = fmt.Sprintf(baseQuery, tmpQuery)
|
|
|
|
+ buyerOther = bidDataConvert(sid, commonQuery(queryStr))
|
|
|
|
+ if buyerOther != nil && len(buyerOther) > 0 {
|
|
|
|
+ if bytes, err := json.Marshal(buyerOther); err == nil && len(bytes) > 0 {
|
|
|
|
+ _ = redis.PutBytes(RedisNameNew, buyerNameOther, &bytes, 24*60*60)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //同一中标人最近中标的其他信息
|
|
|
|
- winner, _ := obj["winner"].(string) //中标人
|
|
|
|
- if winner != "" {
|
|
|
|
- winnerNameOther := ""
|
|
|
|
- if isLogin {
|
|
|
|
- winnerNameOther = fmt.Sprintf("winnerNameOther_%s_%s", winner, util.If(isPayUser, "pay", "free"))
|
|
|
|
- } else {
|
|
|
|
- winnerNameOther = fmt.Sprintf("winnerNameOther_%s_noLogin", winner)
|
|
|
|
- }
|
|
|
|
- winnerOther = EntAssociated(winnerNameOther)
|
|
|
|
- if winnerOther == nil {
|
|
|
|
- tmpQuery := `[{"term":{"s_winner":"` + winner + `"}}]`
|
|
|
|
- queryStr = fmt.Sprintf(baseQuery, tmpQuery)
|
|
|
|
- winnerOther = bidDataConvert(sid, commonQuery(queryStr))
|
|
|
|
- if winnerOther != nil && len(winnerOther) > 0 {
|
|
|
|
- if bytes, err := json.Marshal(winnerOther); err == nil && len(bytes) > 0 {
|
|
|
|
- _ = redis.PutBytes(RedisNameNew, winnerNameOther, &bytes, 24*60*60)
|
|
|
|
|
|
+ //同一中标人最近中标的其他信息
|
|
|
|
+ winner, _ := obj["winner"].(string) //中标人
|
|
|
|
+ if winner != "" {
|
|
|
|
+ winnerNameOther := ""
|
|
|
|
+ if isLogin {
|
|
|
|
+ winnerNameOther = fmt.Sprintf("winnerNameOther_%s_%s", winner, util.If(isPayUser, "pay", "free"))
|
|
|
|
+ } else {
|
|
|
|
+ winnerNameOther = fmt.Sprintf("winnerNameOther_%s_noLogin", winner)
|
|
|
|
+ }
|
|
|
|
+ winnerOther = EntAssociated(winnerNameOther)
|
|
|
|
+ if winnerOther == nil {
|
|
|
|
+ tmpQuery := `[{"term":{"s_winner":"` + winner + `"}}]`
|
|
|
|
+ queryStr = fmt.Sprintf(baseQuery, tmpQuery)
|
|
|
|
+ winnerOther = bidDataConvert(sid, commonQuery(queryStr))
|
|
|
|
+ if winnerOther != nil && len(winnerOther) > 0 {
|
|
|
|
+ if bytes, err := json.Marshal(winnerOther); err == nil && len(bytes) > 0 {
|
|
|
|
+ _ = redis.PutBytes(RedisNameNew, winnerNameOther, &bytes, 24*60*60)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|