private bool CheckExistAlarm(DateTime currentTime, string personId) { IList <HitPersonInfo> lstcache = _cache.GetAll <HitPersonInfo>(); if (lstcache != null && lstcache.Count > 0) { foreach (HitPersonInfo info in lstcache) { // 如果周期内出现,则默认不出现 if (info.HitTime.AddSeconds(_FaceMinPeriod) >= currentTime && info.PersonId == personId) { Log4NetHelper.Instance.Info("人脸出现时间:" + currentTime.ToString() + "," + personId + " 重复出现,将过滤"); return(true); } } } return(false); }