booking_auth_dev
wet 2 years ago
parent 1e5eddd6a5
commit 89f3875f62

@ -647,6 +647,11 @@
船名映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_DICT_DATA">
<summary>
字典映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_DJY_EDI_SETTING">
<summary>
船名映射
@ -5416,6 +5421,19 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllDictData">
<summary>
获取字典
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllDictData(System.Collections.Generic.List{Myshipping.Core.Service.Dict.Dto.DictDataDto})">
<summary>
设置字典
</summary>
<param name="list"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllEdiSetting">
<summary>
获取EDI参数
@ -5784,6 +5802,18 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllDictData">
<summary>
获取字典缓存
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllDictData(System.Collections.Generic.List{Myshipping.Core.Service.Dict.Dto.DictDataDto})">
<summary>
设置字典参数
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllEdiSetting">
<summary>
获取EDI参数
@ -6880,6 +6910,13 @@
<param name="code"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysDictDataService.CacheData">
<summary>
缓存数据
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:Myshipping.Core.Service.SysDictTypeService">
<summary>
字典类型服务

@ -22,13 +22,14 @@ namespace Myshipping.Core.Service
private readonly SqlSugarRepository<DjyTenantParamItem> _itemrep;
private readonly SqlSugarRepository<DjyTenantParamValue> _valuerep;
private readonly ILogger<DjyTenantParam> _logger;
public DjyTenantParamService(SqlSugarRepository<DjyTenantParam> rep, SqlSugarRepository<DjyTenantParamItem> itemrep, SqlSugarRepository<DjyTenantParamValue> valuerep, ILogger<DjyTenantParam> logger)
private readonly ISysCacheService _cache;
public DjyTenantParamService(SqlSugarRepository<DjyTenantParam> rep, SqlSugarRepository<DjyTenantParamItem> itemrep, SqlSugarRepository<DjyTenantParamValue> valuerep, ISysCacheService cache, ILogger<DjyTenantParam> logger)
{
_rep = rep;
_logger = logger;
_itemrep = itemrep;
_valuerep = valuerep;
_cache = cache;
}
@ -112,6 +113,7 @@ namespace Myshipping.Core.Service
{
var entity = input.Adapt<DjyTenantParamItem>();
await _itemrep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
@ -126,6 +128,7 @@ namespace Myshipping.Core.Service
await _valuerep.DeleteAsync(m => m.ItemCode == entity.ItemCode && m.ParaCode == entity.ParaCode);
await _itemrep.DeleteAsync(entity);
}
@ -151,6 +154,7 @@ namespace Myshipping.Core.Service
{
var entity = input.Adapt<DjyTenantParamValue>();
await _valuerep.InsertAsync(entity);
await CacheData();
}
@ -163,6 +167,7 @@ namespace Myshipping.Core.Service
{
var entity = input.Adapt<DjyTenantParamValue>();
await _valuerep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
await CacheData();
}
/// <summary>
@ -176,5 +181,13 @@ namespace Myshipping.Core.Service
var entity = await _itemrep.FirstOrDefaultAsync(u => u.Id == Id);
await _valuerep.DeleteAsync(entity);
}
public async Task CacheData()
{
var list = await _valuerep.AsQueryable().ToListAsync();
await _cache.SetAllTenantParam(list);
}
}
}

@ -17,5 +17,7 @@ namespace Myshipping.Core.Service
Task UpdateParamItem(DjyTenantParamItem input);
Task DeleteParamItem(long Id);
Task CacheData();
}
}

@ -116,6 +116,9 @@ public class Startup : AppStartup
//缓存字典数据
App.GetService<ISysDictDataService>().CacheData();
//租户参数
App.GetService<IDjyTenantParamService>().CacheData();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

Loading…
Cancel
Save