Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tool-code
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZGC_INDEX
tool-code
Commits
859e6408
Commit
859e6408
authored
Dec 06, 2021
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b8963ef7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
zgcindex_data2DB.py
数据治理平台线下处理/线下建库/zgcindex_data2DB.py
+7
-3
zgcindex_sync_excel2ob.py
数据治理平台线下处理/线下建库/zgcindex_sync_excel2ob.py
+13
-0
No files found.
数据治理平台线下处理/线下建库/zgcindex_data2DB.py
View file @
859e6408
...
@@ -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
数据治理平台线下处理/线下建库/zgcindex_sync_excel2ob.py
View file @
859e6408
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment