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
3f571899
Commit
3f571899
authored
Dec 14, 2021
by
rico.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update add col source_p_params
parent
033446a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
zgcindex_sync_excel2ob.py
数据治理平台线下处理/线下建库/zgcindex_sync_excel2ob.py
+16
-2
No files found.
数据治理平台线下处理/线下建库/zgcindex_sync_excel2ob.py
View file @
3f571899
...
...
@@ -8,12 +8,13 @@ Created on Mon Nov 22 22:38:22 2021
from
db
import
MYSQL
,
MSSQL
import
pandas
as
pd
#from ES import ES_Client
path
=
"/Users/rico/Downloads/
(已确认)2021-12-09 14_44_30-自贡
数据.xlsx"
path
=
"/Users/rico/Downloads/
洗衣机已确认
数据.xlsx"
df
=
pd
.
read_excel
(
path
,
converters
=
{
'FINISH_P_SKU'
:
str
})
export_df
=
df
[[
'DOC_ID'
,
'DATA_BATCH'
,
'DATA_END_TIME'
,
'FLOW_NODE_STATUS'
,
'SOURCE_P_SKU'
,
'SOURCE_CHANNEL_NAME'
,
'SOURCE_CHANNEL_SNAME'
,
'SOURCE_P_NAME'
,
'SOURCE_P_LASTCATEGORY_NAME'
,
'SOURCE_P_BRAND_NAME'
,
'SOURCE_P_PRICE'
,
'SOURCE_P_URL'
,
'FINISH_P_REMARK'
,
'FINISH_P_BRAND_NAME'
,
'FINISH_P_BRAND_CODE'
,
'FINISH_P_LASTCATEGORY_NAME'
,
'SOURCE_P_LASTCATEGORY_NAME'
,
'SOURCE_P_BRAND_NAME'
,
'SOURCE_P_P
ARAMS'
,
'SOURCE_P_P
RICE'
,
'SOURCE_P_URL'
,
'FINISH_P_REMARK'
,
'FINISH_P_BRAND_NAME'
,
'FINISH_P_BRAND_CODE'
,
'FINISH_P_LASTCATEGORY_NAME'
,
'FINISH_P_LASTCATEGORY_CODE'
,
'FINISH_P_MODEL'
,
'FINISH_P_SKU'
,
'FINISH_P_PARAMS'
,
'FINISH_P_NAME'
,
'FINISH_P_STATUS'
,
'FINISH_P_CHECK_STATUS'
]]
...
...
@@ -66,6 +67,18 @@ for index,row in temp_df.iterrows():
cursor.execute(f"update DW_PRODUCT_ALL_RES set FINISH_P_SKU = '{sku}' where DOC_ID = '{doc_id}'")
host = "http://172.17.148.67:9200/"#生产内网地址环境
index_name = "model_params_test"
es = ES_Client(host,index_name)
df = es.SearchAll()
for index,row in df.iterrows():
print(index)
doc_id = row['DOC_ID']
SOURCE_P_PARAMS = str(row['SOURCE_P_PARAMS']).replace("'","''")
cursor.execute(f"update DW_PRODUCT_ALL_RES set SOURCE_P_PARAMS = '{SOURCE_P_PARAMS}' 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