using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading.Tasks;

namespace Bailun.DC.DailyInventorySummary
{
    class Program
    {
        /// <summary>
        /// 库存汇总分析报表
        /// 数据来源于逻辑仓库，逻辑仓库6点启动计算，预计50分钟内跑完数据
        /// </summary>
        /// <param name="args"></param>
        static async Task Main(string[] args)
        {
            Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
            {
                services.AddHostedService<Services>();
            });

            await builder.RunConsoleAsync();

            //var _services = new Services();
            //var day = DateTime.Parse(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
            //_services.Init(day);
        }
    }
}
