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