泰国新增2字段
This commit is contained in:
@@ -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})"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user