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
|
{
|
/// <summary>
|
/// 服务总控
|
/// </summary>
|
public class ServicesBus : IServicesBus
|
{
|
|
#region Functions
|
public void StartServices(ISchedulerFactory schedulerFactory)
|
{
|
if (ApiConfig.RunInterface)
|
{
|
BizContext.InterfaceService = DI.Resolve<IInterfaceService>();
|
BizContext.InterfaceService.SetSchedulerFactory(schedulerFactory);
|
//启动时从服务器加载所有作业
|
BizContext.InterfaceService.AddJobFromDB();
|
|
|
//BizContext.InterfaceService.AddJob();
|
|
//BizContext.InterfaceService.AddJob<Jobs.QqtSrmToXCSJJob>("XCSJ_QqtRM_Supplier_Interface", Triggers.Period(5 * 60 * 1000));
|
//BizContext.InterfaceService.StartJob("XCSJ_QqtRM_Supplier_Interface");
|
//BizContext.InterfaceService.AddJob<Jobs.QqtSrmToDGXCJob>("DGXC_QqtRM_Supplier_Interface", Triggers.Period(5 * 60 * 1000));
|
//BizContext.InterfaceService.StartJob("DGXC_QqtRM_Supplier_Interface");
|
//BizContext.InterfaceService.AddJob<Jobs.QqtSrmToAHXCJob>("AHXC_QqtRM_Supplier_Interface", Triggers.Period(5 * 60 * 1000));
|
//BizContext.InterfaceService.StartJob("AHXC_QqtRM_Supplier_Interface");
|
|
|
//BizContext.InterfaceService.AddJob<Jobs.ReceiptHToErpXCSJJob>("XCSJ_ReceiptHToErp_Interface", Triggers.Period(5 * 60 * 1000));
|
//BizContext.InterfaceService.StartJob("XCSJ_ReceiptHToErp_Interface");
|
//BizContext.InterfaceService.AddJob<Jobs.ReceiptHToErpDGXCJob>("DGXC_ReceiptHToErp_Interface", Triggers.Period(5 * 60 * 1000));
|
//BizContext.InterfaceService.StartJob("DGXC_ReceiptHToErp_Interface");
|
//BizContext.InterfaceService.AddJob<Jobs.ReceiptHToErpAHXCJob>("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
|
}
|
}
|