From bccc8d0a77d20b2a70db2610a7357226b02364c7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 7 Feb 2025 17:19:33 +0800 Subject: [PATCH] =?UTF-8?q?add=20workflow=20=E5=A4=A9=E6=B6=A6Smart-ccc?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=95=B0=E6=8D=AE,dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../获取客户资料列表/customer_list_feign.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/workflow/TK_Cust/smart_ccc_custom/获取客户资料列表/customer_list_feign.py b/dev/workflow/TK_Cust/smart_ccc_custom/获取客户资料列表/customer_list_feign.py index 2e206ee..36fbd5a 100644 --- a/dev/workflow/TK_Cust/smart_ccc_custom/获取客户资料列表/customer_list_feign.py +++ b/dev/workflow/TK_Cust/smart_ccc_custom/获取客户资料列表/customer_list_feign.py @@ -27,6 +27,8 @@ current_time_utc =( datetime.datetime.now() - datetime.timedelta(hours=8)).strft formatted2_current_date = current_date.strftime("%Y-%m-%d %H:%M:%S") # 获取当前日期 - 标准化 formatted2_previous_date = previous_date.strftime("%Y-%m-%d %H:%M:%S") # 获取前一天日期 - 标准化 + + def formatted2_previous_hour(h): if h==0: return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") @@ -73,12 +75,13 @@ def build_query_string(params): ) for k, v in sorted_params.items()) return query_string +current_end_time = previous_hour_timestamp(0) #计算签名,get请求 def request_list_signature_get(offset,pageSize): print('开始请求数据...') url='https://api-bj.clink.cn/crm/list_customers' - param={'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177','Timestamp':current_time_utc,'Expires':86400,'updateStartTime':previous_hour_timestamp(1),'updateEndTime':previous_hour_timestamp(0),'offset':offset,'limit':pageSize} + param={'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177','Timestamp':current_time_utc,'Expires':86400,'updateStartTime':previous_hour_timestamp(1),'updateEndTime':current_end_time,'offset':offset,'limit':pageSize} # param={'AccessKeyId':'b17759d3a36fba9a2cf522fbf4cbf177','Timestamp':current_time_utc,'Expires':86400,'updateStartTime':1704038400,'updateEndTime':previous_hour_timestamp(0)} print(f'param: {param}') url_path = build_query_string(param) @@ -188,6 +191,8 @@ if __name__ == "__main__": print(f'{formatted2_previous_hour(0)}开始请求客户资料信息') offset = 0 pageSize = 100 + current_end_time = previous_hour_timestamp(0) + resL = request_list_signature_get(offset,pageSize) print(resL) if 'error' in resL: