Commit f2887063 authored by rico.liu's avatar rico.liu

update

parent 61e2445b
......@@ -206,15 +206,27 @@ def SkuMatch(df,channel_alias,engine):
zi_subcategoryname = df_his['zi_subcategoryname'].tolist()[0].replace("'","''")
zi_subcategorycode = df_his['zi_subcategorycode'].tolist()[0].replace("'","''")
model = df_his['model'].tolist()[0]
remark = df_his['remark'].tolist()[0]
try:
params_standard = df_his['params_standard'].tolist()[0].replace("'","''")
print(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',params_standard = '{params_standard}',state = '8' where id = {id_}")
cursor_zi_service.execute(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',params_standard = '{params_standard}',remark='{remark}',state = '8' where id = {id_}")
except:
print(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',state = '8' where id = {id_}")
cursor_zi_service.execute(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',remark='{remark}',state = '8' where id = {id_}")
remark = str(df_his['remark'].tolist()[0])
if remark == 'None':
try:
params_standard = df_his['params_standard'].tolist()[0].replace("'","''")
print(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',params_standard = '{params_standard}',state = '8' where id = {id_}")
cursor_zi_service.execute(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',params_standard = '{params_standard}',remark=Null,state = '8' where id = {id_}")
except:
print(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',state = '8' where id = {id_}")
cursor_zi_service.execute(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',remark=Null,state = '8' where id = {id_}")
else:
try:
params_standard = df_his['params_standard'].tolist()[0].replace("'","''")
print(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',params_standard = '{params_standard}',state = '8' where id = {id_}")
cursor_zi_service.execute(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',params_standard = '{params_standard}',remark='{remark}',state = '8' where id = {id_}")
except:
print(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',state = '8' where id = {id_}")
cursor_zi_service.execute(f"update product_all set zi_brandname = '{zi_brandname}',zi_brandcode = '{zi_brandcode}',zi_subcategoryname = '{zi_subcategoryname}',zi_subcategorycode = '{zi_subcategorycode}',model = '{model}',remark='{remark}',state = '8' where id = {id_}")
else:
code = res_dict[sku]
......@@ -1357,7 +1369,7 @@ def create_to_db(path,std_value_dict):
spuid_list = list()
for index,row in df.iterrows():
if (row['remark'] != 'nan' and row['remark'] != 'None') or (row['productcode'] != 'nan' and row['productcode'] != 'None'):
if (row['remark'] != 'nan' and row['remark'] != 'None' and row['remark'] != '未匹配上产品') or (row['productcode'] != 'nan' and row['productcode'] != 'None'):
new_name_list.append(" ")
continue
......@@ -1512,7 +1524,7 @@ def create_to_db(path,std_value_dict):
df['new_name'] = new_name_list
for index,row in df.iterrows():
if row['remark'] != 'nan' and row['remark'] != 'None':#驳回数据
if row['remark'] != 'nan' and row['remark'] != 'None' and row['remark'] != '未匹配上产品':#驳回数据
new_product_flag_list.append('0')
new_name_update = row['new_name'].replace("'","\'")
#print(1,f"update product_all set state = '2',new_name = '{new_name_update}',remark = '{row['remark']}' where id = {row['id']}")
......@@ -2027,7 +2039,7 @@ def update_non_point_to_db(path,mode):
counter += 1
except:
print(index_(counter,1), end='%')
if remark == 'nan' or remark == 'null':
if remark == 'nan' or remark == 'null' or remark == '未匹配上产品':
if matchcode == 'nan':
newname = str(newname).replace("'","''")
brand = str(brand).replace("'","''")
......@@ -2065,7 +2077,7 @@ def update_non_point_to_db(path,mode):
counter += 1
except:
print(index_(counter,1), end='%')
if remark == 'nan' or remark == 'null':
if remark == 'nan' or remark == 'null' or remark == '未匹配上产品':
if matchcode == 'nan':
newname = str(newname).replace("'","''")
brand = str(brand).replace("'","''")
......
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