Commit 4962210e by 岳巧源

add push to mq

parent 6ff93c40
Showing with 34 additions and 27 deletions
......@@ -14,7 +14,7 @@ username = 'huntadmin'
password = 'jy2y2900'
host = '172.18.137.29'
port = 5672
queue_name = 'liexin_nplm_filter_sku_data'
queue_name = 'liexin_tmp_update_stock_data'
def push_mq(message: str):
......@@ -26,7 +26,7 @@ def push_mq(message: str):
))
channel = conn.channel()
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()
conn.close()
......@@ -35,24 +35,26 @@ def push_mq(message: str):
# {"goods_id":1170115972487102103,"spu_id":2170115972437912400,"platform":1,"shop_id":1}
if __name__ == '__main__':
data = {"goods_id": 1151525960495265804, "spu_id": 2151133166540743705, "platform": 1, "shop_id": 2}
msg = json.dumps(data, ensure_ascii=False)
push_mq(msg)
data = {"goods_id": 1151033368840495919, "spu_id": 2151033368813527600, "platform": 1, "shop_id": 2}
msg = json.dumps(data, ensure_ascii=False)
push_mq(msg)
data = {"goods_id": 1151033372498623926, "spu_id": 2151033372494531806, "platform": 1, "shop_id": 2}
msg = json.dumps(data, ensure_ascii=False)
push_mq(msg)
data = {"goods_id": 1171169666318406723, "spu_id": 2151033370259441104, "platform": 1, "shop_id": 2}
msg = json.dumps(data, ensure_ascii=False)
push_mq(msg)
data = {"goods_id": 1151033368983156030, "spu_id": 2151033369155518807, "platform": 1, "shop_id": 2}
msg = json.dumps(data, ensure_ascii=False)
push_mq(msg)
\ No newline at end of file
# data = {"goods_id": 1151525960495265804, "spu_id": 2151133166540743705, "platform": 1, "shop_id": 2}
# msg = json.dumps(data, ensure_ascii=False)
# push_mq(msg)
#
#
# data = {"goods_id": 1151033368840495919, "spu_id": 2151033368813527600, "platform": 1, "shop_id": 2}
# msg = json.dumps(data, ensure_ascii=False)
# push_mq(msg)
#
# data = {"goods_id": 1151033372498623926, "spu_id": 2151033372494531806, "platform": 1, "shop_id": 2}
# msg = json.dumps(data, ensure_ascii=False)
# push_mq(msg)
#
# data = {"goods_id": 1171169666318406723, "spu_id": 2151033370259441104, "platform": 1, "shop_id": 2}
# msg = json.dumps(data, ensure_ascii=False)
# push_mq(msg)
#
#
# data = {"goods_id": 1151033368983156030, "spu_id": 2151033369155518807, "platform": 1, "shop_id": 2}
# msg = json.dumps(data, ensure_ascii=False)
# push_mq(msg)
data = "1168474116667888254,1168432022612528554"
push_mq(data)
\ No newline at end of file
......@@ -29,3 +29,7 @@ alter table lie_shop_picture add column lie_pdf varchar(255) default '' not null
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 '采购价,或成本价';
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
......@@ -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",
"skuStockNum": stock_num,
"promiseDays": delivery_day,
"czFlag": 1,
"czFlag": 0,
"skuId": ware_id,
}
]
......@@ -539,4 +539,4 @@ def delete_vc_activity():
if __name__ == '__main__':
create_vc_promotion()
\ No newline at end of file
set_vc_init_stock_and_delivery(stock_num=11, delivery_day=11, ware_id=100153434044)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment