1、住户不再降级
2、住户地址随时间边长定位越来越准确
3、住户分析的服务人员归类到访客
| | |
| | | host: 192.168.20.115 |
| | | port: 4101 |
| | | capAddrDaysThreshold: 50 #capAddrDaysThreshold 抓拍非空非1楼非地下地址天数占总天数比值,百分制 |
| | | timeThreshold: 270 #timeThreshold 查询档案时间范围,为之前timeThreshold天之内的数据 |
| | | timeThreshold: 30 #timeThreshold 查询档案时间范围,为之前timeThreshold天之内的数据 |
| | | csTimes: 10 #climbed stairs times 窜楼次数 |
| | | csHours: 5 #climbed stairs hours 窜楼预警时间 该csHours时间范围之内 |
| | | aInterval: 3 #interval time between anomalies 进出异常间隔时间 |
| | |
| | | } |
| | | |
| | | // processData 函数处理数据,根据要求过滤掉数据并根据规则更新状态 |
| | | func ProcessData(captureInfos []db.CaptureInfo, personStatus []*db.PersonStatus, ruleInfos []db.PersonnelStatusRule, communityID string) []db.PersonStatus { |
| | | func ProcessData(captureInfos []db.CaptureInfo, personStatus []*db.PersonStatus, ruleInfos []db.PersonnelStatusRule, statusNo map[string]int, communityID string) []db.PersonStatus { |
| | | filteredInfos := make([]db.PersonStatus, 0) |
| | | |
| | | // 构建快速查找索引,方便查找对应的人员状态和规则 |
| | |
| | | //} |
| | | // 更新过滤后的信息列表 |
| | | //fmt.Println("LastAppearanceTime: ", person.LastAppearanceTime) |
| | | if statusNo[person.Status] > statusNo[info.Status] { |
| | | continue |
| | | } |
| | | filteredInfos = append(filteredInfos, db.PersonStatus{CommunityID: communityID, DocumentNumber: info.DocumentNumber, Status: info.Status, FrequentAddress: info.FrequentAddress, LastAppearanceStatusTime: person.LastAppearanceTime}) |
| | | |
| | | } |
| | |
| | | BuildingTypeOffice BuildingType = 6 //写字楼 |
| | | ) |
| | | |
| | | //type status int |
| | | |
| | | const ( |
| | | StatusStranger int = 1 |
| | | StatusVisitor int = 2 |
| | | StatusResident int = 3 |
| | | ) |
| | | |
| | | type Device struct { |
| | | DeviceCode string `gorm:"column:deviceCode" json:"deviceCode" example:"J83762"` //设备编码 |
| | | AreaID string `json:"areaID" gorm:"index;column:communityID;type:varchar(299);"` //常住小区 domain unit ID |
| | |
| | | FrequentAddress string `gorm:"column:frequent_address;type:varchar(255);not null;default:''" json:"frequentAddress"` //常出现地点 |
| | | CreatedAt time.Time |
| | | UpdatedAt time.Time |
| | | NewStatus string `gorm:"-"` |
| | | ////OrgId string `gorm:"column:org_id"` |
| | | //CommunityID string `gorm:"column:communityID"` |
| | | //DocumentNumber string `gorm:"column:documentNumber"` |
| | |
| | | //fmt.Println(addrDataArray) |
| | | //fmt.Println("threshold: ", threshold) |
| | | //fmt.Println("stdDev: ", stdDev) |
| | | info.Status = "fieldworker" |
| | | //info.Status = "fieldworker" |
| | | info.Status = "visitor" |
| | | captureInfo = append(captureInfo, info) |
| | | identity = append(identity, db.Identity{ |
| | | CommunityID: communityID, |
| | |
| | | logger.Error("GetAllData Error", err) |
| | | } |
| | | fmt.Println("ruleInfo: ", ruleInfo) |
| | | statusNo := make(map[string]int) |
| | | statusNo["stranger"] = db.StatusStranger |
| | | statusNo["visitor"] = db.StatusVisitor |
| | | statusNo["resident"] = db.StatusResident |
| | | communityIDs, err := db.GetCommunityIDs() |
| | | fmt.Println("communityIDs:", communityIDs) |
| | | if err != nil { |
| | |
| | | //业务逻辑 |
| | | } |
| | | fmt.Println("社区档案总条数:", len(documentNumberIDS)) |
| | | |
| | | captureInfos := make([]db.CaptureInfo, 0) |
| | | batchSize := config.Elastic.BatchSize |
| | | //fmt.Println(batchSize) |
| | |
| | | |
| | | //continue |
| | | |
| | | postCaptureInfos := data.ProcessData(captureInfos, personStatusList, ruleInfo, communityID) |
| | | postCaptureInfos := data.ProcessData(captureInfos, personStatusList, ruleInfo, statusNo, communityID) |
| | | for _, inf := range postCaptureInfos { |
| | | fmt.Println("---->pause prepare: capture ", inf.DocumentNumber, inf.Status, inf.FrequentAddress) |
| | | //return |