浏览代码

Merge branch 'dev3.4' of http://192.168.3.207:10080/qmx/jy-data-extract into dev3.4

# Conflicts:
#	src/jy/extract/extpackage.go
#	src/jy/pretreated/colonkv.go
fengweiqiang 5 年之前
父节点
当前提交
c3c0c456b7

+ 0 - 2
fullproject/src_v1/project.go

@@ -848,8 +848,6 @@ func (p *ProjectTask) UpdateProject(tmp map[string]interface{}, thisinfo *Info,
 		pkg := PackageFormat(thisinfo, pInfo)
 		pInfo.Package = pkg
 		set["package"] = pInfo.Package
-	} else {
-		set["multipackage"] = 0
 	}
 	//处理多包后,计算预算金额、中标金额
 	CountAmount(pInfo, thisinfo, tmp)

+ 4 - 4
src/config.json

@@ -1,7 +1,7 @@
 {
     "port": "9090",
-    "mgodb": "127.0.0.1:27092",
-    "dbsize": 10,
+    "mgodb": "192.168.3.207:27092",
+    "dbsize": 3,
     "dbname": "extract_kf",
     "redis": "buyer=127.0.0.1:6379,winner=127.0.0.1:6379,agency=127.0.0.1:6379,qyk_redis=127.0.0.1:6379",
     "elasticsearch": "http://127.0.0.1:9800",
@@ -18,7 +18,7 @@
     "redis_winner_db": "1",
     "redis_buyer_db": "2",
     "redis_agency_db": "3",
-    "elasticPoolSize": 5,
+    "elasticPoolSize": 1,
     "mergetable": "projectset",
     "mergetablealias": "projectset_v1",
     "saveresult": false,
@@ -28,7 +28,7 @@
     "filelength": 100000,
     "iscltlog": false,
     "brandgoods": false,
-    "udptaskid": "5cdd3025698414032c8322b1",
+    "udptaskid": "5cdd3021698414032c8322b1",
     "udpport": "1484",
     "nextNode": [
         {

+ 12 - 0
src/jy/admin/rule.go

@@ -467,6 +467,12 @@ func RuleLogicCoreSave(c *gin.Context) {
 		data["l_createtime"] = time.Now().Unix()
 		data["s_username"] = sessions.Default(c).Get("username")
 		data["delete"] = false
+		score := qu.Float64All(data["s_default_score"])
+		if score<=0{
+			data["s_default_score"] = 0.0
+		}else {
+			data["s_default_score"] = score
+		}
 		s_type := data["s_type"]
 		code := ""
 		if s_type == "0" { //抽取逻辑正则
@@ -478,6 +484,12 @@ func RuleLogicCoreSave(c *gin.Context) {
 		b = Mgo.Save("rule_logicore", data) != ""
 	} else {
 		data["l_lasttime"] = time.Now().Unix()
+		score := qu.Float64All(data["s_default_score"])
+		if score<=0{
+			data["s_default_score"] = 0.0
+		}else {
+			data["s_default_score"] = score
+		}
 		b = Mgo.Update("rule_logicore", `{"_id":"`+_id+`"}`, map[string]interface{}{
 			"$set": data,
 		}, true, false)

+ 1 - 1
src/jy/clear/cutspace.go

@@ -23,7 +23,7 @@ func init() {
 	cutAllSpace, _ = regexp.Compile(`\s*`)
 	catSymbol, _ = regexp.Compile(`[]+`)
 	separateSymbol, _ = regexp.Compile("[\\s\u3000\u2003\u00a0\\n,,、/。|]")
-	placeReg, _ = regexp.Compile("^.*(公司|学(校)?|集团|单位|机构|企业|厂|场|院|所|店|中心|市|局|站|城|处|行|部|队|联合(会|体)|工作室)$")
+	placeReg, _ = regexp.Compile("^.*(公司|学(校)?|集团|单位|机构|企业|厂|场|院|所|店|中心|市|局|站|城|处|行|科|部|队|联合(会|体)|工作室)$")
 	clearNum, _ = regexp.Compile("[\\d-]+")
 	endSymblo = regexp.MustCompile(`[/\\?+]$`)
 }

+ 14 - 5
src/jy/clear/tonumber.go

@@ -81,8 +81,8 @@ func ObjToFloat(data []interface{}) []interface{} {
 //金额转换
 func ObjToMoney(data []interface{}) []interface{} {
 	isfindUnit := true
-	tmpstr :=(data)[0]
-	if utf8.RuneCountInString(util.ObjToString(tmpstr)) > 30 {
+	tmpstr := (data)[0]
+	if utf8.RuneCountInString(util.ObjToString(tmpstr)) > 20 {
 		(data)[0] = 0
 		data = append(data, false)
 		return data
@@ -114,12 +114,21 @@ func ObjToMoney(data []interface{}) []interface{} {
 	data = append(data, true)
 	return data
 }
+
 //["中标金额","成交金额","合同金额","中标价","成交价","成交价格","中标(成交)金额","投标报价","中标标价","成交结果"]
 //["0元","零元","0.0万元","¥0元"]
 var moneyUnitRegBool = regexp.MustCompile(`(中标金额|成交金额|合同金额|中标价|成交价|成交价格|中标\(成交\)金额|投标报价|中标标价|成交结果)?[::\s]?(0|零|0.0|¥0)+(0|\.)*[\s]?(万|元|){0,2}[\s]?((人民币))?$`)
+
 //数字金额转换
 func numMoney(data []interface{}) ([]interface{}, bool) {
-	tmp := fmt.Sprintf("%f",data[0])
+	tmp := fmt.Sprint(data[0])
+	//费率转换% ‰
+	flv := float64(1)
+	if strings.HasSuffix(tmp, "%") {
+		flv = 0.01
+	} else if strings.HasSuffix(tmp, "‰") {
+		flv = 0.001
+	}
 	repUnit := float64(1)
 	if regQianw.MatchString(tmp) {
 		tmp = strings.Replace(tmp, "千万", "万", -1)
@@ -197,9 +206,9 @@ func numMoney(data []interface{}) ([]interface{}, bool) {
 	}
 	fnum = fnum * repUnit
 	if unit == float64(0) {
-		data[0] = fnum
+		data[0] = fnum * flv
 	} else {
-		data[0] = fnum * unit
+		data[0] = fnum * unit * flv
 	}
 	if unit == 10000 {
 		return data, false

+ 3 - 1
src/jy/extract/extpackage.go

@@ -148,7 +148,9 @@ func PackageDetail(j *ju.Job, e *ExtractTask, isSite bool, codeSite string) {
 					sonJobResult["origin"] = pkg.Origin
 					sonJobResult["text"] = pkg.Text
 					sonJobResult["name"] = pkg.Name
-					if pkg.IsTrueBudget {
+					sonJobResult["winnertel"] = pkg.WinnerTel
+					sonJobResult["winnerperson"] = pkg.WinnerPerson
+					if pkg.IsTrueBudget{
 						sonJobResult["budget"] = pkg.Budget
 					}
 					if pkg.IsTrueBidamount {

+ 39 - 6
src/jy/extract/extract.go

@@ -809,7 +809,13 @@ func ExtRuleCore(doc map[string]interface{}, e *ExtractTask, vc *RuleCore, j *ju
 				j.Result[k] = [](*ju.ExtField){}
 			}
 			for _, tmp := range v {
-				field := &ju.ExtField{Weight: qu.IntAll(tmp["weight"]), ExtFrom: qu.ObjToString(tmp["extfrom"]), Field: k, Code: qu.ObjToString(tmp["code"]), Type: qu.ObjToString(tmp["type"]), MatchType: qu.ObjToString(tmp["matchtype"]), RuleText: qu.ObjToString(tmp["ruletext"]), SourceValue: tmp["sourcevalue"], Value: tmp["value"]}
+				field := &ju.ExtField{Weight: qu.IntAll(tmp["weight"]),
+					ExtFrom: qu.ObjToString(tmp["extfrom"]), Field: k,
+					Code: qu.ObjToString(tmp["code"]), Type: qu.ObjToString(tmp["type"]),
+					MatchType: qu.ObjToString(tmp["matchtype"]),
+					RuleText: qu.ObjToString(tmp["ruletext"]),
+					SourceValue: tmp["sourcevalue"],
+					Value: tmp["value"]}
 				if k == "bidamount" && field.ExtFrom == "第一候选人" {
 					field.Score = 1
 				}
@@ -1004,6 +1010,16 @@ func ExtRuleCoreByPkgReg(j *ju.Job, in *RegLuaInfo, e *ExtractTask) {
 									j.BlockPackage[k].Winner = rep[in.Field+"_"+fmt.Sprint(i)]
 									break
 								}
+							} else if in.Field == "winnertel" {
+								if j.BlockPackage[k].WinnerTel == "" {
+									j.BlockPackage[k].WinnerTel = rep[in.Field+"_"+fmt.Sprint(i)]
+									break
+								}
+							} else if in.Field == "winnerperson" {
+								if j.BlockPackage[k].WinnerPerson == "" {
+									j.BlockPackage[k].WinnerPerson = rep[in.Field+"_"+fmt.Sprint(i)]
+									break
+								}
 							} else if in.Field == "bidstatus" {
 								if j.BlockPackage[k].BidStatus == "" {
 									j.BlockPackage[k].BidStatus = rep[in.Field+"_"+fmt.Sprint(i)]
@@ -1213,10 +1229,12 @@ func extractFromKv(field, fieldname string, blocks []*ju.Block, vc *RuleCore, kv
 //正则提取结果
 func extRegCoreToResult(extfrom, text string, tag *map[string]string, j *ju.Job, vre *RegLuaInfo, isSite bool) map[string][]map[string]interface{} {
 	defer qu.Catch()
-	var score int
+	var score float64
+	score = vre.Score
 	if isSite {
-		score = 1
+		score = score+1.0
 	}
+
 	extinfo := map[string][]map[string]interface{}{}
 	rep := map[string]string{}
 	if vre.RegCore.Bextract { //正则是两部分的,可以直接抽取的(含下划线)
@@ -1290,7 +1308,17 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]string, j *ju.Job,
 					}
 					tmps = append(tmps, tmp)
 
-					exfield := ju.ExtField{BlockTag: *tag, Field: vre.Field, Code: vre.Code, RuleText: vre.RuleText, Type: "regexp", MatchType: "regcontent", ExtFrom: extfrom, SourceValue: rep[vre.Field+"_"+fmt.Sprint(i)], Value: rep[vre.Field+"_"+fmt.Sprint(i)]}
+					exfield := ju.ExtField{
+						BlockTag: *tag,
+						Field: vre.Field,
+						Code: vre.Code,
+						RuleText: vre.RuleText,
+						Type: "regexp",
+						MatchType: "regcontent",
+						ExtFrom: extfrom,
+						SourceValue: rep[vre.Field+"_"+fmt.Sprint(i)],
+						Value: rep[vre.Field+"_"+fmt.Sprint(i)],
+						Score:score}
 					if tmp["blocktag"] != nil {
 						exfield.BlockTag = tmp["blocktag"].(map[string]string)
 					}
@@ -1298,6 +1326,7 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]string, j *ju.Job,
 				}
 			}
 			if len(tmps) > 0 {
+				//fmt.Println(tmps)
 				extinfo[vre.Field] = tmps
 			}
 		}
@@ -1330,7 +1359,9 @@ func extRegCoreToResult(extfrom, text string, tag *map[string]string, j *ju.Job,
 			if j.Result[vre.Field] == nil {
 				j.Result[vre.Field] = [](*ju.ExtField){}
 			}
-			field := &ju.ExtField{BlockTag: *tag, Field: vre.Field, Code: vre.Code, RuleText: vre.RuleText, Type: "regexp", MatchType: "regcontent", ExtFrom: extfrom, SourceValue: text, Value: val}
+			field := &ju.ExtField{BlockTag: *tag, Field: vre.Field, Code: vre.Code, RuleText: vre.RuleText, Type: "regexp", MatchType: "regcontent", ExtFrom: extfrom, SourceValue: text,
+				Value: val,
+				Score:score}
 			if tmp["blocktag"] != nil {
 				field.BlockTag = tmp["blocktag"].(map[string]string)
 			}
@@ -1354,7 +1385,9 @@ func ExtRegBack(j *ju.Job, in *RegLuaInfo, t *TaskInfo) {
 			if tmps, ok := v.([]map[string]interface{}); ok {
 				j.Result[k] = [](*ju.ExtField){}
 				for _, tmp := range tmps {
-					field := &ju.ExtField{Field: k, Code: qu.ObjToString(tmp["code"]), RuleText: qu.ObjToString(tmp["ruletext"]), Type: qu.ObjToString(tmp["type"]), MatchType: qu.ObjToString(tmp["matchtype"]), ExtFrom: qu.ObjToString(tmp["extfrom"]), Value: tmp["value"]}
+					field := &ju.ExtField{Field: k, Code: qu.ObjToString(tmp["code"]), RuleText: qu.ObjToString(tmp["ruletext"]), Type: qu.ObjToString(tmp["type"]), MatchType: qu.ObjToString(tmp["matchtype"]),
+						ExtFrom: qu.ObjToString(tmp["extfrom"]),
+						Value: tmp["value"]}
 					if tmp["blocktag"] != nil {
 						field.BlockTag = tmp["blocktag"].(map[string]string)
 					}

+ 2 - 0
src/jy/extract/extractInit.go

@@ -21,6 +21,7 @@ import (
 type RegLuaInfo struct {
 	//正则或脚本信息
 	Code, Name, Field string  //
+	Score 			  float64
 	RuleText          string  //
 	IsLua             bool    //
 	RegPreBac         *ExtReg //
@@ -525,6 +526,7 @@ func (e *ExtractTask) InitRuleCore(isSite bool) {
 					Field: field,
 					Code:  v["s_code"].(string),
 					Name:  v["s_name"].(string),
+					Score: v["s_default_score"].(float64),
 					IsLua: qu.If(v["s_type"].(string) == "1", true, false).(bool),
 				}
 				if rinfo.IsLua {

+ 13 - 0
src/jy/extract/score.go

@@ -125,6 +125,19 @@ func ScoreFields(j *ju.Job, ftag map[string][]*Tag) map[string][]*ju.ExtField {
 		taglength := len(ftag[field])
 		locktag.Unlock()
 		for tmpsindex, tmpsvalue := range tmps {
+
+			if tmpsvalue.Score>0 {
+				//有初始分先添加进去
+				tmps[tmpsindex].ScoreItem = append(tmps[tmpsindex].ScoreItem, &ju.ScoreItem{
+					Des: "正则初始分",
+					Code: tmpsvalue.Code,
+					RuleText: tmpsvalue.RuleText,
+					ScoreFrom: "正则初始分",
+					Value: tmpsvalue.Value,
+					Score: tmpsvalue.Score,
+				})
+			}
+
 			//没有抽取到值,不打分
 			if string_value := fmt.Sprint(tmpsvalue.Value); string_value == "" || string_value == "0" || string_value == "<nil>" {
 				if field == "budget" || field == "bidamount" {

+ 19 - 0
src/jy/pretreated/analytable.go

@@ -2691,6 +2691,25 @@ func (tn *Table) TdContactFormat(contactFormat *u.ContactFormat, isSite bool, co
 				//					qutil.Debug(v.Key, v.Value)
 				//				}
 				if len(thisTdKvs) != 1 {
+					preTdIndex := td_index - 1
+					if preTdIndex >= 0 {
+						preTdVal := tr.TDs[td_index-1].Val
+						tdType := "" //前一个td中是否是采购、代理、中标
+						for k, v := range ContactType {
+							if v.MatchString(preTdVal) {
+								tdType = k
+								break
+							}
+						}
+						if tdType != "" {
+							for _, this := range thisTdKvs {
+								if str := ContactInfoVagueReg.FindString(this.Key); str != "" {
+									td.SortKV.AddKey(tdType+str, this.Value)
+								}
+							}
+						}
+					}
+
 					continue
 				}
 				//1.处理带括号的()[]【】采购单位,代理机构;2.识别采购单位联系人、联系电话、代理机构联系人、联系电话

+ 8 - 1
src/jy/pretreated/colonkv.go

@@ -569,7 +569,14 @@ func FormatContactKv(kvs *[]*Kv, title string, buyers []string, contactFormat *C
 			continue
 		}
 		//qutil.Debug("ContactInfoMustReg.MatchString(k)+++", !ContactInfoMustReg.MatchString(k))
-		if !ContactInfoMustReg.MatchString(k) { //判断是否是电话、邮箱、地址等信息
+		matchMust := ContactInfoMustReg.MatchString(k)
+		matchHas := ContactInfoVagueReg.MatchString(k)
+		//qutil.Debug("matchMust:", matchMust, "matchHas:", matchHas)
+		if !matchMust && matchHas {
+			k = ContactInfoVagueReg.FindString(k)
+		}
+		//qutil.Debug("kkkkkkkkkkkk", k)
+		if !matchMust && !matchHas { //判断是否是电话、邮箱、地址等信息
 			if DoubtReg.MatchString(k) { //匹配到投诉和监督 5bc9683ea5cb26b9b72b2302 5c35f3e8a5cb26b9b72dcdbd
 				startIndex = 0
 				//notmatchCount = 0

+ 2 - 0
src/jy/util/article.go

@@ -134,6 +134,8 @@ type BlockPackage struct {
 	Budget          float64                  //标段(包)预算
 	IsTrueBudget    bool                     //标段(包)预算0是否有效
 	Winner          string                   //标段(包)中标单位
+	WinnerTel		string					 //中标单位联系电话
+	WinnerPerson	string					 //中标联系人
 	Bidamount       float64                  //标段(包)中标价
 	IsTrueBidamount bool                     //标段(包)中标价 0是否有效
 	Index           string                   //序号 (转换后编号,只有数字或字母)

+ 2 - 2
src/res/fieldscore.json

@@ -329,7 +329,7 @@
                 "score": -10
             },  {
                 "describe": "包含负分",
-                "regstr": "(详(见|情)|公告|名称)",
+                "regstr": "(详(见|情)|公告|名称|制作)",
                 "score": -10
             }
         ],
@@ -421,7 +421,7 @@
                 "score": -10
             },  {
                 "describe": "包含负分",
-                "regstr": "(详(见|情)|公告)",
+                "regstr": "(详(见|情)|公告|管理员)",
                 "score": -10
             }
         ],

+ 5 - 0
src/res/formattext.json

@@ -135,6 +135,11 @@
 			"reg": "(?s)([^((,,。、.;;::\\s\u3000\u2003\u00a0]{0,8})(联系.{1,4})(和|及)(.{2,4})[::][\u3000\u2003\u00a0\\s]*([\u4e00-\u9fa5]{2,5})[::\\s\u3000\u2003\u00a0]*((([((]\\d{3,4}[))])?(\\d{6,12}([×―—-\\-]+\\d{3,4})?|\\d{3,4}[×―—-\\-]+[\u3000\u2003\u00a0\\s]*\\d{6,12}([×―—-\\-]+\\d{4})?|(\\d{2}[×―—-\\-])+\\d{8}[×―—-\\-](\\d{3}[、])+)(转\\d{3,4})?[或/、,,;;\u3000\u2003\u00a0\\s]*)+(\\d{3,})?)",
             "separator": "${1}${2}:${5}\n${1}${4}:${6}",
             "desc": "采购人联系人和联系方式:雷蒙:13299985556 or 联系人及电话:  朱云鹏    13993240931"
+		},
+		{
+			"reg": "((招标|代理).{2,4})联系方式[::](.*)联系人[::](.+?)[\\s\u3000\u2003\u00a0]+联系方式[::]([\\d-转()()/、]+)",
+            "separator": "${1}联系人:${4} ${1}电话:${5}",
+            "desc": "采购项目联系方式:</td></tr><tr><td>        联系人:朱志强        联系方式:67897307"
 		},
 		{
 			"reg": "(?s)([^((,,。、.;;::\\s\u3000\u2003\u00a0]{0,8}?)(联系(方式|电话|人)和?)+[::]([^\\d::]{2,8}?)[((]?[\\s\u3000\u2003\u00a0]*((([((]\\d{3,4}[))])?(\\d{6,12}([×―—-\\-]+\\d{3,4})?|\\d{3,4}[×―—-\\-]+[\u3000\u2003\u00a0\\s]*\\d{6,12}([×―—-\\-]+\\d{4})?|(\\d{2}[×―—-\\-])+\\d{8}[×―—-\\-](\\d{3}[、])+)(转\\d{3,4})?[或/、,,;;\u3000\u2003\u00a0\\s]*)+(\\d{3,})?)",

+ 3 - 1
src/web/templates/admin/rule_logicore.html

@@ -153,7 +153,9 @@ $(function () {
 			case "newlua":
 			case "new":
 				comtag=[{label:"名称",s_label:"s_name",placeholder:"",must:true},{label:"描述",s_label:"s_descript",type:"tpl_text"},{label:"启用",s_label:"isuse",type:"tpl_list_local",list:[{"s_name":"是","_id":true},{"s_name":"否","_id":false}],default:true}]
-				regtag=[{label:"字段",s_label:"s_field",type:"tpl_list_local",url:"/admin/getfields",default:{{.field}}},{label:"正则",s_label:"s_rule",type:"tpl_text",must:true}]
+				regtag=[{label:"字段",s_label:"s_field",type:"tpl_list_local",url:"/admin/getfields",default:{{.field}}},{label:"正则",s_label:"s_rule",type:"tpl_text",must:true},
+					{label:"分数",s_label:"s_default_score",placeholder:"默认0"}]
+
 				luatag=[{label:"字段",s_label:"s_field",type:"tpl_list_local",url:"/admin/getfields",default:{{.field}}},{label:"脚本",s_label:"s_luascript",type:"tpl_text",must:true}]
 				testcon=[{label:"测试内容",s_label:"s_testcon",type:"tpl_text",must:true}]
 				hiddentag=[{s_label:"_id",type:"tpl_hidden"},{s_label:"vid",type:"tpl_hidden"},{s_label:"pid",type:"tpl_hidden"},{s_label:"sid",type:"tpl_hidden"},{s_label:"s_type",type:"tpl_hidden"}]

+ 9 - 4
udp_winner/timedTaskAgency.go

@@ -63,6 +63,11 @@ func TaskAgency(mapinfo *map[string]interface{}) {
 		var tmpRangeId string
 		for cursor.Next(&tmp) {
 			num++
+
+			if num%10000==0 &&num>0{
+				log.Println("当前代理机构数量:",num)
+			}
+
 			mgoId := tmp["_id"].(bson.ObjectId).Hex()
 			tmpRangeId = mgoId
 			agency, ok := tmp["agency"].(string)
@@ -177,7 +182,7 @@ func TaskAgency(mapinfo *map[string]interface{}) {
 					//遍历redis value联系人
 					for _, rvmap := range rValuesMaps {
 						var tmpperson, agencytel string
-						if rvmapperson, ok := rvmap["agencyperson"].(string); ok && rvmapperson != "" {
+						if rvmapperson, ok := rvmap["agencyperson"].(string); ok && utf8.RuneCountInString(rvmapperson)>=2 && rvmapperson != "" {
 							tmpperson = rvmapperson
 						} else {
 							continue
@@ -308,7 +313,7 @@ func AddAgency(overid string, tmp map[string]interface{}) string {
 			}
 		}
 		var tmpperson, agencytel string
-		if tmppersona, ok := tmp["agencyperson"].(string); ok && tmppersona != "" && Reg_person.MatchString(tmppersona) && !Reg_xing.MatchString(tmppersona) {
+		if tmppersona, ok := tmp["agencyperson"].(string); ok && utf8.RuneCountInString(tmppersona)>=2 && tmppersona != "" && Reg_person.MatchString(tmppersona) && !Reg_xing.MatchString(tmppersona) {
 			tmpperson = tmppersona
 		}
 		if tmpperson != "" {
@@ -478,7 +483,7 @@ func TimedTaskAgency() {
 							}
 						}
 						contacts := make([]map[string]interface{}, 0)
-						if legal_person, ok := resulttmp["legal_person"].(string); ok && legal_person != "" && !Reg_xing.MatchString(legal_person) && Reg_person.MatchString(legal_person) {
+						if legal_person, ok := resulttmp["legal_person"].(string); ok && utf8.RuneCountInString(legal_person)>=2 && legal_person != "" && !Reg_xing.MatchString(legal_person) && Reg_person.MatchString(legal_person) {
 							contact := make(map[string]interface{}, 0)
 							contact["contact_person"] = legal_person //联系人
 							contact["contact_type"] = "法定代表人"        //法定代表人
@@ -523,7 +528,7 @@ func TimedTaskAgency() {
 
 
 						//添加临时表匹配到的联系人
-						if agencyperson, ok := tmp["agencyperson"].(string); ok && agencyperson != "" &&
+						if agencyperson, ok := tmp["agencyperson"].(string); ok && utf8.RuneCountInString(agencyperson)>=2 && agencyperson != "" &&
 							!Reg_xing.MatchString(agencyperson) && Reg_person.MatchString(agencyperson) {
 							vvv := make(map[string]interface{})
 							vvv["infoid"] = tmp["_id"].(bson.ObjectId).Hex()

+ 8 - 4
udp_winner/timedTaskBuyer.go

@@ -63,6 +63,10 @@ func TaskBuyer(mapinfo *map[string]interface{}) {
 		var tmpRangeId string
 		for cursor.Next(&tmp) {
 			num++
+			if num%10000==0 &&num>0{
+				log.Println("当前采购单位数量:",num)
+			}
+
 			mgoId := tmp["_id"].(bson.ObjectId).Hex()
 			tmpRangeId = mgoId
 			buyer, ok := tmp["buyer"].(string)
@@ -196,7 +200,7 @@ func TaskBuyer(mapinfo *map[string]interface{}) {
 					//遍历redis value联系人
 					for _, rvmap := range rValuesMaps {
 						var tmpperson, buyertel string
-						if rvmapperson, ok := rvmap["buyerperson"].(string); ok && rvmapperson != "" {
+						if rvmapperson, ok := rvmap["buyerperson"].(string); ok && utf8.RuneCountInString(rvmapperson)>=2 && rvmapperson != "" {
 							tmpperson = rvmapperson
 						} else {
 							continue
@@ -345,7 +349,7 @@ func AddBuyer(overid string, tmp map[string]interface{}) string {
 			}
 		}
 		var tmpperson, buyertel string
-		if tmppersona, ok := tmp["buyerperson"].(string); ok && tmppersona != "" && Reg_person.MatchString(tmppersona) && !Reg_xing.MatchString(tmppersona) {
+		if tmppersona, ok := tmp["buyerperson"].(string); ok && utf8.RuneCountInString(tmppersona)>=2 && tmppersona != "" && Reg_person.MatchString(tmppersona) && !Reg_xing.MatchString(tmppersona) {
 			tmpperson = tmppersona
 		}
 		if tmpperson != "" {
@@ -515,7 +519,7 @@ func TimedTaskBuyer() {
 							}
 						}
 						contacts := make([]map[string]interface{}, 0)
-						if legal_person, ok := resulttmp["legal_person"].(string); ok && legal_person != "" && !Reg_xing.MatchString(legal_person) && Reg_person.MatchString(legal_person) {
+						if legal_person, ok := resulttmp["legal_person"].(string); ok && utf8.RuneCountInString(legal_person)>=2 &&legal_person != "" && !Reg_xing.MatchString(legal_person) && Reg_person.MatchString(legal_person) {
 							contact := make(map[string]interface{}, 0)
 							contact["contact_person"] = legal_person //联系人
 							contact["contact_type"] = "法定代表人"        //法定代表人
@@ -560,7 +564,7 @@ func TimedTaskBuyer() {
 
 
 						//添加临时表匹配到的联系人
-						if buyerperson, ok := tmp["buyerperson"].(string); ok && buyerperson != "" &&
+						if buyerperson, ok := tmp["buyerperson"].(string); ok &&utf8.RuneCountInString(buyerperson)>=2 && buyerperson != "" &&
 							!Reg_xing.MatchString(buyerperson) && Reg_person.MatchString(buyerperson) {
 							vvv := make(map[string]interface{})
 							vvv["infoid"] = tmp["_id"].(bson.ObjectId).Hex()

+ 4 - 4
udp_winner/timedTaskWinner.go

@@ -229,7 +229,7 @@ func TaskWinner(mapinfo *map[string]interface{}) {
 					//遍历redis value联系人
 					for _, rvmap := range rValuesMaps {
 						var tmpperson, winnertel string
-						if rvmapperson, ok := rvmap["winnerperson"].(string); ok && rvmapperson != "" {
+						if rvmapperson, ok := rvmap["winnerperson"].(string); ok && utf8.RuneCountInString(rvmapperson)>=2 && rvmapperson != "" {
 							tmpperson = rvmapperson
 						} else {
 							continue
@@ -370,7 +370,7 @@ func Add(overid string, tmp map[string]interface{}) string {
 			}
 		}
 		var tmpperson, winnertel string
-		if tmppersona, ok := tmp["winnerperson"].(string); ok && tmppersona != "" && Reg_person.MatchString(tmppersona) && !Reg_xing.MatchString(tmppersona) {
+		if tmppersona, ok := tmp["winnerperson"].(string); ok && utf8.RuneCountInString(tmppersona)>=2 && tmppersona != "" && Reg_person.MatchString(tmppersona) && !Reg_xing.MatchString(tmppersona) {
 			tmpperson = tmppersona
 		}
 		if tmpperson != "" {
@@ -539,7 +539,7 @@ func TimedTaskWinner() {
 							}
 						}
 						contacts := make([]map[string]interface{}, 0)
-						if legal_person, ok := resulttmp["legal_person"].(string); ok && legal_person != "" && !Reg_xing.MatchString(legal_person) && Reg_person.MatchString(legal_person) {
+						if legal_person, ok := resulttmp["legal_person"].(string); ok && utf8.RuneCountInString(legal_person)>=2 && legal_person != "" && !Reg_xing.MatchString(legal_person) && Reg_person.MatchString(legal_person) {
 							contact := make(map[string]interface{}, 0)
 							contact["contact_person"] = legal_person //联系人
 							contact["contact_type"] = "法定代表人"        //法定代表人
@@ -582,7 +582,7 @@ func TimedTaskWinner() {
 							contacts = append(contacts, contact)
 						}
 						//添加临时表匹配到的联系人
-						if winnerperson, ok := tmp["winnerperson"].(string); ok && winnerperson != "" &&
+						if winnerperson, ok := tmp["winnerperson"].(string); ok && utf8.RuneCountInString(winnerperson)>=2 && winnerperson != "" &&
 							!Reg_xing.MatchString(winnerperson) && Reg_person.MatchString(winnerperson) {
 							vvv := make(map[string]interface{})
 							vvv["infoid"] = tmp["_id"].(bson.ObjectId).Hex()