using Microsoft.Extensions.DependencyInjection; using Rhea.Common; using Sundial; using Autofac; using System; using System.ComponentModel; using Tiger.IBusiness; using Tiger.Model; namespace Tiger.Business { /// /// 服务总控 /// public class ServicesBus : IServicesBus { #region Functions public void StartServices(ISchedulerFactory schedulerFactory) { if (ApiConfig.RunInterface) { BizContext.InterfaceService = DI.Resolve(); BizContext.InterfaceService.SetSchedulerFactory(schedulerFactory); //启动时从服务器加载所有作业 BizContext.InterfaceService.AddJobFromDB(); //BizContext.InterfaceService.AddJob(); //BizContext.InterfaceService.AddJob("XCSJ_QqtRM_Supplier_Interface", Triggers.Period(5 * 60 * 1000)); //BizContext.InterfaceService.StartJob("XCSJ_QqtRM_Supplier_Interface"); //BizContext.InterfaceService.AddJob("DGXC_QqtRM_Supplier_Interface", Triggers.Period(5 * 60 * 1000)); //BizContext.InterfaceService.StartJob("DGXC_QqtRM_Supplier_Interface"); //BizContext.InterfaceService.AddJob("AHXC_QqtRM_Supplier_Interface", Triggers.Period(5 * 60 * 1000)); //BizContext.InterfaceService.StartJob("AHXC_QqtRM_Supplier_Interface"); //BizContext.InterfaceService.AddJob("XCSJ_ReceiptHToErp_Interface", Triggers.Period(5 * 60 * 1000)); //BizContext.InterfaceService.StartJob("XCSJ_ReceiptHToErp_Interface"); //BizContext.InterfaceService.AddJob("DGXC_ReceiptHToErp_Interface", Triggers.Period(5 * 60 * 1000)); //BizContext.InterfaceService.StartJob("DGXC_ReceiptHToErp_Interface"); //BizContext.InterfaceService.AddJob("AHXC_ReceiptHToErp_Interface", Triggers.Period(5 * 60 * 1000)); //BizContext.InterfaceService.StartJob("AHXC_ReceiptHToErp_Interface"); //BizContext.InterfaceService.StartJob(); ConsoleExt.WriteLine("Start Interface Service..........", ConsoleColor.Yellow); } } public void StopServices() { ////关闭客户端监控 //if (ApiConfig.RunMesInterface) //{ // MesInterfaceService.Stop(); // ConsoleExt.WriteLine("Stop MES Interface Service..........", ConsoleColor.Yellow); //} //if (ApiConfig.RunSrmInterface) //{ // SrmInterfaceService.Stop(); // ConsoleExt.WriteLine("Stop SRM Interface Service..........", ConsoleColor.Yellow); //} } #endregion } }