using Furion; using Furion.Logging; using Furion.TaskScheduler; using Myshipping.Core.Service; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Myshipping.Core.Job { public class CacheCommonWorker: ISpareTimeWorker { [SpareTime(2000, "CacheCommonWorker", Description = "缓存公共库", DoOnce = true, StartNow = true, ExecuteType = SpareTimeExecuteTypes.Serial)] public async void CacheCommon(SpareTimer timer, long count) { Log.Information($"开始缓存公共库 {DateTime.Now}"); //船公司 await App.GetService().GetAllCarrier(); //船公司映射 await App.GetService().GetAllMappingCarrier(); //船名 await App.GetService().GetAllVessel(); //船名映射 await App.GetService().GetAllMappingVessel(); //场站映射 await App.GetService().GetAllMappingYard(); //船代 await App.GetService().GetAllForwarder(); //场站 await App.GetService().GetAllYard(); //起始港 await App.GetService().GetAllPortload(); //目的港 await App.GetService().GetAllPort(); //包装 await App.GetService().GetAllPackage(); //运输方式 await App.GetService().GetAllService(); //箱型 await App.GetService().GetAllCtn(); //箱型映射 await App.GetService().GetAllMappingCtn(); //付费方式 await App.GetService().GetAllFrt(); //付费方式映射 await App.GetService().GetAllMappingFrt(); //起始港映射 await App.GetService().GetAllMappingPortLoad(); //目的港映射 await App.GetService().GetAllMappingPort(); //包装映射 await App.GetService().GetAllMappingPackage(); //运输服务映射 await App.GetService().GetAllMappingService(); //签单方式 await App.GetService().GetAllCodeIssueType(); //缓存EDI数据 await App.GetService().CacheData(); //缓存字典数据 await App.GetService().CacheData(); //租户参数 await App.GetService().CacheData(); //系统参数 await App.GetService().GetAllSysConfig(); Log.Information($"缓存公共库完成 {DateTime.Now}"); } } }