Commit 3f571899 authored by rico.liu's avatar rico.liu

update add col source_p_params

parent 033446a2
...@@ -8,12 +8,13 @@ Created on Mon Nov 22 22:38:22 2021 ...@@ -8,12 +8,13 @@ Created on Mon Nov 22 22:38:22 2021
from db import MYSQL,MSSQL from db import MYSQL,MSSQL
import pandas as pd 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}) 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', 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_PARAMS','SOURCE_P_PRICE','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_LASTCATEGORY_CODE','FINISH_P_MODEL','FINISH_P_SKU','FINISH_P_PARAMS','FINISH_P_NAME','FINISH_P_STATUS',
'FINISH_P_CHECK_STATUS']] 'FINISH_P_CHECK_STATUS']]
...@@ -66,6 +67,18 @@ for index,row in temp_df.iterrows(): ...@@ -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}'") 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
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