需求背景
目前有销量的listing补货不及时导致产品可售数为0不可售,影响出单,需监控
需求描述
1.有销量直发listing,当可售数为0时,则进行钉钉报警
a.报警前需判断listing是否在补货队列,若在则需排除
2.有销量的虚拟海外仓及真实海外仓listing,当可售数为0时,需判断listing对应仓库的库存是否为0
a.listing对应仓库的库存不为0,则需进行钉钉报警
b.报警前需判断listing是否在补货队列,若在则需排除
3.报警内容为:直发listingXX条/虚拟海外仓listingXXX条/海外仓listingXX条,未及时补货,请检查@胡笑锋@郑树炜
每2个小时统计一次
验证如下:三个场景均设置满足报警提示的预期数据:直发listing、虚拟海外仓、真实海外仓
1、满足预期需要补货的店铺预警的场景数据如下:
【场景1】有销量直发listing,当可售数为0时,则进行钉钉报警
a.报警前需判断listing是否在补货队列,若在则需排除
###--listing查找数据:
###--【直发国内仓】
select t.productid,t.sku,t.sellersku,t.ordersourceid,t.price,t.Quantity,t.QuantitySold,t.WarehouseIds,t.OnlineStatus,t.WareHouseType,t.PublishTime,t.country,t,t.* from m_ebay_listing t
where t.ordersourceID in ('5080','7773','10451','20494','20700') and t.onlinestatus=1 and t.Country ='CN' and t.sku <>'' and t.QuantitySold >0 and t.Quantity =0;
##--10451
select t.productid,t.sku,t.sellersku,t.ordersourceid,t.price,t.Quantity,t.QuantitySold,t.WarehouseIds,t.OnlineStatus,t.WareHouseType,t.PublishTime,t.country,t.type,t.* from m_ebay_listing t
where t.productid in ('166903909089','156116972104','166604592221','156089339011');
###--补货队列
###--直发国内仓--无在补货队列中 10451
select * from pp_replenishment_ebay_queue_202408 where CustomerId = 1 and MarketId = 2 and ProductId in ('166903909089','156116972104','166604592221','156089339011');
【场景2/3】有销量的虚拟海外仓及真实海外仓listing,当可售数为0时,需判断listing对应仓库的库存是否为0
a.listing对应仓库的库存不为0,则需进行钉钉报警
b.报警前需判断listing是否在补货队列,若在则需排除
###--listing查找满足条件的数据:
##--【直发虚拟海外仓】
select t.productid,t.sku,t.sellersku,t.ordersourceid,t.price,t.Quantity,t.QuantitySold,t.WarehouseIds,t.OnlineStatus,t.WareHouseType,t.PublishTime,t.country,t.* from m_ebay_listing t
where t.ordersourceID in ('5080','7773','10451','20494','20700') and t.onlinestatus=1 and t.Country !='CN' and t.sku <>'' and t.QuantitySold >0 and t.Quantity =0;
##--20494
select t.productid,t.sku,t.sellersku,t.ordersourceid,t.price,t.Quantity,t.QuantitySold,t.WarehouseIds,t.OnlineStatus,t.WareHouseType,t.PublishTime,t.country,t.type,t.* from m_ebay_listing t where t.productid in ('375066867785','375069389403','285540306989');
###--补货队列
###--直发虚拟海外仓--无在补货队列中 20494
select * from pp_replenishment_ebay_queue_202408 where CustomerId = 1 and MarketId = 2 and ProductId in ('375066867785','375069389403','285540306989');
13946781 44 0
13753988 0 0
15882790 8 0
select * from p_product_inventory where sku in ('13946781','13753988','15882790');
select * from p_product_overseaswarehouse_dynamicinventory where sku in ('13946781','13753988','15882790');
##--【真实海外仓】
select t.productid,t.sku,t.ordersourceid,t.price,t.Quantity,t.QuantitySold,t.WarehouseIds,t.OnlineStatus,t.WareHouseType,t.PublishTime,t.country,t.* from m_ebay_listing t where t.ordersourceID in ('5080','7773','10451','20494','20700') and t.onlinestatus=1 and t.Country !='CN' and t.sku <>'' and WarehouseType =3 and t.QuantitySold >0 and t.Quantity =0;
##--20494
select t.productid,t.sku,t.sellersku,t.ordersourceid,t.price,t.Quantity,t.QuantitySold,t.WarehouseIds,t.OnlineStatus,t.WareHouseType,t.PublishTime,t.country,t.type,t.* from m_ebay_listing t where t.productid in ('285514974892','285793237731','285819594450');
###--补货队列
###--真实海外仓--无在补货队列中 20494
select * from pp_replenishment_ebay_queue_202408 where CustomerId = 1 and MarketId = 2 and ProductId in ('285514974892','285793237731','285819594450');
15939 10746647 7
15939 15846049 0
15939 11249910 0
select * from p_product_overseaswarehouse_dynamicinventory where sku in ('15846049','10746647','11249910') and WarehouseId = 15939 and WarehouseType =13;
2、实际结果:符合预期,具体的报警内容已与产品沟通过了,按照如下报警内容进行提示即可,方便开发排查问题