You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB
C#

using Admin.Core.Common;
using Aucma.Core.SheetMetalTasks;
using log4net;
using Microsoft.AspNetCore.Builder;
using System;
using System.Threading.Tasks;
namespace Admin.Core.Extensions.Middlewares
{
public static class AucamSheetMetalTaskMildd
{
private static readonly ILog log = LogManager.GetLogger(typeof(AucamSheetMetalTaskMildd));
public static async void UseAucamSheetMetalTaskMildds(this IApplicationBuilder app, IAucamSheetMetalTaskService aucamSheetMetalTaskService)
{
if (app == null) throw new ArgumentNullException(nameof(app));
try
{
if (Appsettings.app("Middleware", "AucamTask", "Enabled").ObjToBool())
{
await aucamSheetMetalTaskService.SheetMetalTasks();
await aucamSheetMetalTaskService.SendSidePanelPlan();
await aucamSheetMetalTaskService.SendBackPanelPlan();
await aucamSheetMetalTaskService.ExecUpdateComplatePlan();
await aucamSheetMetalTaskService.ExecProcessTheEndTask();
Console.WriteLine("钣金服务已开启");
}
}
catch (Exception e)
{
log.Error($"An error was reported when starting the job service.\n{e.Message}");
throw;
}
}
}
}