泰国新增2字段

This commit is contained in:
z66
2025-09-10 15:08:57 +08:00
parent c24e5cfceb
commit a33518e078
5 changed files with 138 additions and 14 deletions
+2
View File
@@ -8,3 +8,5 @@
2025-08-21 09:38:43,196 - data_Support_Commission.py - error_task_logger - ERROR - 小六提成数据支撑任务执行出错:'Logger' object has no attribute 'warrning'
2025-08-21 09:38:43,333 - data_Support_Commission.py - error_task_logger - ERROR - 小六提成数据支撑任务执行出错:cannot access local variable 'data_commission' where it is not associated with a value
2025-08-21 09:54:25,836 - update_denominator_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 写入数据时发生错误: 1054 (42S22): Unknown column 'nan' in 'field list'
2025-09-05 14:57:31,453 - update_BI_CRM_info.py - error_task_logger - ERROR - 导入数据时发生错误: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end date, Contract start date, url) VALUES ('C-241113-001', 'Haikarnyang', '全' at line 1
2025-09-05 14:57:31,894 - update_BI_CRM_info.py - error_task_logger - ERROR - 任务简道云海外项目CRM客户档案迁移BI执行失败。
+31
View File
@@ -23881,3 +23881,34 @@
2025-09-02 10:46:58,318 - non_standar_performance_to_BI.py - task_logger - INFO - 成功写入 8 条记录到 non_standard_performance_to_BI 表中。
2025-09-02 10:46:58,318 - non_standar_performance_to_BI.py - task_logger - INFO - 数据已写入数据库中
2025-09-02 10:46:58,455 - common_module.py - task_logger - INFO - 任务状态发送成功: {'data': {'creator': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'updater': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'deleter': None, 'createTime': '2025-09-02T02:46:56.404Z', 'updateTime': '2025-09-02T02:46:56.404Z', 'deleteTime': None, '_widget_1744873387500': '2025-09-02T00:00:00.000Z', '_widget_1743644977694': '非标业绩提报转BI', '_widget_1744873387501': '2025-09-02T02:46:57.000Z', '_widget_1744873387502': '2025-09-02T02:46:58.000Z', '_widget_1744873387504': '1', '_id': '68b65aa06dab35b0f2ed18c8', 'appId': '6694d3c4fcb69ca9a111a6c4', 'entryId': '67ede908eb9c22261016466e'}}
2025-09-05 14:48:52,125 - update_BI_CRM_info.py - task_logger - INFO - 开始处理任务
2025-09-05 14:48:52,476 - api.py - task_logger - INFO - 已获取 100 条数据
2025-09-05 14:48:52,668 - api.py - task_logger - INFO - 已获取 106 条数据
2025-09-05 14:48:52,856 - update_BI_CRM_info.py - task_logger - INFO - 数据获取完成
2025-09-05 14:48:52,908 - update_BI_CRM_info.py - task_logger - INFO - 数据处理完成
2025-09-05 14:48:53,195 - update_BI_CRM_info.py - task_logger - INFO - 成功清空表 jiandaoyun_crm_customer_profile 中的所有数据
2025-09-05 14:48:53,209 - update_BI_CRM_info.py - task_logger - INFO - 表清空完成
2025-09-05 14:48:53,436 - update_BI_CRM_info.py - task_logger - INFO - 成功导入 106 条记录到 jiandaoyun_crm_customer_profile 表
2025-09-05 14:48:53,449 - update_BI_CRM_info.py - task_logger - INFO - 数据导入完成
2025-09-05 14:48:53,450 - update_BI_CRM_info.py - task_logger - INFO - 数据处理流程完成
2025-09-05 14:48:53,587 - common_module.py - task_logger - INFO - 任务状态发送成功: {'data': {'creator': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'updater': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'deleter': None, 'createTime': '2025-09-05T06:48:52.885Z', 'updateTime': '2025-09-05T06:48:52.885Z', 'deleteTime': None, '_widget_1744873387500': '2025-09-05T00:00:00.000Z', '_widget_1743644977694': '简道云海外项目CRM客户档案迁移BI', '_widget_1744873387501': '2025-09-05T06:48:52.000Z', '_widget_1744873387502': '2025-09-05T06:48:53.000Z', '_widget_1744873387504': '1', '_id': '68ba87d4eb7d4d55fdd01a55', 'appId': '6694d3c4fcb69ca9a111a6c4', 'entryId': '67ede908eb9c22261016466e'}}
2025-09-05 14:57:30,268 - update_BI_CRM_info.py - task_logger - INFO - 开始处理任务
2025-09-05 14:57:30,718 - api.py - task_logger - INFO - 已获取 100 条数据
2025-09-05 14:57:30,858 - api.py - task_logger - INFO - 已获取 106 条数据
2025-09-05 14:57:30,988 - update_BI_CRM_info.py - task_logger - INFO - 数据获取完成
2025-09-05 14:57:31,036 - update_BI_CRM_info.py - task_logger - INFO - 数据处理完成
2025-09-05 14:57:31,213 - update_BI_CRM_info.py - task_logger - INFO - 成功清空表 jiandaoyun_crm_customer_profile 中的所有数据
2025-09-05 14:57:31,228 - update_BI_CRM_info.py - task_logger - INFO - 表清空完成
2025-09-05 14:57:31,592 - common_module.py - task_logger - INFO - 任务错误发生成功: {'data': {'creator': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'updater': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'deleter': None, 'createTime': '2025-09-05T06:57:30.876Z', 'updateTime': '2025-09-05T06:57:30.876Z', 'deleteTime': None, '_widget_1744873387500': '2025-09-05T00:00:00.000Z', '_widget_1743644977694': '简道云海外项目CRM客户档案迁移BI', '_widget_1744873387501': '2025-09-05T06:57:31.000Z', '_widget_1744873387502': '2025-09-05T06:57:31.000Z', '_widget_1744873387504': '0', '_widget_1754981992215': "1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end date, Contract start date, url) VALUES ('C-241113-001', 'Haikarnyang', '全' at line 1", '_id': '68ba89da2bab90c02dac17ee', 'appId': '6694d3c4fcb69ca9a111a6c4', 'entryId': '689ae65da00c17578e27cd74'}}
2025-09-05 14:57:31,894 - common_module.py - task_logger - INFO - 任务错误发生成功: {'data': {'creator': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'updater': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'deleter': None, 'createTime': '2025-09-05T06:57:31.137Z', 'updateTime': '2025-09-05T06:57:31.137Z', 'deleteTime': None, '_widget_1744873387500': '2025-09-05T00:00:00.000Z', '_widget_1743644977694': '简道云海外项目CRM客户档案迁移BI', '_widget_1744873387501': '2025-09-05T06:57:30.000Z', '_widget_1744873387502': '2025-09-05T06:57:31.000Z', '_widget_1744873387504': '1', '_widget_1754981992215': "1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end date, Contract start date, url) VALUES ('C-241113-001', 'Haikarnyang', '全' at line 1", '_id': '68ba89db70ad231323675347', 'appId': '6694d3c4fcb69ca9a111a6c4', 'entryId': '689ae65da00c17578e27cd74'}}
2025-09-05 14:59:04,831 - update_BI_CRM_info.py - task_logger - INFO - 开始处理任务
2025-09-05 14:59:05,218 - api.py - task_logger - INFO - 已获取 100 条数据
2025-09-05 14:59:05,394 - api.py - task_logger - INFO - 已获取 106 条数据
2025-09-05 14:59:05,519 - update_BI_CRM_info.py - task_logger - INFO - 数据获取完成
2025-09-05 14:59:05,566 - update_BI_CRM_info.py - task_logger - INFO - 数据处理完成
2025-09-05 14:59:05,802 - update_BI_CRM_info.py - task_logger - INFO - 成功清空表 jiandaoyun_crm_customer_profile 中的所有数据
2025-09-05 14:59:05,818 - update_BI_CRM_info.py - task_logger - INFO - 表清空完成
2025-09-05 14:59:06,063 - update_BI_CRM_info.py - task_logger - INFO - 成功导入 106 条记录到 jiandaoyun_crm_customer_profile 表
2025-09-05 14:59:06,078 - update_BI_CRM_info.py - task_logger - INFO - 数据导入完成
2025-09-05 14:59:06,078 - update_BI_CRM_info.py - task_logger - INFO - 数据处理流程完成
2025-09-05 14:59:06,229 - common_module.py - task_logger - INFO - 任务状态发送成功: {'data': {'creator': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'updater': {'name': 'F6汽车科技', 'username': '#admin', 'status': 1, 'type': 0}, 'deleter': None, 'createTime': '2025-09-05T06:59:05.499Z', 'updateTime': '2025-09-05T06:59:05.499Z', 'deleteTime': None, '_widget_1744873387500': '2025-09-05T00:00:00.000Z', '_widget_1743644977694': '简道云海外项目CRM客户档案迁移BI', '_widget_1744873387501': '2025-09-05T06:59:04.000Z', '_widget_1744873387502': '2025-09-05T06:59:06.000Z', '_widget_1744873387504': '2', '_id': '68ba8a394e83b39f799f845c', 'appId': '6694d3c4fcb69ca9a111a6c4', 'entryId': '67ede908eb9c22261016466e'}}
@@ -50,8 +50,8 @@ class NewDealerServiceOrderToBI:
'不上货原因': '_widget_1742268351779', '是否培训系统使用': '_widget_1749717287367',
'不培训系统使用原因': '_widget_1749717287369', '是否补货': '_widget_1749717287373',
'不补货原因': '_widget_1749717287375',
'是否进行滞销回抽+盘点介绍': '_widget_1742200372561',
'不进行滞销回抽+盘点介绍原因': '_widget_1742268351780',
'是否进行滞销回抽盘点介绍': '_widget_1742200372561',
'不进行滞销回抽盘点介绍原因': '_widget_1742268351780',
'服务是否满意': '_widget_1743148999298', '服务不满意原因': '_widget_1743148999308',
'产品是否满意': '_widget_1743148999300', '产品不满意原因': '_widget_1743148999309',
# '上传评价图片': '_widget_1743148999310',
+7 -5
View File
@@ -111,6 +111,8 @@ class CRMDataProcessor:
'_widget_1709110881016': '银行账户',
"_widget_1749204198412": "原系统情况描述",
"_widget_1749632087678": "付款金额_泰铢",
"_widget_1756951762528": "Contract end date",
"_widget_1756951762527": "Contract start date",
'creator': '提交人',
'createTime': '提交时间',
'updateTime': '更新时间'
@@ -146,7 +148,9 @@ class CRMDataProcessor:
'_widget_1747123933310', # 客户签约日期
'_widget_1747123933311', # 客户付款日期
'_widget_0201002000007', # 领取时间
'_widget_0201002000008' # 最后跟进时间
'_widget_0201002000008', # 最后跟进时间
'_widget_1756951762528', # Contract end date
'_widget_1756951762527', # Contract start date
]
def connect_db(self):
@@ -302,8 +306,6 @@ class CRMDataProcessor:
# 处理空值 - 将NaN/NaT/空字符串统一转为None
df = df.map(lambda x: None if pd.isna(x) or str(x).strip() == '' else x)
# # 确保所有空值(包括NaN、None、空字符串)转为None
df = df.replace([np.nan, None, r'^\s*$'], None, regex=True)
# 检查表结构是否匹配
@@ -313,8 +315,8 @@ class CRMDataProcessor:
# 只保留表中存在的列
df = df[[col for col in df.columns if col in table_columns]]
# 生成插入语句
columns = ', '.join(df.columns)
# 修改这里:为所有列名添加反引号
columns = ', '.join([f'`{col}`' for col in df.columns]) # 添加反引号
placeholders = ', '.join(['%s'] * len(df.columns))
insert_query = f"INSERT INTO {table_name} ({columns}) VALUES ({placeholders})"