Commit 859e6408 authored by rico.liu's avatar rico.liu

update

parent b8963ef7
...@@ -245,7 +245,7 @@ for category in category_list: ...@@ -245,7 +245,7 @@ for category in category_list:
'''
mssql_index = MSSQL('123.56.115.207','ZI_DataBase') mssql_index = MSSQL('123.56.115.207','ZI_DataBase')
cursor_zdindex = mssql_index._cur cursor_zdindex = mssql_index._cur
...@@ -263,7 +263,7 @@ for _id,sku in zip(doc_id_list,sku_list): ...@@ -263,7 +263,7 @@ for _id,sku in zip(doc_id_list,sku_list):
price = "0.0" price = "0.0"
cursor.execute(f"update DW_PRODUCT_ALL_RES set FINISH_P_PRICE = '{price}' where DOC_ID = {_id}") cursor.execute(f"update DW_PRODUCT_ALL_RES set FINISH_P_PRICE = '{price}' where DOC_ID = {_id}")
'''
#组织SKU对应关系数据(暂未完成) #组织SKU对应关系数据(暂未完成)
sku_list = [] sku_list = []
...@@ -354,6 +354,7 @@ for i in range(for_count): ...@@ -354,6 +354,7 @@ for i in range(for_count):
df['SOURCE_P_PIC'] = pic_list df['SOURCE_P_PIC'] = pic_list
''' '''
'''
##图片上传服务器 ##图片上传服务器
if not os.path.exists(f"/mythjob/pic/{batch}"): if not os.path.exists(f"/mythjob/pic/{batch}"):
os.mkdir(f"/mythjob/pic/{batch}") os.mkdir(f"/mythjob/pic/{batch}")
...@@ -361,6 +362,7 @@ if not os.path.exists(f"/mythjob/pic/{batch}"): ...@@ -361,6 +362,7 @@ if not os.path.exists(f"/mythjob/pic/{batch}"):
upload_local_path = f"/mythjob/pic/{batch}/" upload_local_path = f"/mythjob/pic/{batch}/"
'''
''' '''
uploda_target_path = f"G:\\pic\\n\\{batch}\\" uploda_target_path = f"G:\\pic\\n\\{batch}\\"
...@@ -368,7 +370,7 @@ transport = paramiko.Transport(('123.56.115.207',22)) ...@@ -368,7 +370,7 @@ transport = paramiko.Transport(('123.56.115.207',22))
transport.connect(username='root',password='123456') transport.connect(username='root',password='123456')
sftp = paramiko.SFTPClient.from_transport(transport) sftp = paramiko.SFTPClient.from_transport(transport)
''' '''
'''
#oss = OSS('LTAI5tHR33mAN4vqoUPsW9H4','iBoR3O23lFAtwwq5kxdlE6QGKLCrAS','https://oss.zgcindex.com/','zgcpic') #oss = OSS('LTAI5tHR33mAN4vqoUPsW9H4','iBoR3O23lFAtwwq5kxdlE6QGKLCrAS','https://oss.zgcindex.com/','zgcpic')
auth = oss2.Auth('LTAI5tHR33mAN4vqoUPsW9H4','iBoR3O23lFAtwwq5kxdlE6QGKLCrAS') auth = oss2.Auth('LTAI5tHR33mAN4vqoUPsW9H4','iBoR3O23lFAtwwq5kxdlE6QGKLCrAS')
bucket = oss2.Bucket(auth,'http://oss-cn-beijing.aliyuncs.com','zgcpic') bucket = oss2.Bucket(auth,'http://oss-cn-beijing.aliyuncs.com','zgcpic')
...@@ -427,4 +429,5 @@ for path in saved_path_list: ...@@ -427,4 +429,5 @@ for path in saved_path_list:
cursor_zi_new.execute(f"insert into p_skupic (skuid,path) values ({skuid},'{path}')") cursor_zi_new.execute(f"insert into p_skupic (skuid,path) values ({skuid},'{path}')")
mssql_new.Close() mssql_new.Close()
print("图片数据位置信息存储至数据库") print("图片数据位置信息存储至数据库")
'''
\ No newline at end of file
...@@ -41,4 +41,16 @@ try: ...@@ -41,4 +41,16 @@ try:
except Exception as e: except Exception as e:
print('>>> 插入数据失败', e) print('>>> 插入数据失败', e)
'''
df= pd.read_excel("/Users/rico/WorkSpace/1_Project/Company/中电中采/TEMP Workspace/ES处理相关/ES线下补参处理/安徽三大类结果1119(1).xlsx")
for index,row in df.iterrows():
doc_id = row['DOC_ID']
name = row['SOURCE_P_LASTCATEGORY_NAME']
brand = row['SOURCE_P_BRAND_NAME']
cursor.execute(f"update DW_PRODUCT_ALL_RES set SOURCE_P_LASTCATEGORY_NAME = '{name}', SOURCE_P_BRAND_NAME = '{brand}' where DOC_ID = '{doc_id}'")
'''
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment