liuxiaolong
2019-10-15 b4924f874df4f23e1968151d28bc18110f84146a
controllers/dbtableperson.go
@@ -129,15 +129,16 @@
   } else {
      faceB = face.FaceBytes
   }
   var sysSetApi dbapi.SysSetApi
   analyServerId := ""
   flag, sysconf := sysSetApi.GetServerInfo()
   if flag {
      analyServerId = sysconf.ServerId
   conf, e := cache.GetServerInfo()
   if e ==nil && conf.ServerId != "" {
      analyServerId = conf.ServerId
   } else {
      util.ResponseFormat(c, code.ComError, "analyServerId为空,配置有误")
      return
   }
   arg := protomsg.CompareArgs{
      FaceFeature: faceB,
      CompareThreshold: 0.6,
@@ -182,9 +183,9 @@
}
//填充向前端返回的数据
func FillDbPersonDataToCompareResult(compResult *protomsg.SdkCompareResult) []DbPersonVo {
func FillDbPersonDataToCompareResult(compResult *protomsg.SdkCompareResult) []models.DbPersonsCompVo {
   var resultList = make([]DbPersonVo, len(compResult.CompareResult))
   var resultList = make([]models.DbPersonsCompVo, len(compResult.CompareResult))
   dbPersonM := make(map[string]ScoreIndex, 0)
   personIds := make([]string,0)
@@ -204,25 +205,32 @@
   }
   if len(dbpersons) >0 {
      var dtApi dbapi.DbTableApi
      //var dtApi dbapi.DbTableApi
      for _,p :=range dbpersons {
         var dbP = DbPersonVo {
            PersonId: p.Id,
            IdCard: p.IdCard,
            CompareScore: util.ParseScore(dbPersonM[p.Id].CompareScore),
            MonitorLevel: p.MonitorLevel,
            PersonName: p.PersonName,
            PersonPicUrl: p.PersonPicUrl,
            PhoneNum: p.PhoneNum,
            Sex: p.Sex,
            TableId: p.TableId,
            Enable: p.Enable,
         }
         dbTableInfos, _ := dtApi.DbtablesById([]string{ p.TableId })
         if dbTableInfos !=nil{
            dbP.BwType = dbTableInfos[0].BwType
            dbP.TableName = dbTableInfos[0].TableName
         }
         var dbP models.DbPersonsCompVo
         dbP.Id = p.Id
         dbP.TableId = p.TableId
         dbP.FaceFeature = p.FaceFeature
         dbP.PersonPicUrl = p.PersonPicUrl
         dbP.PersonName = p.PersonName
         dbP.Age = p.Age
         dbP.Sex = p.Sex
         dbP.IdCard = p.IdCard
         dbP.PhoneNum = p.PhoneNum
         dbP.MonitorLevel = p.MonitorLevel
         dbP.Reserved = p.Reserved
         dbP.IsDelete = int(p.IsDelete)
         dbP.Enable = int(p.Enable)
         dbP.CreateTime = p.CreateTime
         dbP.UpdateTime = p.UpdateTime
         dbP.CreateBy = p.CreateBy
         dbP.CompareScore = util.ParseScore(dbPersonM[p.Id].CompareScore)
         //dbTableInfos, _ := dtApi.DbtablesById([]string{ p.TableId })
         //if dbTableInfos !=nil{
         //   dbP.BwType = dbTableInfos[0].BwType
         //   dbP.TableName = dbTableInfos[0].TableName
         //}
         resultList[dbPersonM[p.Id].Index] = dbP
      }
   }