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

108 lines
3.5 KiB
C#

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