Commit 8ecadfb9 by lizefeng

张莹霞01的改为每天早上10点推送缺货的

parent bfe752dc
...@@ -31,6 +31,10 @@ namespace AutoGeneratePurchaseAdvise ...@@ -31,6 +31,10 @@ namespace AutoGeneratePurchaseAdvise
PurchaseAdviseServices.AutoPushBuySys(1); PurchaseAdviseServices.AutoPushBuySys(1);
Console.WriteLine($"结束推送 jit甲油采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束推送 jit甲油采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
if (now.Hour == 10 && now.Minute == 01)
{
Console.WriteLine($"开始推送 jit精油采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始推送 jit精油采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
PurchaseAdviseServices.AutoPushBuySys(4); PurchaseAdviseServices.AutoPushBuySys(4);
Console.WriteLine($"结束推送 jit精油采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束推送 jit精油采购建议 任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
......
...@@ -488,7 +488,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh ...@@ -488,7 +488,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,commandTimeout: 0)); shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,commandTimeout: 0));
// 0库存推送 // 0库存推送
string no_library_sql = @"select t1.bailun_sku, string no_library_sql = @" select t1.bailun_sku,
t1.warehouse_code, t1.warehouse_code,
now() as 'push_date', now() as 'push_date',
0 as 'stocks', 0 as 'stocks',
...@@ -498,25 +498,29 @@ left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code ...@@ -498,25 +498,29 @@ left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku
where t1.usable_stock<=0 and t1.bailun_sku!='' where t1.usable_stock<=0 and t1.bailun_sku!=''
and ( t_db.hq_type!='国内仓' or t3.buyer_name not in ('张莹霞','张莹霞1','黄镜洁','赵美聪') ) and ( t_db.hq_type!='国内仓' or t3.buyer_name not in ('张莹霞','张莹霞1','黄镜洁','赵美聪') )
and t1.warehouse_code in ('AU4PXBL','BLGZ03','DYGXC','GB4PXBL','GBBLJW','GBYKD','GZBLWH','QYBLZZ','US4PXBL','USGCBL') and t1.warehouse_code in ('AU4PXBL','GB4PXBL','GBBLJW','GBYKD','GZBLWH','QYBLZZ','US4PXBL','USGCBL')
and ( and (
case case
when t_db.hq_type='国内仓' then t2.quantity_purchase when t_db.hq_type='国内仓' then 0
else t2.quantity_transfer else t2.quantity_transfer
end end
)<=0 )<=0 -- 国内仓有没有在途都要推 , 国外仓有调拨在途就不推了
and not EXISTS ( and not EXISTS (
select * from dc_base_stock as t_stock select * from dc_base_stock as t_stock
left join dc_base_warehouse as t_stock_w on t_stock.warehouse_code = t_stock_w.warehouse_code left join dc_base_warehouse as t_stock_w on t_stock.warehouse_code = t_stock_w.warehouse_code
left join dc_mid_transit as t_stock_t on t_stock.warehouse_code =t_stock_t.warehouse_code and t_stock.bailun_sku =t_stock_t.bailun_sku left join dc_mid_transit as t_stock_t on t_stock.warehouse_code =t_stock_t.warehouse_code and t_stock.bailun_sku =t_stock_t.bailun_sku
where ( ( t_stock_w.hq_type='国内仓' and t_db.hq_type='国内仓' ) or ( t_db.hq_type!='国内仓' and t_stock_w.hq_type!='国内仓' and t_db.area_id=t_stock_w.area_id ) ) and t_stock.bailun_sku= t1.bailun_sku and ( t_stock.usable_stock>0 or where
( t_stock.warehouse_code != 'BLGZ03'
case and ( ( t_stock_w.hq_type='国内仓' and t_db.hq_type='国内仓' ) or ( t_db.hq_type!='国内仓' and t_stock_w.hq_type!='国内仓' and t_db.area_id=t_stock_w.area_id ) )
when t_stock_w.hq_type='国内仓' then t_stock_t.quantity_purchase and t_stock.bailun_sku= t1.bailun_sku and
else t_stock_t.quantity_transfer ( t_stock.usable_stock>0 or
end (
)>0 case
) when t_stock_w.hq_type='国内仓' then 0 -- 国内其他仓有没有在途都要推 , 国外仓有调拨在途就不推了
else t_stock_t.quantity_transfer
end
)>0
)
) -- 同属性仓库 (是否国内) 有库存,就不算 0库存 ) -- 同属性仓库 (是否国内) 有库存,就不算 0库存
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 )
......
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