From 68e212edd309e63f80fe189516e34cd3705f8a47 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期四, 08 八月 2019 19:47:53 +0800
Subject: [PATCH] 测试比对进程

---
 ruleserver/readyDataForRule.go |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/ruleserver/readyDataForRule.go b/ruleserver/readyDataForRule.go
index 0989721..dae27d2 100644
--- a/ruleserver/readyDataForRule.go
+++ b/ruleserver/readyDataForRule.go
@@ -167,22 +167,25 @@
 
 // 缁欑洰鏍囧~鍏卨iker
 func (arg *Arg) fillLiker(tableId []string, compareThreshold float32) {
-	// bytes := bigCache.GetComparePersonBaseInfo(tableId, arg.Feature, compareThreshold)
+	//bytes := bigCache.GetComparePersonBaseInfo(tableId, arg.Feature, compareThreshold)
 	comArg := &protomsg.CompareArgs{
 		TableIds:tableId,
 		FaceFeature:arg.Feature,
 		CompareThreshold:compareThreshold,
+		Source:false,
 	}
 	bytes := Push("tcp://192.168.1.182:40010",comArg,sock)
-	var m map[string]float32
-	err1 := json.Unmarshal(bytes, &m)
+	var scResult protomsg.SdkCompareResult
+	err1 := proto.Unmarshal(bytes, &scResult)
 	if err1 != nil {
 		logger.Error("getBaseInfo瑙e帇閿欒", err1)
 	}
 	//logger.Info("----------------------------------------map鏄�", m)
 	ids := []string{}
-	for key, _ := range m {
-		ids = append(ids, key)
+	var m map[string]*protomsg.SdkCompareEach
+	for _,key := range scResult.CompareResult {
+		ids = append(ids, key.Id)
+		m[key.Id] = key
 	}
 	logger.Info("------------------------------------------------------------------------------------------------------------------------")
 	//logger.Info("=====================浜哄憳id鐨勯泦鍚堜负锛�",ids)
@@ -200,8 +203,8 @@
 			if err != nil || len(table) == 0 {
 				logger.Error("鏍规嵁id鏌ヨ搴曞簱淇℃伅鍑洪敊锛�", err, "--杩斿洖鍊奸暱搴︿负锛�", len(table))
 			}
-			logger.Debug("鐪嬬湅杩欎釜base鐨勫姣斿�兼槸澶氬皯锛�", Decimal(m[baseinfo.Id] * 100))
-			base := BaseInfo{TableId: baseinfo.TableId, TableName: table[0].TableName, BwType: table[0].BwType, CompareScore: Decimal(m[baseinfo.Id] * 100), PersonId: baseinfo.Id, PersonName: baseinfo.PersonName, PersonPicUrl: baseinfo.PersonPicUrl, PhoneNum: baseinfo.PhoneNum, Sex: baseinfo.Sex, IdCard: baseinfo.IdCard, MonitorLevel: baseinfo.MonitorLevel, Content: baseinfo.Reserved}
+			logger.Debug("鐪嬬湅杩欎釜base鐨勫姣斿�兼槸澶氬皯锛�", Decimal(m[baseinfo.Id].CompareScore * 100))
+			base := BaseInfo{TableId: baseinfo.TableId, TableName: table[0].TableName, BwType: table[0].BwType, CompareScore: Decimal(m[baseinfo.Id].CompareScore * 100), PersonId: baseinfo.Id, PersonName: baseinfo.PersonName, PersonPicUrl: baseinfo.PersonPicUrl, PhoneNum: baseinfo.PhoneNum, Sex: baseinfo.Sex, IdCard: baseinfo.IdCard, MonitorLevel: baseinfo.MonitorLevel, Content: baseinfo.Reserved}
 			//os.Exit(1)
 			arg.Liker = append(arg.Liker, &base)
 		}
@@ -301,7 +304,7 @@
 			a.filterData = append(a.filterData, &arg1)
 		}
 	}
-	logger.Info("鍖哄煙鏄細",areaPoints,"鍖哄煙鍐呯洰鏍囨暟閲忎负锛�",a.targetNum,"---",len(a.filterData))
+	//logger.Info("鍖哄煙鏄細",areaPoints,"鍖哄煙鍐呯洰鏍囨暟閲忎负锛�",a.targetNum,"---",len(a.filterData))
 	a.time = time.Unix(time.Now().Unix(), 0).String()[11:16]
 	a.keepRight = arg.KeepRight
 	a.isStatic = arg.IsStatic

--
Gitblit v1.8.0