Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
ZHOUXINGYU_project
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
zhou
ZHOUXINGYU_project
Commits
ce1ef0fc
Commit
ce1ef0fc
authored
Mar 19, 2020
by
zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加了跳过跳过页面操作上传功能。
parent
b50e64e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
main_merge.py
main_merge.py
+44
-0
No files found.
main_merge.py
View file @
ce1ef0fc
...
...
@@ -1083,6 +1083,50 @@ class crawl_data_fetch():
return
data_table
except
ValueError
:
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
():
os
.
chdir
(
r'/root/program/newProductCheck/online_progrom/code/API_data'
)
...
...
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