Commit 55c81992 by lizefeng

在线缺货改零,改成5分钟推一次

parent 7304518a
......@@ -186,8 +186,6 @@ left join dc_base_tort as t8 on dat.bailun_sku = t8.bailun_sku
sql += " and t3.area_id=" + m.warehousearea;
sqlCount += " and t3.area_id=" + m.warehousearea;
}
if (!string.IsNullOrEmpty(m.warehouse_code))
{
sql += " and dat.warehouse_code='" + m.warehouse_code + "'";
......
......@@ -14,7 +14,7 @@ namespace ShortagePush
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
_timer = new Timer(DoWork, null, TimeSpan.Zero, TimeSpan.FromMinutes(1));
_timer = new Timer(DoWork, null, TimeSpan.Zero, TimeSpan.FromMinutes(5));
return Task.CompletedTask;
}
......@@ -22,17 +22,11 @@ namespace ShortagePush
{
try
{
var now = DateTime.Now;
// 判断是不是指定的时间
if (now.Hour == 15 && now.Minute == 1)
{
Console.WriteLine($"开始推送缺货数据任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
new ReportServices().ShortagePush();
new ReportServices().ReturnGoodsPush();
Console.WriteLine($"结束推送缺货数据任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
......
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