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
011daeb1
authored
Sep 30, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
push sku
parent
c0064002
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
push_sku_to_nplm.py
push_sku_to_nplm.py
View file @
011daeb1
# TODO push the data of liexin to go_nplm_server.
# 首先从234的redis中获取 supplier_id, brand_id的相关信息
# 根据获取到的信息去sku数据库中筛选 符合条件的数据信息(包含spu_id)
# 在redis中根据spu_id 获取到相关的分类信息等等。
# 映射组装后推送到 go_nplm_server处理
import
json
import
redis
db
=
redis
.
Redis
(
host
=
'192.168.1.235'
,
port
=
6379
,
password
=
'icDb29mLy2s'
,
decode_responses
=
True
)
def
get_channel_info
():
"""return supplier_id 或者 brand_id 等等"""
data
=
{}
infos
=
db
.
hgetall
(
'shop_distribution'
)
for
i
in
range
(
len
(
infos
)):
info_value
=
json
.
loads
(
infos
[
str
(
i
+
1
)])
# 暂时只推京东数据
if
info_value
[
"shop_id"
]
!=
1
or
info_value
[
"platform"
]
!=
1
:
continue
supplier_id_list
=
info_value
[
"supplier_id_list"
]
brand_id_list
=
info_value
[
"brand_id_list"
]
platform
=
info_value
[
"platform"
]
data
[
"supplier_id_list"
]
=
supplier_id_list
data
[
"brand_id_list"
]
=
brand_id_list
data
[
"platform"
]
=
platform
return
data
if
__name__
==
'__main__'
:
get_channel_info
()
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