宜搭api修复head中的json.json 问题

This commit is contained in:
z66
2025-12-03 10:09:28 +08:00
parent 502b3d4e4e
commit e8bd579fe8
4 changed files with 34 additions and 17 deletions
+10
View File
@@ -15,3 +15,13 @@
2025-11-18 09:17:05,912 - update_BI_CRM_info.py - error_task_logger - ERROR - 任务简道云海外项目CRM客户档案迁移BI执行失败。 2025-11-18 09:17:05,912 - update_BI_CRM_info.py - error_task_logger - ERROR - 任务简道云海外项目CRM客户档案迁移BI执行失败。
2025-11-27 09:08:41,105 - common_module.py - error_task_logger - ERROR - 获取借车宝NGV明细时出错: Length mismatch: Expected axis has 0 elements, new values have 16 elements 2025-11-27 09:08:41,105 - common_module.py - error_task_logger - ERROR - 获取借车宝NGV明细时出错: Length mismatch: Expected axis has 0 elements, new values have 16 elements
2025-11-27 09:08:41,278 - JCB_efficient_car_pickup.py - error_task_logger - ERROR - 接车宝日常派发执行出错:获取接车宝数据失败,返回None 2025-11-27 09:08:41,278 - JCB_efficient_car_pickup.py - error_task_logger - ERROR - 接车宝日常派发执行出错:获取接车宝数据失败,返回None
2025-12-03 09:35:35,923 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:37:19,719 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:38:02,309 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:39:56,925 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:41:22,721 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:42:57,097 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:45:13,572 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:50:07,647 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:51:28,042 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
2025-12-03 09:55:47,222 - update_molecule_reporting_adjustment_to_bi.py - error_task_logger - ERROR - 任务执行失败: unsupported operand type(s) for //: 'NoneType' and 'int'
@@ -680,6 +680,7 @@ class NewServicesRevisit:
except Exception as e: except Exception as e:
error_task_logger.error(f"不开单识别:Error finding customer service: {e}") error_task_logger.error(f"不开单识别:Error finding customer service: {e}")
common_module.send_task_error(task_start_time, "手动添加日常回访-不开单识别", str(e)) common_module.send_task_error(task_start_time, "手动添加日常回访-不开单识别", str(e))
# 保单识别:从系统中抽取目标门店,针对门店抽取修改是否推荐 # 保单识别:从系统中抽取目标门店,针对门店抽取修改是否推荐
try: try:
if row["org_code"] in self.widget_list: if row["org_code"] in self.widget_list:
@@ -22,10 +22,7 @@ api_instance = API()
common_module = CommonModule() common_module = CommonModule()
# 配置常量
FORMID = "FORM-VJ866081CVI9E7ALB7WOO7BHPPQW25R99AWFL0" # 分子报备调整
appType = "APP_UYZ0KG6L0CCNV80GZ66O" # F6客户服务
systemToken = "XA966F81JAJOFCVVVKO64E9MIIZV1EWE5SFMKJ2" # 密钥
# 数据库配置 # 数据库配置
DB_CONFIG = Config.HS_DB_Config DB_CONFIG = Config.HS_DB_Config
@@ -64,8 +61,17 @@ class MoleculeReportingAdjustment:
def get_yida_data(self): def get_yida_data(self):
# 获取分母报备数据 # 获取分母报备数据
TOKEN = yd_api_instance.generateToken() TOKEN = yd_api_instance.generateToken()
# 配置常量
FORMID = "FORM-VJ866081CVI9E7ALB7WOO7BHPPQW25R99AWFL0" # 分子报备调整
appType = "APP_UYZ0KG6L0CCNV80GZ66O" # F6客户服务
systemToken = "XA966F81JAJOFCVVVKO64E9MIIZV1EWE5SFMKJ2" # 密钥
print(TOKEN)
molecule_data = yd_api_instance.read_processes(token=TOKEN, formUuid=FORMID, page=1, n=100, molecule_data = yd_api_instance.read_processes(token=TOKEN, formUuid=FORMID, page=1, n=100,
appType=appType, systemToken=systemToken) appType=appType, systemToken=systemToken)
if not molecule_data.get("data"):
print("没有数据")
self.molecule_data_list = [] self.molecule_data_list = []
PAGES_two = molecule_data.get('totalCount') // 100 + 1 PAGES_two = molecule_data.get('totalCount') // 100 + 1
for a in range(1, PAGES_two + 1): for a in range(1, PAGES_two + 1):
@@ -162,7 +168,7 @@ class MoleculeReportingAdjustment:
except Exception as e: except Exception as e:
error_task_logger.error(f"写入数据时发生错误: {e}") error_task_logger.error(f"写入数据时发生错误: {e}")
task_start_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") task_start_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
common_module.send_task_error(task_start_time, "分母报备调整", str(e)) # common_module.send_task_error(task_start_time, "分母报备调整", str(e))
connection.rollback() connection.rollback()
finally: finally:
@@ -203,7 +209,7 @@ class MoleculeReportingAdjustment:
common_module.send_task_status(task_start_time, "分子报备调整") common_module.send_task_status(task_start_time, "分子报备调整")
except Exception as e: except Exception as e:
error_task_logger.error(f"任务执行失败: {e}") error_task_logger.error(f"任务执行失败: {e}")
common_module.send_task_error(task_start_time, "分子报备调整", str(e)) # common_module.send_task_error(task_start_time, "分子报备调整", str(e))
if __name__ == '__main__': if __name__ == '__main__':
+11 -11
View File
@@ -48,7 +48,7 @@ class YDAPI:
api = f'https://api.dingtalk.com//v1.0/yida/forms/instances' api = f'https://api.dingtalk.com//v1.0/yida/forms/instances'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
@@ -89,9 +89,9 @@ class YDAPI:
:return: :return:
""" """
attempt = 0 attempt = 0
api = f'https://api.dingtalk.com/v1.0/yida/processes/instancesInfos/{id}' api = f'https://api.dingtalk.com/v2.0/yida/processes/instancesInfos/{id}'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
formData = { formData = {
@@ -131,7 +131,7 @@ class YDAPI:
api = 'https://api.dingtalk.com/v1.0/yida/forms/instances/search' api = 'https://api.dingtalk.com/v1.0/yida/forms/instances/search'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
formData = { formData = {
@@ -188,7 +188,7 @@ class YDAPI:
attempt = 0 attempt = 0
api = f'https://api.dingtalk.com/v1.0/yida/processes/instances?pageNumber={page}&pageSize={n}' api = f'https://api.dingtalk.com/v1.0/yida/processes/instances?pageNumber={page}&pageSize={n}'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
formData = { formData = {
@@ -237,7 +237,7 @@ class YDAPI:
userId = "yida_pub_account" userId = "yida_pub_account"
api = f'https://api.dingtalk.com/v1.0/yida/processes/operationRecords?appType={appType}&systemToken={systemToken}&userId={userId}&language=zh_CN&processInstanceId={processInstanceId}' api = f'https://api.dingtalk.com/v1.0/yida/processes/operationRecords?appType={appType}&systemToken={systemToken}&userId={userId}&language=zh_CN&processInstanceId={processInstanceId}'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
@@ -275,7 +275,7 @@ class YDAPI:
userId = "yida_pub_account" userId = "yida_pub_account"
api = f'https://api.dingtalk.com/v1.0/yida/processes/{processID}definitions/designs?systemToken={systemToken}&userId={userId}&appType={appType}"x-acs-dingtalk-access-token": token' api = f'https://api.dingtalk.com/v1.0/yida/processes/{processID}definitions/designs?systemToken={systemToken}&userId={userId}&appType={appType}"x-acs-dingtalk-access-token": token'
headers = { headers = {
# "Content-Type": "application/json.json", # "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
@@ -327,7 +327,7 @@ class YDAPI:
""" """
api = 'https://api.dingtalk.com/v1.0/yida/tasks/execute' api = 'https://api.dingtalk.com/v1.0/yida/tasks/execute'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
payload = { payload = {
@@ -362,7 +362,7 @@ class YDAPI:
api = f'https://api.dingtalk.com//v1.0/yida/tasks/redirect' api = f'https://api.dingtalk.com//v1.0/yida/tasks/redirect'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
payload = { payload = {
@@ -393,7 +393,7 @@ class YDAPI:
api = f'https://api.dingtalk.com///v1.0/yida/forms/instances?appType=APP_UYZ0KG6L0CCNV80GZ66O&systemToken=XA966F81JAJOFCVVVKO64E9MIIZV1EWE5SFMKJ2&userId=2268275546837446&language=zh_CN&formInstanceId=' + id api = f'https://api.dingtalk.com///v1.0/yida/forms/instances?appType=APP_UYZ0KG6L0CCNV80GZ66O&systemToken=XA966F81JAJOFCVVVKO64E9MIIZV1EWE5SFMKJ2&userId=2268275546837446&language=zh_CN&formInstanceId=' + id
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
@@ -420,7 +420,7 @@ class YDAPI:
api = f'https://api.dingtalk.com/v1.0/yida/forms/formFields' api = f'https://api.dingtalk.com/v1.0/yida/forms/formFields'
headers = { headers = {
"Content-Type": "application/json.json", "Content-Type": "application/json",
"x-acs-dingtalk-access-token": token "x-acs-dingtalk-access-token": token
} }
retries = 0 retries = 0