Commit 73b940d0 by lizefeng

缺货改0 记录时间

parent ca69cf84
......@@ -538,16 +538,16 @@ alter table dc_not_stock_goods_salesTemp rename dc_not_stock_goods_sales_temp;
truncate table dc_not_stock_goods_sales_temp; ", commandTimeout: 0);
_connection.Execute(@" -- 记录历史缺货
insert ignore into dc_outofstock_history(`bailun_sku`,`warehouse_code`) (
insert ignore into dc_outofstock_history(`bailun_sku`,`warehouse_code`,`date`) (
select
t1.bailun_sku,t1.warehouse_code
t1.bailun_sku,t1.warehouse_code,now() as 'date'
from dc_mid_transit as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join china_warehouse_stock as t3 on t1.bailun_sku = t3.bailun_sku and t_db.hq_type='国内仓'
left join china_warehouse_unshipped as t4 on t1.bailun_sku = t4.bailun_sku and t_db.hq_type='国内仓'
where ( t_db.hq_type!='国内仓' or t2.buyer_name not in ('张莹霞','张莹霞1') ) and t_db.hq_type!='fba仓' and (case when t_db.hq_type='国内仓' then (ifnull(t4.sum_unshipped_quantity,0) - ifnull(t3.sum_usable_stock,0)) else t1.quantity_out_stock end )>0
)");
) ");
}
catch (Exception ex)
{
......
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