@@ -498,6 +498,7 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join ( select * from dc_auto_monitor_sku_type where warehouse_type='国内仓') as t7 on t1.bailun_sku = t7.bailun_sku
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
( t1.warehouse_code in ('GZBLWH','BLGZ03') or ( t1.warehouse_code in ('YWWH01') and ( t2.`status`=1 or t6.`status`=1 ) ) ) -- 义务仓 只要停止监控 或者停售就推送
...
...
@@ -517,21 +518,15 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
if(!is_all)
{
sql+=$" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=1 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
sql+=" and ( t_full_push.status is null or t_full_push.status=0 ) ";
}
// ebay 的 10月新品 +普货全量推
if(platform=="ebay")
{
//if (is_all)
//{
// // 全量推 只推普货
// sql += " and t2.develop_time>='2020-10-01' and t2.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ";
//}
//else
//{
// // 增量推,那部分数据要剔除
// sql += " and !(t2.develop_time>='2020-10-01' and t2.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ) ";
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join ( select * from dc_auto_monitor_sku_type where warehouse_type='国内仓') as t7 on t1.bailun_sku = t7.bailun_sku
left join holiday_supplier_view as t_sp on t3.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
t1.usable_stock<=0 and t1.bailun_sku!=''
...
...
@@ -580,21 +576,28 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
if(!is_all)
{
no_library_sql+=$" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=2 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
no_library_sql+=" and ( t_full_push.status is null or t_full_push.status=0 ) ";
}
// ebay 的 10月新品 +普货全量推
if(platform=="ebay")
{
//if (is_all)
//{
// // 全量推 只推普货
// no_library_sql += " and t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ";
//}
//else
//{
// // 增量推,那部分数据要剔除
// no_library_sql += " and !(t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ) ";
//}
else
{
// 全量推送只能推送有开启监控的
no_library_sql+=" and t_full_push.status=1";
}
// ebay 的 10月新品 +普货全量推
//if (platform == "ebay")
//{
// //if (is_all)
// //{
// // // 全量推 只推普货
// // no_library_sql += " and t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ";
// //}
// //else
// //{
// // // 增量推,那部分数据要剔除
// // no_library_sql += " and !(t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ) ";
) as t7 on t1.bailun_sku = t7.bailun_sku and t_db.area_id = t7.area_id
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
t1.warehouse_code in @warehouse_codes
...
...
@@ -739,6 +743,13 @@ and ( ifnull(t6.usable_stock,0)<ifnull(t7.quantity_unshipped,0) ) -- 有缺货
if(!is_all)
{
sql+=$" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=1 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
sql+=" and ( t_full_push.status is null or t_full_push.status=0 ) ";
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
t1.warehouse_code in @warehouse_codes
...
...
@@ -775,6 +787,13 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
if(!is_all)
{
no_library_sql+=$" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=2 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
no_library_sql+=" and ( t_full_push.status is null or t_full_push.status=0 ) ";