zhangzengfei
2025-02-11 9854ef071f70a215239933e74bf48539609e9647
预警添加orgid
2个文件已修改
16 ■■■■■ 已修改文件
.gitignore 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/accessRegularity.go 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -2,6 +2,6 @@
go.sum
.so
logs
model-engine
model-engine*
vendor
*.lock
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
}