定时任务把仓库刷到redis中(1小时执行一次):
一、渠道维度(key=source_id,value=warehouse_id)
FBA仓库取法(rb_ware_house表在warehouse库,warehouse_type全部默认==3):
select id warehouse_id,autonomous_ware_house_id source_id from rb_ware_house where customer_id=1 and ware_house_type=3 and is_active=1 limit 1,1000
二、SKU维度(key=source_id,value=warehouse_id):
FBM仓库取法(warehouse_type全部默认==1):
1、先获取最大与最小product的ID,每500区间为一个MQ
2、消费MQ:
select sku,default_local_warehouse warehouse_id from rb_product where 正常SKU AND id >=startId and id <endId
如果warehouse_id为空:
1、则通过供应商仓库获取库ID(product库)
select ps.TheWareHouseID from RB_Product_Supplier ps (nolock) left join RB_Product_SupplierPrice psp (nolock) on ps.id=psp.SupplierID
where ps.CustomerID=1 and psp.CustomerID=1 and psp.IsDefault=1 and psp.SKU='1002254'
@张居瓦未同步表(RB_Product_Supplier与RB_Product_SupplierPrice),需要同步到product库,然后在执行调价策略时,直接从redis中获取
1.已上线测试通过
2.git