客户资料启用智能助手
This commit is contained in:
@@ -66,6 +66,7 @@ import os
|
||||
import sys
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
import time
|
||||
import numpy as np
|
||||
|
||||
# 添加父目录到Python路径,以便导入项目模块
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
@@ -616,6 +617,17 @@ class UpdateAllNGVDataDaily:
|
||||
org_code = idx
|
||||
data_dict[self.ORG_CODE_WIDGET_ID] = {"value": org_code}
|
||||
|
||||
# 新增:仅创建内容非全空的记录
|
||||
# 检查除了门店编码外,其他字段是否全为空
|
||||
all_empty = True
|
||||
for k, v in data_dict.items():
|
||||
if k != self.ORG_CODE_WIDGET_ID and v.get('value') not in (None, '', float('nan')):
|
||||
all_empty = False
|
||||
break
|
||||
if all_empty:
|
||||
logger.info(f" - 跳过内容全空的新建记录 org_code: {idx}")
|
||||
continue
|
||||
|
||||
create_data_list.append({
|
||||
'org_code': idx,
|
||||
'data_dict': data_dict,
|
||||
@@ -782,7 +794,9 @@ class UpdateAllNGVDataDaily:
|
||||
create_data = {
|
||||
'api_key': Config.SaaS_Tasks_APP_ID,
|
||||
'entry_id': Config.NGV_TASKS_ENTRY_ID,
|
||||
'data': item['data_dict']
|
||||
'data': item['data_dict'],
|
||||
'is_start_trigger':'true',
|
||||
|
||||
}
|
||||
api_instance.data_batch_create(data=create_data, max_retries=20)
|
||||
success_count += 1
|
||||
|
||||
Reference in New Issue
Block a user