| | |
| | | //logger.Debugf("task %s last result %d", m.Task.Name, len(lastFilter)) |
| | | document_number_list = []string{} |
| | | for _, i := range keyFilter { |
| | | logger.Debugf("keyFilter %s ------------- %s", i.Id, i.PersonType) |
| | | //logger.Debugf("keyFilter %s ------------- %s", i.Id, i.PersonType) |
| | | document_number_list = append(document_number_list, i.Id) |
| | | person := document_number_map[i.Id] |
| | | person.PersonType = i.PersonType |
| | |
| | | results = append(results, result) |
| | | } |
| | | logger.Debugf("task %s last filter result %d", m.Task.Name, len(results)) |
| | | return service.SaveTaskResults(results) |
| | | return service.SaveLocationTaskResults(results) |
| | | } |
| | | |
| | | func (m *LocationModel) KeepAlive() error { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | "pic_date": map[string]interface{}{ // 新增按 documentNumber 聚合 |
| | | "terms": map[string]interface{}{ |
| | | "field": "picDate", |
| | | "size": 10000, |
| | | }, |
| | | }, |
| | | "document_numbers": map[string]interface{}{ // 新增按 documentNumber 聚合 |
| | | "terms": map[string]interface{}{ |
| | | "field": "documentNumber", |
| | |
| | | persons = append(persons, docNumBucket.(map[string]interface{})["key"].(string)) |
| | | } |
| | | } |
| | | |
| | | var PicDate string |
| | | if docNumBuckets, ok := floorBucket.(map[string]interface{})["pic_data"].(map[string]interface{})["buckets"].([]interface{}); ok { |
| | | for _, docNumBucket := range docNumBuckets { |
| | | PicDate = docNumBucket.(map[string]interface{})["key"].(string) |
| | | } |
| | | } |
| | | logger.Debugf("floor, persons--,appearCount------------------------------------- %s-- %s --", floor, persons, appearCount) |
| | | record := &LocationRecord{ |
| | | //PicDate: timestamp, |
| | | PicDate: PicDate, |
| | | DocumentNumbers: persons, |
| | | CommunityId: communityId, |
| | | Building: building, |