履约表更新标注易捷

This commit is contained in:
z66
2025-10-29 13:36:00 +08:00
parent 68ae53c0ae
commit 73f6f54d35
3 changed files with 28 additions and 1 deletions
+18 -1
View File
@@ -21,6 +21,8 @@ class ImportPerformanceData:
"""
def __init__(self):
self.YijJaYangChe = None
self.company_id_to_yijie = None
self.staff_name_to_id = None
self.staff_id_list = None
self.performance_data_list = None
@@ -48,6 +50,17 @@ class ImportPerformanceData:
for item in self.staff_id_list
}
# 获取易捷养车公司id
payload = {"api_key": "675b900991ad2491c69389ca","entry_id":"69018b7a6ca883f48a54f36a"}
self.YijJaYangChe =api_instance.entry_data_list(payload).get("data",[])
# 公司id-是否易捷映射
self.company_id_to_yijie = {
str(item["_widget_1761708922279"]): item["_widget_1761708922281"]
for item in self.YijJaYangChe
if "_widget_1761708922279" in item and "_widget_1761708922281" in item
}
def process_data(self, df):
"""处理数据的主函数"""
new_df = self.convert_to_utc(df)
@@ -71,6 +84,10 @@ class ImportPerformanceData:
else:
row_dict[role] = None
# 新增:填充“是否易捷”字段
company_id = str(row_dict.get('公司id', ''))
row_dict['是否易捷'] = self.company_id_to_yijie.get(company_id, None) # 若无匹配则为 None
# 简道云字段替换
data_dict = self.row_to_dict(row_dict, self.field_mapping)
all_data.append(data_dict)
@@ -148,7 +165,7 @@ class ImportPerformanceData:
'业绩归属人员工ID': '_widget_1751350424109', '处理人是否跟进,0: 未跟进,1: 已跟进': '_widget_1751350424111',
'满意度评分': '_widget_1751350424112', '评价完成时间': '_widget_1751350424113',
'介绍人用户类型': '_widget_1751350424114', '培训完成时间': '_widget_1751350424116',
'订单所处阶段': '_widget_1751350424117', '日分区': '_widget_1751350424118',
'订单所处阶段': '_widget_1751350424117', '日分区': '_widget_1751350424118','是否易捷':"_widget_1761709806566",
}
def main(self):