@@ -551,6 +551,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
...
@@ -551,6 +551,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
/// <summary>
/// <summary>
/// 国外仓缺货计算
/// 国外仓缺货计算
/// 海外仓缺货不理会,库存小于2才推
/// </summary>
/// </summary>
/// <param name="is_all">是否全量数据</param>
/// <param name="is_all">是否全量数据</param>
/// <returns></returns>
/// <returns></returns>
...
@@ -593,7 +594,8 @@ and ( ifnull(t6.usable_stock,0)<ifnull(t7.quantity_unshipped,0) ) -- 有缺货
...
@@ -593,7 +594,8 @@ and ( ifnull(t6.usable_stock,0)<ifnull(t7.quantity_unshipped,0) ) -- 有缺货
{
{
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 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 ) ";
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
where t1.warehouse_code in @warehouse_codes
where t1.warehouse_code in @warehouse_codes
and ifnull(t6.usable_stock,0)<=(case when t2.buyer_name in ('张莹霞','张莹霞1') and @platform='ebay' then 2 else 0 end )
and ifnull(t6.usable_stock,0)<2 -- (case when t2.buyer_name in ('张莹霞','张莹霞1') and @platform='ebay' then 2 else 0 end )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
";
";
if(!is_all)
if(!is_all)
...
@@ -961,15 +963,8 @@ where t1.platform=@platform and t1.has_return_goods=0
...
@@ -961,15 +963,8 @@ where t1.platform=@platform and t1.has_return_goods=0
and
and
(
(
case
case
when t2.buyer_name in ('张莹霞','张莹霞1') and t_db.hq_type not in ( '国内仓' ) and t1.platform='ebay'
then ifnull(tnc1.usable_stock,0) - ifnull(tnc2.quantity_unshipped,0) > 2
when t_db.hq_type not in ( '国内仓' ) then ifnull(tnc1.usable_stock,0) - ifnull(tnc2.quantity_unshipped,0) >= 2