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_auto_turnover.CopyForecast();
                //report.GenerateWeekTagStockDatas();
                //dc_base_transfer_extend_dao.SynchroLmsTransferOrder();
                //dc_base_supplier_dao.SynchroBailunLmsChannel();
                //dc_base_trans_temp_schedule_dao.SynchroTransTempScheduleData(true);
                //dc_auto_turnover.CalculationProfitAnalysis("LM-EO-007", "MMDUSFBA");
                //dc_auto_turnover.SynchroCalculationProfitAnalysis();

                //dc_base_transfer_freight_dao.CalculationSingle("944913201", "MMDUSFBA");
                //dc_base_transfer_freight_dao.Init();
            }
            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();
        }
    }
}
