|
@@ -43,47 +43,36 @@ func (this *AnalysisDec) DecQueryNewSimilarMsgByBW() (qstr string) {
|
|
|
bools := []string{}
|
|
|
musts := []string{}
|
|
|
shoulds := []string{}
|
|
|
- switch this.SearchType {
|
|
|
- case 1:
|
|
|
- //中标单位 类似项目明显
|
|
|
- if this.Winner != "" {
|
|
|
- winnerterms := `{"terms":{"s_winner":[`
|
|
|
- for k, v := range strings.Split(this.Winner, ",") {
|
|
|
- if k > 0 {
|
|
|
- winnerterms += `,`
|
|
|
- }
|
|
|
- winnerterms += `"` + v + `"`
|
|
|
- }
|
|
|
- winnerterms += `]}}`
|
|
|
- musts = append(musts, winnerterms)
|
|
|
- }
|
|
|
- case 2, 3:
|
|
|
- //中标单位 类似项目合作历史
|
|
|
- if this.Winner != "" {
|
|
|
- winnerterms := `{"terms":{"s_winner":[`
|
|
|
- for k, v := range strings.Split(this.Winner, ",") {
|
|
|
- if k > 0 {
|
|
|
- winnerterms += `,`
|
|
|
- }
|
|
|
- winnerterms += `"` + v + `"`
|
|
|
+ var BWExists = 1
|
|
|
+ //中标单位 类似项目合作历史||采购单位类似项目
|
|
|
+ if this.Winner != "" {
|
|
|
+ BWExists += 1
|
|
|
+ winnerterms := `{"terms":{"s_winner":[`
|
|
|
+ for k, v := range strings.Split(this.Winner, ",") {
|
|
|
+ if k > 0 {
|
|
|
+ winnerterms += `,`
|
|
|
}
|
|
|
- winnerterms += `]}}`
|
|
|
- musts = append(musts, winnerterms)
|
|
|
+ winnerterms += `"` + v + `"`
|
|
|
}
|
|
|
- //中标单位 类似项目合作历史
|
|
|
- if this.Buyer != "" {
|
|
|
- buyerterms := `{"terms":{"buyer":[`
|
|
|
- for k, v := range strings.Split(this.Buyer, ",") {
|
|
|
- if k > 0 {
|
|
|
- buyerterms += `,`
|
|
|
- }
|
|
|
- buyerterms += `"` + v + `"`
|
|
|
+ winnerterms += `]}}`
|
|
|
+ musts = append(musts, winnerterms)
|
|
|
+ }
|
|
|
+ //中标单位 类似项目合作历史||采购单位类似项目
|
|
|
+ if this.Buyer != "" {
|
|
|
+ BWExists += 1
|
|
|
+ buyerterms := `{"terms":{"buyer":[`
|
|
|
+ for k, v := range strings.Split(this.Buyer, ",") {
|
|
|
+ if k > 0 {
|
|
|
+ buyerterms += `,`
|
|
|
}
|
|
|
- buyerterms += `]}}`
|
|
|
- musts = append(musts, buyerterms)
|
|
|
+ buyerterms += `"` + v + `"`
|
|
|
}
|
|
|
+ buyerterms += `]}}`
|
|
|
+ musts = append(musts, buyerterms)
|
|
|
+ }
|
|
|
+ if BWExists > 1 && this.SearchType == 3 {
|
|
|
+ this.SearchType = 1
|
|
|
}
|
|
|
-
|
|
|
//省份
|
|
|
areaCity := []string{}
|
|
|
citys := []string{}
|