| | |
| | | Location: fmt.Sprintf("%s%s%s", domains[record.CommunityId].Name, record.Building, record.Floor), |
| | | Building: record.Building, |
| | | Floor: record.Floor, |
| | | //PicDate: time.Unix(lastAppearanceTime, 0).Format("2006-01-02 15:04:05"), |
| | | //PicDate: time.Unix(int64(record.PicDate/1000), 0).Format("2006-01-02 15:04:05"), |
| | | PicDate: record.PicDate, |
| | | FirstPersonID: record.DocumentNumbers[0], |
| | | } |
| | |
| | | if floorBuckets, ok := locationBucket.(map[string]interface{})["floor"].(map[string]interface{})["buckets"].([]interface{}); ok { |
| | | for _, floorBucket := range floorBuckets { |
| | | floor := floorBucket.(map[string]interface{})["key"].(string) |
| | | logger.Debugf("floor--------------------------------------- %s -----%s ", floor, floorBucket) |
| | | //logger.Debugf("floor--------------------------------------- %s -----%s ", floor, floorBucket) |
| | | appearCount := floorBucket.(map[string]interface{})["doc_count"].(float64) |
| | | //logger.Debugf("appearCount--------------------------------------- %s- --", appearCount) |
| | | // 构建 LocationRecord 结构体 |
| | |
| | | var PicDate string |
| | | if docNumBuckets, ok := floorBucket.(map[string]interface{})["picDate"].(map[string]interface{})["buckets"].([]interface{}); ok { |
| | | for _, docNumBucket := range docNumBuckets { |
| | | PicDate = docNumBucket.(map[string]interface{})["key"].(string) |
| | | PicDate = docNumBucket.(map[string]interface{})["key_as_string"].(string) |
| | | } |
| | | } |
| | | logger.Debugf("floor, persons--,appearCount------------------------------------- %s-- %s --", floor, persons, appearCount) |