From 9854ef071f70a215239933e74bf48539609e9647 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期二, 11 二月 2025 11:10:57 +0800
Subject: [PATCH] 预警添加orgid
---
.gitignore | 2 +-
models/accessRegularity.go | 14 +++++++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
index 460ccad..9f8e32f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,6 @@
go.sum
.so
logs
-model-engine
+model-engine*
vendor
*.lock
\ No newline at end of file
diff --git a/models/accessRegularity.go b/models/accessRegularity.go
index 26c021d..452ecf4 100644
--- a/models/accessRegularity.go
+++ b/models/accessRegularity.go
@@ -106,11 +106,14 @@
// 鏌ユ壘鎸囧畾鏃堕棿鑼冨洿鍐呭嚭琛岃繃鐨勬。妗堢紪鍙�
now := time.Now()
startDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()).AddDate(0, 0, -m.Duration)
+ endDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
+
err := db.GetDB().Raw(`
SELECT
document_number,
frequent_address,
- community_id
+ community_id,
+ org_id
FROM
snapshot_count_summary
WHERE
@@ -125,10 +128,11 @@
logger.Debugf("task %s base filter result %d", m.Task.Name, len(baseFilter))
esCli := db.GetEsClient()
+ // 璋冪敤es鍒嗘瀽姝や汉鐨勫嚭琛岃寰嬫槸鍚︾鍚堟潯浠讹紝 杩斿洖绗﹀悎鏉′欢鐨勬鏁板拰鏈�鍚庝竴娆$鍚堟潯浠剁殑鏃堕棿
+ sTime := startDate.Format(time.DateTime)
+ eTime := endDate.Format(time.DateTime)
+
for _, p := range baseFilter {
- // 璋冪敤es鍒嗘瀽姝や汉鐨勫嚭琛岃寰嬫槸鍚︾鍚堟潯浠讹紝 杩斿洖绗﹀悎鏉′欢鐨勬鏁板拰鏈�鍚庝竴娆$鍚堟潯浠剁殑鏃堕棿
- sTime := startDate.Format(time.DateTime)
- eTime := time.Now().Format(time.DateTime)
captures, err := service.QueryEsRecord(esCli, sTime, eTime, nil, []interface{}{p.CommunityId}, []string{p.DocumentNumber})
//logger.Debugf("task %s person %s captures %d", m.Task.Name, p.DocumentNumber, len(captures))
@@ -170,7 +174,7 @@
func (m *RegularityModel) Shutdown() error {
// 娓呯悊璧勬簮
- fmt.Println("Shutting down LocationModel Model")
+ fmt.Println("Shutting down accessRegularityS Model")
return nil
}
--
Gitblit v1.8.0