Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
jd_data_process
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
3b87e05b
authored
Oct 24, 2024
by
larosa
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add test
parent
0ef48f57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
test.py
test6.py
test.py
View file @
3b87e05b
...
@@ -18,7 +18,7 @@ def post_to_jd():
...
@@ -18,7 +18,7 @@ def post_to_jd():
"model"
:
"MAC12DG-PRICE-LAROSA888"
,
"model"
:
"MAC12DG-PRICE-LAROSA888"
,
"cid1"
:
33556
,
"cid1"
:
33556
,
# "leaf_cid": 33349,
# "leaf_cid": 33349,
#
"weight": 1, # 非盖亚必填
"weight"
:
1
,
# 非盖亚必填
"height"
:
1
,
# 非盖亚必填
"height"
:
1
,
# 非盖亚必填
"length"
:
1
,
# 非盖亚必填
"length"
:
1
,
# 非盖亚必填
"width"
:
1
,
# 非盖亚必填
"width"
:
1
,
# 非盖亚必填
...
@@ -28,7 +28,7 @@ def post_to_jd():
...
@@ -28,7 +28,7 @@ def post_to_jd():
"item_num"
:
"27348342899"
,
"item_num"
:
"27348342899"
,
"member_price"
:
1000.99
,
"member_price"
:
1000.99
,
"market_price"
:
1100.99
,
"market_price"
:
1100.99
,
"purchase_price"
:
900.000
0
,
"purchase_price"
:
900.000
1
,
"saler_code"
:
"gonglingzhe1"
,
"saler_code"
:
"gonglingzhe1"
,
"purchaser_code"
:
"gonglingzhe1"
,
"purchaser_code"
:
"gonglingzhe1"
,
"prop_id"
:
"232935,232969,232953,232988,274281,270354"
,
# 属性id
"prop_id"
:
"232935,232969,232953,232988,274281,270354"
,
# 属性id
...
@@ -43,13 +43,10 @@ def post_to_jd():
...
@@ -43,13 +43,10 @@ def post_to_jd():
"intro_html"
:
"<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>"
,
# pc商详
"intro_html"
:
"<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>"
,
# pc商详
"intro_mobile"
:
"<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>"
,
# 移动商详
"intro_mobile"
:
"<img src=https://img30.360buyimg.com/sku/jfs/t1/133800/28/25551/94742/62fef403E1a77f3a2/9b92597c0c26d1c8.jpg' /><br>"
,
# 移动商详
}
}
# ans = request_to_jd_vc(method_name=methodName, token=token, app_key=app_key, app_secret=app_secret, param=param)
ans
=
request_to_jd_vc
(
method_name
=
methodName
,
token
=
token
,
app_key
=
app_key
,
app_secret
=
app_secret
,
param
=
param
)
# print(json.dumps(ans, ensure_ascii=False))
print
(
json
.
dumps
(
ans
,
ensure_ascii
=
False
))
ans_s
=
json
.
dumps
(
param
,
ensure_ascii
=
False
)
print
(
ans_s
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
ans
=
format_to_four_decimals
(
9.678
)
post_to_jd
()
print
(
ans
)
\ No newline at end of file
sql
=
"select select goods_id, spu_id, supplier_id from "
\ No newline at end of file
test6.py
View file @
3b87e05b
...
@@ -65,6 +65,23 @@ def main():
...
@@ -65,6 +65,23 @@ def main():
print
(
update_sql
%
(
default_unit
,
id
))
print
(
update_sql
%
(
default_unit
,
id
))
db
.
commit
()
db
.
commit
()
def
modify_apply_id_map
():
"""将map转字符串"""
conf
=
config_dev
db
=
pymysql
.
connect
(
host
=
conf
[
"mysql"
][
"host"
],
port
=
conf
[
"mysql"
][
"port"
],
user
=
conf
[
"mysql"
][
"user"
],
password
=
conf
[
"mysql"
][
"password"
],
database
=
conf
[
"mysql"
][
"database"
])
cursor
=
db
.
cursor
()
select_sql
=
"select id, apply_id from lie_shop_push_sku_log where apply_id != ''"
cursor
.
execute
(
query
=
select_sql
)
db_result
=
cursor
.
fetchall
()
for
i
in
range
(
len
(
db_result
)):
id
=
db_result
[
i
][
0
]
apply_id_str
=
str
(
db_result
[
i
][
1
])
ans
=
json
.
loads
(
apply_id_str
)
apply_id
=
ans
[
"productApplyId"
]
update_sql
=
"update lie_shop_push_sku_log set apply_id =
%
s where id =
%
s"
cursor
.
execute
(
query
=
update_sql
,
args
=
(
apply_id
,
id
,))
db
.
commit
()
print
(
update_sql
%
(
apply_id
,
id
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
modify_apply_id_map
()
\ No newline at end of file
\ No newline at end of file
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