|
@@ -8,7 +8,6 @@ import (
|
|
|
qu "qfw/util"
|
|
|
"qfw/util/redis"
|
|
|
"regexp"
|
|
|
- . "sqlmodel"
|
|
|
"strings"
|
|
|
"sync"
|
|
|
"time"
|
|
@@ -22,8 +21,6 @@ import (
|
|
|
|
|
|
"github.com/antonmedv/expr"
|
|
|
"github.com/donnie4w/go-logger/logger"
|
|
|
- "go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
-
|
|
|
esV7 "github.com/olivere/elastic"
|
|
|
)
|
|
|
|
|
@@ -125,7 +122,7 @@ func (c *Customer) GetTagRules() {
|
|
|
}
|
|
|
}
|
|
|
//规则
|
|
|
- if o_list, ok := tr["o_list"].(primitive.A); ok && len(o_list) > 0 {
|
|
|
+ if o_list, ok := tr["o_list"].([]interface{}); ok && len(o_list) > 0 {
|
|
|
TR.GetKeyAddNotKeyWord(o_list)
|
|
|
}
|
|
|
c.TagRules = append(c.TagRules, TR)
|
|
@@ -151,7 +148,7 @@ func (c *Customer) GetTagRules() {
|
|
|
}
|
|
|
}
|
|
|
//规则
|
|
|
- if o_list, ok := tr["o_list"].(primitive.A); ok && len(o_list) > 0 {
|
|
|
+ if o_list, ok := tr["o_list"].([]interface{}); ok && len(o_list) > 0 {
|
|
|
TR.GetKeyAddNotKeyWord(o_list)
|
|
|
}
|
|
|
c.TagRules2 = append(c.TagRules2, TR)
|
|
@@ -176,7 +173,7 @@ func (c *Customer) GetTagRules() {
|
|
|
}
|
|
|
}
|
|
|
//规则
|
|
|
- if o_list, ok := tr["o_list"].(primitive.A); ok && len(o_list) > 0 {
|
|
|
+ if o_list, ok := tr["o_list"].([]interface{}); ok && len(o_list) > 0 {
|
|
|
TR.GetKeyAddNotKeyWord(o_list)
|
|
|
}
|
|
|
c.TagRules3 = append(c.TagRules3, TR)
|
|
@@ -370,7 +367,7 @@ func (c *Customer) EsConGetDataV7(stype string, esCon *esv.EsV7) {
|
|
|
tmp["company_phone"] = phone
|
|
|
}
|
|
|
//从最新年报中获取 中标单位联系电话、中标单位邮箱
|
|
|
- // if annual_reports, ok := finddata["annual_reports"].(primitive.A); ok && len(annual_reports) > 0 {
|
|
|
+ // if annual_reports, ok := finddata["annual_reports"].([]interface{}); ok && len(annual_reports) > 0 {
|
|
|
// anreport := Sort_year_report(annual_reports)
|
|
|
// if len(anreport) > 0 {
|
|
|
// if email := qu.ObjToString(anreport["company_email"]); email != "" {
|
|
@@ -884,7 +881,7 @@ func (d *Department) GetSearchRules(cid, stype string, idRange, idRanges bson.M)
|
|
|
SR.GetEs(d.Name, esquery, idRange, idRanges)
|
|
|
}
|
|
|
//获取关键词和附加词
|
|
|
- if o_rules, ok := sr["o_rules"].(primitive.A); ok && len(o_rules) > 0 {
|
|
|
+ if o_rules, ok := sr["o_rules"].([]interface{}); ok && len(o_rules) > 0 {
|
|
|
SR.GetKeyAddWord(o_rules)
|
|
|
for _, v := range o_rules {
|
|
|
orule, _ := v.(map[string]interface{})
|
|
@@ -978,7 +975,7 @@ func (sr *SearchRule) GetClearWord(key, match string) {
|
|
|
}
|
|
|
|
|
|
// 关键词、附加词处理
|
|
|
-func (sr *SearchRule) GetKeyAddWord(o_rules primitive.A) {
|
|
|
+func (sr *SearchRule) GetKeyAddWord(o_rules []interface) {
|
|
|
defer qu.Catch()
|
|
|
kw, aw, _, _, _ := GetNotkeyAndKeyAddWord(o_rules, sr.Fields, false)
|
|
|
sr.KW = kw
|
|
@@ -987,7 +984,7 @@ func (sr *SearchRule) GetKeyAddWord(o_rules primitive.A) {
|
|
|
}
|
|
|
|
|
|
// 排除词、关键词、附加词处理
|
|
|
-func (tr *TagRule) GetKeyAddNotKeyWord(o_list primitive.A) {
|
|
|
+func (tr *TagRule) GetKeyAddNotKeyWord(o_list []interface) {
|
|
|
defer qu.Catch()
|
|
|
kw, aw, nkw, tagnames, buyerclass := GetNotkeyAndKeyAddWord(o_list, tr.Fields, true)
|
|
|
tr.NW = nkw
|