Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
重
重点类信息提取
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
重点类信息提取
Commits
cac7d04a
Commit
cac7d04a
authored
Apr 14, 2021
by
Jialin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into master
parents
c040d93d
7f773523
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
更新库内产品数据.py
公共代码/更新库内产品数据.py
+16
-1
No files found.
公共代码/更新库内产品数据.py
View file @
cac7d04a
...
@@ -82,6 +82,9 @@ def upload_params_data(category,path):
...
@@ -82,6 +82,9 @@ def upload_params_data(category,path):
#创建新产品库链接
#创建新产品库链接
conn_zi_new
=
pymssql
.
connect
(
host
=
'123.56.115.207'
,
user
=
'zgcprice3311'
,
password
=
'zgcprice20200628'
,
database
=
'ZI_NEW'
,
autocommit
=
True
)
conn_zi_new
=
pymssql
.
connect
(
host
=
'123.56.115.207'
,
user
=
'zgcprice3311'
,
password
=
'zgcprice20200628'
,
database
=
'ZI_NEW'
,
autocommit
=
True
)
cursor_zi_new
=
conn_zi_new
.
cursor
()
cursor_zi_new
=
conn_zi_new
.
cursor
()
conn_zdindex
=
pymssql
.
connect
(
host
=
'123.56.115.207'
,
user
=
'zgcprice3311'
,
password
=
'zgcprice20200628'
,
database
=
'zdindex'
,
autocommit
=
True
)
cursor_zdindex
=
conn_zdindex
.
cursor
()
##加载库中参数项数据(参数id,参数从属)
##加载库中参数项数据(参数id,参数从属)
cursor_zi_new
.
execute
(
f
"select * from vw_property where name = '{category}' and identy != '0000'"
)
cursor_zi_new
.
execute
(
f
"select * from vw_property where name = '{category}' and identy != '0000'"
)
...
@@ -295,8 +298,19 @@ def upload_params_data(category,path):
...
@@ -295,8 +298,19 @@ def upload_params_data(category,path):
try
:
try
:
cursor_zi_new
.
execute
(
f
"update p_sku set skuname = '{skuname}' where sku = '{sku}'"
)
cursor_zi_new
.
execute
(
f
"update p_sku set skuname = '{skuname}' where sku = '{sku}'"
)
except
:
except
:
skuname_double
=
skuname
+
'(重复)'
cursor_zi_new
.
execute
(
f
"select sku from p_sku where skuname = '{skuname}'"
)
correct_sku
=
cursor_zi_new
.
fetchone
()[
0
]
skuname_double
=
skuname
+
f
"(sku:'{sku}';重复sku:'{correct_sku}')"
cursor_zi_new
.
execute
(
f
"update p_sku set skuname = '{skuname_double}',state = '6' where sku = '{sku}'"
)
cursor_zi_new
.
execute
(
f
"update p_sku set skuname = '{skuname_double}',state = '6' where sku = '{sku}'"
)
#更新价格库数据
cursor_zdindex
.
execute
(
f
"select top 1 max(periods) from zd_entry_goods_price"
)
periods
=
cursor_zdindex
.
fetchone
()[
0
]
cursor_zdindex
.
execute
(
f
"update zd_entry_goods_price set goods_id = '{correct_sku}' where periods = '{periods}' and goods_id = '{sku}'"
)
cursor_zdindex
.
execute
(
f
"update zd_electricity_price set goods_id = '{correct_sku}' where periods = '{periods}' and goods_id = '{sku}'"
)
cursor_zdindex
.
execute
(
f
"update zd_purchase_price set goods_id = '{correct_sku}' where periods = '{periods}' and goods_id = '{sku}'"
)
#print(skuname)
#print(skuname)
...
@@ -393,6 +407,7 @@ def upload_params_data(category,path):
...
@@ -393,6 +407,7 @@ def upload_params_data(category,path):
cursor_zi_new
.
execute
(
f
"insert into p_valuemap (spuid,valueid) values ({spuid}, {valueid})"
)
cursor_zi_new
.
execute
(
f
"insert into p_valuemap (spuid,valueid) values ({spuid}, {valueid})"
)
conn_zi_new
.
close
()
conn_zi_new
.
close
()
conn_zdindex
.
close
()
print
(
f
"{category_name}参数数据更新完成,命名完成"
)
print
(
f
"{category_name}参数数据更新完成,命名完成"
)
...
...
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