From 02f9af857c72559323ada1edd27a0af6be3c038b Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期六, 08 二月 2025 18:59:14 +0800 Subject: [PATCH] 测试 场景分析 bug --- models/locationAnalysis.go | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/models/locationAnalysis.go b/models/locationAnalysis.go index 0b67dd5..1bd1828 100644 --- a/models/locationAnalysis.go +++ b/models/locationAnalysis.go @@ -220,10 +220,12 @@ person.PersonType = i.PersonType document_number_map[i.DocumentNumber] = person } + logger.Debugf("document_number_list %s last result %s", m.Task.Name, document_number_list) records, err := queryEsLocation(db.GetEsClient(), m, document_number_list) if err != nil { return err } + logger.Debugf("records %s last result %s", m.Task.Name, records) domains, err := domainToLocation(records) if err != nil { return err @@ -344,8 +346,8 @@ filters = append(filters, map[string]interface{}{ "range": map[string]interface{}{ "picDate": map[string]interface{}{ - "gte": start.Format(time.RFC3339), - "lte": end.Format(time.RFC3339), + "gte": start.Format("2006-01-02 15:04:05"), + "lte": end.Format("2006-01-02 15:04:05"), }, }, }) @@ -446,17 +448,17 @@ if orgBuckets, ok := aggs["orgs"].(map[string]interface{})["buckets"].([]interface{}); ok { for _, orgBucket := range orgBuckets { orgId := orgBucket.(map[string]interface{})["key"].(string) - + logger.Debugf("orgId--------------------------------------- %s", orgId) // 瑙f瀽鎸塩ommunityId鐨勮仛鍚堢粨鏋� if communityBuckets, ok := orgBucket.(map[string]interface{})["community"].(map[string]interface{})["buckets"].([]interface{}); ok { for _, communityBucket := range communityBuckets { communityId := communityBucket.(map[string]interface{})["key"].(string) - + logger.Debugf("communityId--------------------------------------- %s", communityId) // 瑙f瀽鎸塨uilding鐨勮仛鍚堢粨鏋� if locationBuckets, ok := communityBucket.(map[string]interface{})["location"].(map[string]interface{})["buckets"].([]interface{}); ok { for _, locationBucket := range locationBuckets { building := locationBucket.(map[string]interface{})["key"].(string) - + logger.Debugf("building--------------------------------------- %s", building) // 瑙f瀽鎸塮loor鐨勮仛鍚堢粨鏋� if floorBuckets, ok := locationBucket.(map[string]interface{})["floor"].(map[string]interface{})["buckets"].([]interface{}); ok { for _, floorBucket := range floorBuckets { @@ -469,6 +471,8 @@ persons = append(persons, docNumBucket.(map[string]interface{})["key"].(string)) } } + + logger.Debugf("floor--------------------------------------- %s-- %s --", floor, appearCount) record := &LocationRecord{ //PicDate: timestamp, DocumentNumbers: persons, -- Gitblit v1.8.0