From aa981c60d68d3410d4ea580ca6f24abab43cb30f Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期三, 12 八月 2020 17:15:11 +0800
Subject: [PATCH] fix sync person from hik and update phoneNum if change

---
 service/carService.go |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/service/carService.go b/service/carService.go
index a3c45e0..3fdff76 100644
--- a/service/carService.go
+++ b/service/carService.go
@@ -309,13 +309,13 @@
 	hikPersons := sv.GetHikPersonList()
 	if hikPersons != nil && len(hikPersons) >0 {
 		var u models.User
-		uMap,idMap := u.GetAllMapByPhone()
+		idMap := u.GetAllMap()
 		hikPM := make(map[string]string)
 		for _,hp := range hikPersons {
-			hikPM[hp.PersonId] = hp.PersonId
-			if sp,ok := uMap[hp.PhoneNo];ok {
-				if sp.Id != hp.PersonId {
-					u.SyncHikPersonId(hp.PhoneNo, hp.PersonId)
+			hikPM[hp.PersonId] = hp.PhoneNo
+			if sp,ok := idMap[hp.PersonId];ok {
+				if sp.PhoneNum != hp.PhoneNo {
+					u.UpdatePhoneNum(hp.PhoneNo, hp.PersonId)
 					syncCount++
 				}
 			}

--
Gitblit v1.8.0