From 73f6f54d35c543066154ce78544341633dc3840d Mon Sep 17 00:00:00 2001 From: z66 <1415243231@qq.com> Date: Wed, 29 Oct 2025 13:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=A5=E7=BA=A6=E8=A1=A8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A0=87=E6=B3=A8=E6=98=93=E6=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back_ground_module/import_performance_data.py | 19 ++++++++++++++++++- .../non_standar_performance_to_BI.py | 4 ++++ doc/更新记录.md | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/back_ground_module/import_performance_data.py b/back_ground_module/import_performance_data.py index a383689..d63c17d 100644 --- a/back_ground_module/import_performance_data.py +++ b/back_ground_module/import_performance_data.py @@ -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): diff --git a/back_ground_module/non_standar_performance_to_BI.py b/back_ground_module/non_standar_performance_to_BI.py index 686b91b..6d61cb1 100644 --- a/back_ground_module/non_standar_performance_to_BI.py +++ b/back_ground_module/non_standar_performance_to_BI.py @@ -64,6 +64,7 @@ class NonStandardPerformanceToBI: "报备业绩归属小六":"_widget_1753770875901", "原业绩归属大区":"_widget_1755159216098", "业绩分类":"_widget_1758706882564", + "流程是否结束":"_widget_1761633418013", "提交人": "creator", "提交时间": "createTime", "更新时间": "updateTime" @@ -122,6 +123,9 @@ class NonStandardPerformanceToBI: # 1.列明替换 df.columns = [reverse_mapping.get(col, col) for col in df.columns] + # 只保留流程是否结束为是的内容 + df = df[df["流程是否结束"] == "是"] + # 2.成员字段取值 user_columns = ["报备业绩归属小六", "报备业绩归属区域经理", "原业绩归属人", "原业绩归属区域经理", "运营专家"] diff --git a/doc/更新记录.md b/doc/更新记录.md index ba4c052..f30ca88 100644 --- a/doc/更新记录.md +++ b/doc/更新记录.md @@ -62,6 +62,12 @@ common_module 增加日期字段转UTC 方法,支持处理Timestamp输入与 异常回访新增过滤逻辑 +重构ngv每日更新,标记源数据是否已删除 + +海外邮件推送,更新大文件跳过处理 + +## 1.8更新 +