Explorar o código

Merge branch 'master' of http://192.168.3.207:10080/qmx/jy-data-extract

zhangjinkun %!s(int64=6) %!d(string=hai) anos
pai
achega
cdc4eb5cbb

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

@@ -203,7 +203,7 @@ func RemoveAsymmetric(text string) string {
 		if AsyReg.MatchString(first) {
 			text = text[1:]
 		}
-		if AsyReg.MatchString(last) {
+		if AsyReg.MatchString(last) && len(text) > 0 {
 			text = text[:len(text)-1]
 		}
 	}

+ 4 - 0
src/jy/extract/extract.go

@@ -850,6 +850,7 @@ func AnalysisSaveResult(j *ju.Job, e *ExtractTask) {
 }
 
 func (e *ExtractTask) QualityAudit(resulttmp map[string]interface{}) {
+	defer qu.Catch()
 	//获取审核字段
 	for _, field := range e.AuditFields {
 		//1.分包
@@ -888,6 +889,7 @@ func (e *ExtractTask) QualityAudit(resulttmp map[string]interface{}) {
 
 //Redis匹配
 func (e *ExtractTask) RedisMatch(field, fv string, val map[string]interface{}) {
+	defer qu.Catch()
 	i := redis.GetInt(field, field+"_"+fv) //查找redis
 	if i == 0 {                            //reids未找到,执行规则匹配
 		val[field+"_isredis"] = false
@@ -899,6 +901,7 @@ func (e *ExtractTask) RedisMatch(field, fv string, val map[string]interface{}) {
 
 //规则匹配
 func (e *ExtractTask) RuleMatch(field, fieldval string, tmpMap map[string]interface{}) {
+	defer qu.Catch()
 	if fieldval != "" {
 		SMap := e.StartMatch(field, fieldval)
 		//SMap.AddKey(field+"_isaudit", false)
@@ -911,6 +914,7 @@ func (e *ExtractTask) RuleMatch(field, fieldval string, tmpMap map[string]interf
 
 //开始规则匹配
 func (e *ExtractTask) StartMatch(field, text string) *pretreated.SortMap {
+	defer qu.Catch()
 	SMap := pretreated.NewSortMap()
 	lock.Lock()
 	f := e.RecogFieldMap[field]

+ 1 - 0
src/jy/extract/extractcity.go

@@ -45,6 +45,7 @@ func init() {
 	qu.ReadConfig("./extractcity.json", &SortField)
 }
 func (e *ExtractTask) TransmitData(resulttmp map[string]interface{}, id string) (bres bool, p, c, d string) {
+	defer qu.Catch()
 	province := fmt.Sprint(resulttmp["area"])
 	city := fmt.Sprint(resulttmp["city"])
 	fieldval := make([]string, 0)