add workflow 天润Smart-ccc会话数据,dev
This commit is contained in:
parent
966d93bc03
commit
2eef41345f
|
@ -127,6 +127,8 @@ def request_detail_signature_get(id):
|
|||
resText = dataReqL.text
|
||||
i = i + 1
|
||||
resD=json.loads(resText)
|
||||
if i==5 and 'error' in resText:
|
||||
print(f'请求会话详情失败,异常信息:{resText['error']}')
|
||||
return resD
|
||||
|
||||
|
||||
|
@ -164,7 +166,7 @@ def load_detail_data_to_db(ids, dataList):
|
|||
|
||||
def load_detail_exp_to_db(id):
|
||||
try:
|
||||
print(f'添加查询工单异常记录:{id}')
|
||||
print(f'添加消息异常记录:{id}')
|
||||
conn = psycopg2.connect(database="dataops_db", user="dbuser_dops", password="MIgTi3jA",host="172.17.0.8", port="5432")
|
||||
print('数据库连接成功')
|
||||
dataId=str(uuid.uuid4())
|
||||
|
@ -175,9 +177,9 @@ def load_detail_exp_to_db(id):
|
|||
conn.commit()
|
||||
cur.close()
|
||||
conn.close()
|
||||
print(f'添加查询工单异常记录:{id} 结束')
|
||||
print(f'添加消息异常记录:{id} 结束')
|
||||
except Exception as e:
|
||||
print(f'添加查询工单异常记录:{id}失败, 错误信息:{e}')
|
||||
print(f'添加消息异常记录:{id}失败, 错误信息:{e}')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -240,6 +242,7 @@ if __name__ == "__main__":
|
|||
except Exception as e:
|
||||
print(f'请求会话详情(id:{id})异常, )异常信息:{e}')
|
||||
load_detail_exp_to_db(data['id'])
|
||||
print(f'{j}. exp end')
|
||||
print(f'实际加载{j}-{len(actList)}-{len(detailDataList)}条记录')
|
||||
load_data_to_db(actList)
|
||||
if len(ids) > 0:
|
||||
|
|
Loading…
Reference in New Issue