Commit 1d368035 by 泽锋 李

动态计算jit安全库存

parent 75a02d07
......@@ -1934,6 +1934,16 @@ where t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code;
}
/// <summary>
/// 刷新安全库存
/// </summary>
public static void ResetInventory()
{
_connection.Execute(@"update dc_auto_jit_inventory as t1,
dc_auto_turnover as t2
set t1.safe_stock = t2.history_fourteenday_sales * 2
where t1.bailun_sku =t2.bailun_sku and t1.warehouse_code =t2.warehouse_code",commandTimeout:0);
}
//刷新上周的数据
public static void ResetLastweekData()
{
......
......@@ -37,6 +37,13 @@ namespace ResetOutofstock
Console.WriteLine($"结束 备份上周采购库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
}
if(now.Hour==8 && now.Minute == 1)
{
Console.WriteLine($"开始 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report.ResetInventory();
Console.WriteLine($"结束 刷新jit安全库存,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
}
public override void Dispose()
......
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