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.
BookingHeChuan/Myshipping.Core/Job/CacheCommonWorker.cs

115 lines
3.6 KiB
C#

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<ICommonDBService>().GetAllCarrier(true);
//船公司映射
await App.GetService<ICommonDBService>().GetAllMappingCarrier(true);
//船名
await App.GetService<ICommonDBService>().GetAllVessel(true);
//船名映射
await App.GetService<ICommonDBService>().GetAllMappingVessel(true);
//场站映射
await App.GetService<ICommonDBService>().GetAllMappingYard(true);
//船代
await App.GetService<ICommonDBService>().GetAllForwarder(true);
//场站
await App.GetService<ICommonDBService>().GetAllYard(true);
//起始港
await App.GetService<ICommonDBService>().GetAllPortload(true);
//目的港
await App.GetService<ICommonDBService>().GetAllPort(true);
//包装
await App.GetService<ICommonDBService>().GetAllPackage(true);
//运输方式
await App.GetService<ICommonDBService>().GetAllService(true);
//箱型
await App.GetService<ICommonDBService>().GetAllCtn(true);
//箱型映射
await App.GetService<ICommonDBService>().GetAllMappingCtn(true);
//付费方式
await App.GetService<ICommonDBService>().GetAllFrt(true);
//付费方式映射
await App.GetService<ICommonDBService>().GetAllMappingFrt(true);
//起始港映射
await App.GetService<ICommonDBService>().GetAllMappingPortLoad(true);
//目的港映射
await App.GetService<ICommonDBService>().GetAllMappingPort(true);
//包装映射
await App.GetService<ICommonDBService>().GetAllMappingPackage(true);
//运输服务映射
await App.GetService<ICommonDBService>().GetAllMappingService(true);
//签单方式
await App.GetService<ICommonDBService>().GetAllCodeIssueType(true);
//签单映射
await App.GetService<ICommonDBService>().GetAllMappingIssueType(true);
//船代映射
await App.GetService<ICommonDBService>().GetAllMappingForwarder(true);
//缓存EDI数据
await App.GetService<IDjyEdiSettingService>().CacheData(true);
//缓存字典数据
await App.GetService<ISysDictDataService>().CacheData(true);
//租户参数
await App.GetService<IDjyTenantParamService>().CacheData(true);
//系统参数
await App.GetService<ISysConfigService>().CacheData();
//航线
await App.GetService<ICommonDBService>().GetAllLane(true);
//航线与港口的的关系
await App.GetService<ICommonDBService>().GetAllRelaPortCarrierLane(true);
//国家
await App.GetService<ICommonDBService>().GetAllCountry(true);
Log.Information($"缓存公共库完成 {DateTime.Now}");
}
}
}