Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
my-awesome-project
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5501c50f
authored
Oct 18, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add md
parent
a8a044f1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
2 deletions
add_supplier_brand.py
data.md
recover.py
release_pur.py
update_ladder.py
add_supplier_brand.py
View file @
5501c50f
import
pymysql
if
__name__
==
'__main__'
:
conf
=
{
'host'
:
"192.168.1.238"
,
'port'
:
3306
,
'user'
:
"europa_erp"
,
'password'
:
"europa_erp#zsyM"
,
'db'
:
"europa_erp"
,
'charset'
:
'utf8'
}
# sql = "select * from erp_goods where brand_id != 0"
db
=
pymysql
.
connect
(
**
conf
)
cursor
=
db
.
cursor
()
goods_id
=
0
while
True
:
pass
data.md
View file @
5501c50f
...
...
@@ -48,7 +48,7 @@ CREATE TABLE `lie_shipping_intermediate_data` (
-
shipping_name
-
shipment_number
-
shipping_id
-
lie_stock_in_items
-
lie_stock_in_items
update + insert
-
out_qty
-
in_qty
...
...
recover.py
View file @
5501c50f
This diff is collapsed.
Click to expand it.
release_pur.py
View file @
5501c50f
...
...
@@ -99,7 +99,7 @@ def pur():
"create_uid"
:
create_uid
,
# ok
"create_name"
:
create_name
,
# ok
"address_data"
:
[{
"source_id"
:
"end_cust_id_"
+
str
(
end_cust_id
),
#也是主键id
"source_id"
:
"end_cust_id_
en_
"
+
str
(
end_cust_id
),
#也是主键id
"source_code"
:
""
,
"address_type"
:
"终端地址"
,
"address"
:
com_addr
...
...
update_ladder.py
View file @
5501c50f
import
json
import
pymysql
if
__name__
==
'__main__'
:
conf
=
{
'host'
:
"192.168.1.238"
,
'port'
:
3306
,
'user'
:
"europa_erp"
,
'password'
:
"europa_erp#zsyM"
,
'db'
:
"europa_erp"
,
'charset'
:
'utf8'
}
# 117183438154202117
sku_id
=
0
# sql = "select * from erp_goods_sku where sku_id > %s order by sku_id limit 1000"
db
=
pymysql
.
connect
(
**
conf
)
cursor
=
db
.
cursor
()
while
True
:
sql
=
"select * from erp_goods_sku where sku_id >
%
s order by sku_id limit 1000"
cursor
.
execute
(
sql
,
[
str
(
sku_id
)])
result
=
cursor
.
fetchall
()
if
len
(
result
)
>
0
:
sku_id
=
result
[
-
1
][
0
]
for
row
in
result
:
flag
=
False
json_str
=
row
[
19
]
skuId
=
row
[
0
]
print
(
"old: ----->"
+
json_str
)
ans
=
json
.
loads
(
json_str
)
for
i
in
range
(
len
(
ans
)):
if
'purchase'
in
ans
[
i
]:
flag
=
True
break
if
'purchases'
in
ans
[
i
]:
break
if
flag
:
new_str
=
str
(
json_str
)
.
replace
(
"purchase"
,
"purchases"
)
print
(
"new str: ---->"
+
new_str
)
update_sql
=
"update erp_goods_sku set ladder_price =
%
s where sku_id =
%
s limit 1"
try
:
cursor
.
execute
(
update_sql
,
[
str
(
new_str
),
str
(
skuId
)])
db
.
commit
()
except
Exception
as
e
:
db
.
rollback
()
print
(
e
)
else
:
break
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