Commit ce1ef0fc authored by zhou's avatar zhou

添加了跳过跳过页面操作上传功能。

parent b50e64e5
...@@ -1083,6 +1083,50 @@ class crawl_data_fetch(): ...@@ -1083,6 +1083,50 @@ class crawl_data_fetch():
return data_table return data_table
except ValueError: except ValueError:
return False return False
import re
def page_change_state(aim_source, aim_batch):
'''
输入为当前的批次和来源,运行后可以把该批次来源所有产品在product_api_data状态跟新为2,product_parameter_progress状态按照优先级更新为4。
'''
sql_ZIdatabase = sql_find('ZI_DataBase', False)
sql_ZIdatabase.cursor.execute(f"update Product_Api_Data set state = '4' where [source] = '{aim_source}' AND [batch] = '{aim_batch}'")
print("产品表状态已经更新完毕!")
sql_ZIdatabase.cursor.execute(
f"SELECT MIN\
( p2.id ) AS id\
FROM\
(\
SELECT\
CASE\
p1.paramSource \
WHEN '原始参数项' THEN\
0 \
WHEN '模型参数项' THEN\
1 ELSE 999 \
END AS paramSourceIndex,\
p1.* \
FROM\
Product_Parameter_Process p1 \
WHERE\
[source] = '{aim_source}' \
AND [batch] = '{aim_batch}' \
) p2 \
GROUP BY\
p2.batch,\
p2.productId,\
p2.source,\
p2.param"
)
change_params = sql_ZIdatabase.cursor.fetchall()
change_params_new = [re.findall(r'\d+', str(i))[0] for i in change_params]
n = len(change_params_new)
m = 0
for id_num in change_params_new:
sql_ZIdatabase.cursor.execute(f"update Product_Parameter_Process set state = '2' where id = '{id_num}'")
m+=1
print(f'当前参数更新进度:{m}/{n}',end = '\r')
print("参数表状态已经更新完毕!")
def crawl_data_run(): def crawl_data_run():
os.chdir(r'/root/program/newProductCheck/online_progrom/code/API_data') os.chdir(r'/root/program/newProductCheck/online_progrom/code/API_data')
......
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