Commit d6395135 by 泽锋 李

海外仓要库存小于2,才推送改零

缺货不改0
parent 23615fb4
...@@ -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 ) ";
} }
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,new { warehouse_codes = warehouse_codes, platform = platform }, commandTimeout: 0));
//shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,new { warehouse_codes = warehouse_codes, platform = platform }, commandTimeout: 0));
// 0库存推送 // 0库存推送
string no_library_sql = @" select t1.bailun_sku, string no_library_sql = @" select t1.bailun_sku,
...@@ -615,7 +617,7 @@ left join ( ...@@ -615,7 +617,7 @@ left join (
GROUP BY t1.bailun_sku,t2.area_id GROUP BY t1.bailun_sku,t2.area_id
) 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
else else ifnull(tc2.sum_unshipped_quantity,0) < ifnull(tc1.sum_usable_stock,0)
(
case
when ifnull(tc2.sum_unshipped_quantity,0) < ifnull(tc1.sum_usable_stock,0) then 1
when ifnull(tnc2.quantity_unshipped,0) < ifnull(tnc1.usable_stock,0) then 1
else 0
end
) = 1
end end
) )
......
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 to comment