|
@@ -273,19 +273,11 @@ func AddTaskSensitiveWordsData() {
|
|
err := findByupdate.Decode(&tmp)
|
|
err := findByupdate.Decode(&tmp)
|
|
if err == nil {
|
|
if err == nil {
|
|
if company_name, ok := tmp["company_name"].(string); ok {
|
|
if company_name, ok := tmp["company_name"].(string); ok {
|
|
- if reglen.MatchString(company_name) || strReg.MatchString(company_name) ||
|
|
|
|
- !uncon_strReg.MatchString(company_name) || !unstart_strReg.MatchString(company_name) ||
|
|
|
|
- start_strReg.MatchString(company_name) || end_strReg.MatchString(company_name) ||
|
|
|
|
|
|
+
|
|
|
|
+ if strReg.MatchString(company_name) || !unstart_strReg.MatchString(company_name) ||
|
|
con_strReg.MatchString(company_name) {
|
|
con_strReg.MatchString(company_name) {
|
|
- continue
|
|
|
|
- }
|
|
|
|
- if strings.Contains(ObjToString(tmp["company_type"]), "个人") ||
|
|
|
|
- strings.Contains(ObjToString(tmp["company_type"]), "个体") ||
|
|
|
|
- strings.Contains(ObjToString(tmp["company_type_old"]), "个人") ||
|
|
|
|
- strings.Contains(ObjToString(tmp["company_type_old"]), "个体") {
|
|
|
|
- continue
|
|
|
|
|
|
+ return
|
|
}
|
|
}
|
|
-
|
|
|
|
//存mgo
|
|
//存mgo
|
|
new_tmp ,err:= con.Database("mixdata").Collection("unique_qyxy").InsertOne(nil, bson.M{
|
|
new_tmp ,err:= con.Database("mixdata").Collection("unique_qyxy").InsertOne(nil, bson.M{
|
|
"qy_name": company_name,
|
|
"qy_name": company_name,
|
|
@@ -293,10 +285,7 @@ func AddTaskSensitiveWordsData() {
|
|
if err==nil {
|
|
if err==nil {
|
|
dealWithEsData(company_name, BsonTOStringId(new_tmp.InsertedID))
|
|
dealWithEsData(company_name, BsonTOStringId(new_tmp.InsertedID))
|
|
}
|
|
}
|
|
- //存敏感词
|
|
|
|
-
|
|
|
|
|
|
|
|
- //存es=判断+新增
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -321,7 +310,6 @@ func dealWithEsData(name string, tmpid string) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if len(data) == 0 {
|
|
if len(data) == 0 {
|
|
- //log.Println("无数据-新增")
|
|
|
|
_, err := Client_Es.Index().Index(es_index).Type(es_type).Id(tmpid).BodyJson(map[string]interface{}{
|
|
_, err := Client_Es.Index().Index(es_index).Type(es_type).Id(tmpid).BodyJson(map[string]interface{}{
|
|
"name": name,
|
|
"name": name,
|
|
"name_word": name,
|
|
"name_word": name,
|