using AutoTurnOver.DB;
using AutoTurnOver.Services;
using AutoTurnOver.Utility;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading.Tasks;

namespace ResetOutofstock
{
    class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("刷新缺货数据任务启动...");
            try
            {
                
                var now = DateTime.Now;
                //dc_base_supplier_dao.SynchroBailunSupplier();
                //dc_auto_pick_up_goods_order_dao.GenerateOrder(DateTime.Now.AddDays(-3), DateTime.Now);
                //report.PurchaseWeekBackUp();
                //report.ResetOmsOutofstock();
                //report.CalculationSalesTrend();
                //report.ResetLastweekData();
                //report.ResetOmsOutofstock();
                //report.PurchaseWeekBackUp();
            }
            catch (Exception ex)
            {

                throw;
            }
           

            var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
            {
                services.AddHostedService<ResetOutofstockBackgrounService>();
                services.AddHostedService<CaseFlowBackgrounService>();
                services.AddHostedService<StockBackgrounService>();
                services.AddHostedService<ReportFinanceBackgrounService>();
            });

            await builder.RunConsoleAsync();
        }
    }
}
