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

namespace AutoGeneratePurchaseAdvise
{
    class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("采购建议计算任务启动...");
            //PurchaseAdviseServices.Generate();
            //PurchaseAdviseServices.AutoPushBuySys(1);
            //PurchaseAdviseServices.AutoPushBuySys(1);
            //PurchaseAdviseServices.AutoPushBuySys(4);
            //PurchaseAdviseServices.AutoPushBuySys(2);
            //dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
            //PurchaseAdviseServices.AutoPushBuySys(2);
            //PurchaseAdviseServices.AutoPushBuySys(4);
            //PurchaseAdviseServices.AutoPushBuySys(1);
            //dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
            var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
                {
                    services.AddHostedService<GeneratePurchaseAdviseBackgroundService>();
                    services.AddHostedService<FirstBackgroundService>();
                });

            await builder.RunConsoleAsync();
        }
    }
}
