| | |
| | | return false |
| | | } |
| | | |
| | | func EnteringButNotLeaving(docNumber string, id string, days int) bool { |
| | | total, err := db.QueryTimesByDocNumberDays(days-1, docNumber) |
| | | func EnteringButNotLeaving(docNumber string, communityId string, cameraIds []string, days int) bool { |
| | | total, err := db.QueryTimesByDocNumberDays(docNumber, communityId, cameraIds, days-1) |
| | | if err != nil { |
| | | logger.Error("QueryTimesByDocNumberDays err: ", err) |
| | | } |
| | |
| | | } |
| | | |
| | | func registeredAddressNotMatchActualResidence(taskPerson db.TaskPerson) bool { |
| | | idCard := db.GetIdCardById(taskPerson.DocumentNumber) |
| | | if idCard == "" { |
| | | return false |
| | | } |
| | | |
| | | if _, ok := cache.PublicHouse[taskPerson.CommunityId]; !ok { |
| | | return false |
| | | } |
| | | |
| | | // 有身份证号, 小区属于公租房, 公租房登记身份证号没有该条记录, 返回true |
| | | personStatus := db.GetDBPersonStatus(taskPerson.DocumentNumber, taskPerson.CommunityId) |
| | | logger.Debugf("Actual residence get person id:%s status: %s", taskPerson.DocumentNumber, personStatus) |
| | | if personStatus == "resident" || personStatus == "permanent_resident" { |
| | | if _, ok := cache.PublicHouse[taskPerson.CommunityId][idCard]; !ok { |
| | | // 控制程序运行期间只输出一次报警 |
| | | if _, ok := cache.PublicHouseAlarmCache[idCard]; ok { |
| | | return false |
| | | } else { |
| | | cache.PublicHouseAlarmCache[idCard] = struct{}{} |
| | | return true |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false |
| | | } |