Commit c7f2720e by 泽锋 李

oms缺货明细,改成定时跑

parent eea76fae
...@@ -18,13 +18,7 @@ namespace AutoGeneratePurchaseAdvise ...@@ -18,13 +18,7 @@ namespace AutoGeneratePurchaseAdvise
try try
{ {
//purchase_advise.ReplaceLogistics(DateTime.Now); //PurchaseAdviseServices.AutoPushBuySys(2);
//purchase_advise.WaitReplaceLogisticsTask();
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("2020-11-28 17:06:00")));
//PurchaseAdviseServices.AutoPushBuySys(1);
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
//PurchaseAdviseServices.AutoPushBuySys(4);
//PurchaseAdviseServices.AutoPushBuySys(6);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -23,6 +23,7 @@ namespace ResetOutofstock ...@@ -23,6 +23,7 @@ namespace ResetOutofstock
//report.ResetOmsOutofstock(); //report.ResetOmsOutofstock();
//report.CalculationSalesTrend(); //report.CalculationSalesTrend();
//report.ResetLastweekData(); //report.ResetLastweekData();
report.ResetOmsOutofstock();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -116,34 +116,6 @@ namespace ResetOutofstock ...@@ -116,34 +116,6 @@ namespace ResetOutofstock
} }
}); });
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
var now = DateTime.Now;
if (now.Hour>2 && now.Hour<=8)
{
Console.WriteLine(" 刷新缺货明细数据 * (数据库忙时,暂停)");
}
else
{
Console.WriteLine($"开始刷新缺货明细数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report.ResetOmsOutofstock();
Console.WriteLine($"结束刷新缺货明细数据任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Thread.Sleep(60 * 60 * 1000);
}
});
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
......
...@@ -22,6 +22,22 @@ namespace ResetOutofstock ...@@ -22,6 +22,22 @@ namespace ResetOutofstock
{ {
var now = DateTime.Now; var now = DateTime.Now;
if (now.Minute == 0)
{
if (now.Hour > 2 && now.Hour <= 8)
{
Console.WriteLine($"开始 刷新缺货明细 ,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Console.WriteLine(" 刷新缺货明细数据 * (数据库忙时,暂停)");
Console.WriteLine($"结束 刷新缺货明细 ,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
else
{
Console.WriteLine($"开始 刷新缺货明细 ,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report.ResetOmsOutofstock();
Console.WriteLine($"结束 刷新缺货明细 ,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
}
if (now.Month==1 && now.Day==1 && now.Hour == 0 && now.Minute == 01) if (now.Month==1 && now.Day==1 && now.Hour == 0 && now.Minute == 01)
{ {
Console.WriteLine($"开始 刷新年度增长趋势,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 刷新年度增长趋势,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
......
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