船名缓存

booking_auth_dev
wet 2 years ago
parent 9d69412ebb
commit 8fed094cd9

@ -7761,6 +7761,11 @@
运输服务映射 运输服务映射
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllCodeIssueType">
<summary>
签单方式
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonService.GetEntityInfos(System.Boolean)"> <member name="M:Myshipping.Core.Service.CommonService.GetEntityInfos(System.Boolean)">
<summary> <summary>
获取库表信息 获取库表信息

@ -2,6 +2,7 @@
using Furion.DynamicApiController; using Furion.DynamicApiController;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Myshipping.Core.Entity; using Myshipping.Core.Entity;
using Myshipping.Core.Entity.CommonDB; using Myshipping.Core.Entity.CommonDB;
@ -22,9 +23,11 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
{ {
private readonly ICache _cache; private readonly ICache _cache;
private readonly CacheOptions _cacheOptions; private readonly CacheOptions _cacheOptions;
private readonly ILogger<SysCacheService> _logger;
public SysCacheService(IOptions<CacheOptions> cacheOptions, Func<string, ISingleton, object> resolveNamed) public SysCacheService(IOptions<CacheOptions> cacheOptions, ILogger<SysCacheService> logger, Func<string, ISingleton, object> resolveNamed)
{ {
_logger = logger;
_cacheOptions = cacheOptions.Value; _cacheOptions = cacheOptions.Value;
_cache = resolveNamed(_cacheOptions.CacheType.ToString(), default) as ICache; _cache = resolveNamed(_cacheOptions.CacheType.ToString(), default) as ICache;
} }
@ -444,7 +447,8 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns> /// <returns></returns>
public Task SetAllCodeVessel(List<CodeVessel> list) public Task SetAllCodeVessel(List<CodeVessel> list)
{ {
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_VESSEL, list); _logger.LogInformation("接收到缓存船名");
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_VESSEL, list.ToJsonString());
} }
/// <summary> /// <summary>

@ -845,7 +845,9 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction] [NonAction]
public async Task<List<CodeVessel>> GetAllVessel() public async Task<List<CodeVessel>> GetAllVessel()
{ {
_logger.LogInformation("缓存船名!");
var list = await _codeVesselRep.ToListAsync(); var list = await _codeVesselRep.ToListAsync();
_logger.LogInformation(list.ToJsonString());
await _sysCacheService.SetAllCodeVessel(list); await _sysCacheService.SetAllCodeVessel(list);
return list; return list;
} }

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Collections.Generic; using System.Collections.Generic;
using Myshipping.Core.Entity.CommonDB;
namespace Myshipping.Core.Service; namespace Myshipping.Core.Service;
@ -114,4 +115,8 @@ public interface ICommonDBService
/// 运输服务映射 /// 运输服务映射
/// </summary> /// </summary>
Task<List<MappingService>> GetAllMappingService(); Task<List<MappingService>> GetAllMappingService();
/// <summary>
/// 签单方式
/// </summary>
Task<List<CodeIssueType>> GetAllCodeIssueType();
} }

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>

@ -114,7 +114,7 @@ public class Startup : AppStartup
}); });
#region 缓存 #region 缓存
//船公司 //船公司
App.GetService<ICommonDBService>().GetAllCarrier(); App.GetService<ICommonDBService>().GetAllCarrier();
@ -168,9 +168,13 @@ public class Startup : AppStartup
//包装映射 //包装映射
App.GetService<ICommonDBService>().GetAllMappingPackage(); App.GetService<ICommonDBService>().GetAllMappingPackage();
//运输服务映射 //运输服务映射
App.GetService<ICommonDBService>().GetAllMappingService(); App.GetService<ICommonDBService>().GetAllMappingService();
//签单方式
App.GetService<ICommonDBService>().GetAllCodeIssueType();
//缓存EDI数据 //缓存EDI数据
App.GetService<IDjyEdiSettingService>().CacheData(); App.GetService<IDjyEdiSettingService>().CacheData();

Loading…
Cancel
Save