船名缓存

booking_auth_dev
wet 2 years ago
parent 9d69412ebb
commit 8fed094cd9

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

@ -2,6 +2,7 @@
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Myshipping.Core.Entity;
using Myshipping.Core.Entity.CommonDB;
@ -22,9 +23,11 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
{
private readonly ICache _cache;
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;
_cache = resolveNamed(_cacheOptions.CacheType.ToString(), default) as ICache;
}
@ -444,7 +447,8 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
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>

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

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

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

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

Loading…
Cancel
Save