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
4962210e
authored
Nov 06, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add push to mq
parent
6ff93c40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
29 deletions
push_to_mq.py
tmp.sql
vc.py
push_to_mq.py
View file @
4962210e
...
@@ -14,7 +14,7 @@ username = 'huntadmin'
...
@@ -14,7 +14,7 @@ username = 'huntadmin'
password
=
'jy2y2900'
password
=
'jy2y2900'
host
=
'172.18.137.29'
host
=
'172.18.137.29'
port
=
5672
port
=
5672
queue_name
=
'liexin_
nplm_filter_sku
_data'
queue_name
=
'liexin_
tmp_update_stock
_data'
def
push_mq
(
message
:
str
):
def
push_mq
(
message
:
str
):
...
@@ -26,7 +26,7 @@ def push_mq(message: str):
...
@@ -26,7 +26,7 @@ def push_mq(message: str):
))
))
channel
=
conn
.
channel
()
channel
=
conn
.
channel
()
channel
.
queue_declare
(
queue
=
queue_name
,
durable
=
True
)
channel
.
queue_declare
(
queue
=
queue_name
,
durable
=
True
)
channel
.
basic_publish
(
exchange
=
""
,
routing_key
=
"liexin_
nplm_filter_sku
_data"
,
body
=
str
.
encode
(
message
))
channel
.
basic_publish
(
exchange
=
""
,
routing_key
=
"liexin_
tmp_update_stock
_data"
,
body
=
str
.
encode
(
message
))
channel
.
close
()
channel
.
close
()
conn
.
close
()
conn
.
close
()
...
@@ -35,24 +35,26 @@ def push_mq(message: str):
...
@@ -35,24 +35,26 @@ def push_mq(message: str):
# {"goods_id":1170115972487102103,"spu_id":2170115972437912400,"platform":1,"shop_id":1}
# {"goods_id":1170115972487102103,"spu_id":2170115972437912400,"platform":1,"shop_id":1}
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
data
=
{
"goods_id"
:
1151525960495265804
,
"spu_id"
:
2151133166540743705
,
"platform"
:
1
,
"shop_id"
:
2
}
# data = {"goods_id": 1151525960495265804, "spu_id": 2151133166540743705, "platform": 1, "shop_id": 2}
msg
=
json
.
dumps
(
data
,
ensure_ascii
=
False
)
# msg = json.dumps(data, ensure_ascii=False)
push_mq
(
msg
)
# push_mq(msg)
#
#
data
=
{
"goods_id"
:
1151033368840495919
,
"spu_id"
:
2151033368813527600
,
"platform"
:
1
,
"shop_id"
:
2
}
# data = {"goods_id": 1151033368840495919, "spu_id": 2151033368813527600, "platform": 1, "shop_id": 2}
msg
=
json
.
dumps
(
data
,
ensure_ascii
=
False
)
# msg = json.dumps(data, ensure_ascii=False)
push_mq
(
msg
)
# push_mq(msg)
#
data
=
{
"goods_id"
:
1151033372498623926
,
"spu_id"
:
2151033372494531806
,
"platform"
:
1
,
"shop_id"
:
2
}
# data = {"goods_id": 1151033372498623926, "spu_id": 2151033372494531806, "platform": 1, "shop_id": 2}
msg
=
json
.
dumps
(
data
,
ensure_ascii
=
False
)
# msg = json.dumps(data, ensure_ascii=False)
push_mq
(
msg
)
# push_mq(msg)
#
data
=
{
"goods_id"
:
1171169666318406723
,
"spu_id"
:
2151033370259441104
,
"platform"
:
1
,
"shop_id"
:
2
}
# data = {"goods_id": 1171169666318406723, "spu_id": 2151033370259441104, "platform": 1, "shop_id": 2}
msg
=
json
.
dumps
(
data
,
ensure_ascii
=
False
)
# msg = json.dumps(data, ensure_ascii=False)
push_mq
(
msg
)
# push_mq(msg)
#
#
data
=
{
"goods_id"
:
1151033368983156030
,
"spu_id"
:
2151033369155518807
,
"platform"
:
1
,
"shop_id"
:
2
}
# data = {"goods_id": 1151033368983156030, "spu_id": 2151033369155518807, "platform": 1, "shop_id": 2}
msg
=
json
.
dumps
(
data
,
ensure_ascii
=
False
)
# msg = json.dumps(data, ensure_ascii=False)
push_mq
(
msg
)
# push_mq(msg)
\ No newline at end of file
data
=
"1168474116667888254,1168432022612528554"
push_mq
(
data
)
\ No newline at end of file
tmp.sql
View file @
4962210e
...
@@ -28,4 +28,8 @@ select resp_body_msg from lie_shop_push_sku_log where apply_id = '' limit 1;
...
@@ -28,4 +28,8 @@ select resp_body_msg from lie_shop_push_sku_log where apply_id = '' limit 1;
alter
table
lie_shop_picture
add
column
lie_pdf
varchar
(
255
)
default
''
not
null
comment
'猎芯pdf链接'
;
alter
table
lie_shop_picture
add
column
lie_pdf
varchar
(
255
)
default
''
not
null
comment
'猎芯pdf链接'
;
alter
table
lie_shop_picture
add
column
jd_pdf
varchar
(
255
)
default
''
not
null
comment
'京东pdf链接'
;
alter
table
lie_shop_picture
add
column
jd_pdf
varchar
(
255
)
default
''
not
null
comment
'京东pdf链接'
;
alter
table
lie_shop_sku
modify
column
cost_price
decimal
(
10
,
4
)
unsigned
default
0
.
0000
not
null
comment
'采购价,或成本价'
;
alter
table
lie_shop_sku
modify
column
cost_price
decimal
(
10
,
4
)
unsigned
default
0
.
0000
not
null
comment
'采购价,或成本价'
;
\ No newline at end of file
delete
from
lie_shop_picture
where
create_time
>
1730736735
and
spu_id
=
0
;
update
lie_shop_push_sku_log
set
audit_status
=
1
where
create_time
>
1730368800
and
platform
=
1
;
\ No newline at end of file
vc.py
View file @
4962210e
...
@@ -345,7 +345,7 @@ def set_vc_init_stock_and_delivery(stock_num, delivery_day, ware_id):
...
@@ -345,7 +345,7 @@ def set_vc_init_stock_and_delivery(stock_num, delivery_day, ware_id):
"@type"
:
"com.jd.jdi.ivc.product.publish.sdk.dto.product.ProductConfigInfoDto"
,
"@type"
:
"com.jd.jdi.ivc.product.publish.sdk.dto.product.ProductConfigInfoDto"
,
"skuStockNum"
:
stock_num
,
"skuStockNum"
:
stock_num
,
"promiseDays"
:
delivery_day
,
"promiseDays"
:
delivery_day
,
"czFlag"
:
1
,
"czFlag"
:
0
,
"skuId"
:
ware_id
,
"skuId"
:
ware_id
,
}
}
]
]
...
@@ -539,4 +539,4 @@ def delete_vc_activity():
...
@@ -539,4 +539,4 @@ def delete_vc_activity():
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
create_vc_promotion
()
set_vc_init_stock_and_delivery
(
stock_num
=
11
,
delivery_day
=
11
,
ware_id
=
100153434044
)
\ 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