|
|
@ -141,7 +141,7 @@ namespace Myshipping.Application
|
|
|
|
[HttpGet("/FeeCode/List")]
|
|
|
|
[HttpGet("/FeeCode/List")]
|
|
|
|
public async Task<List<FeeCodeDto>> List()
|
|
|
|
public async Task<List<FeeCodeDto>> List()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = await _cache.GetAsync<List<FeeCodeDto>>(CommonConst.CACHE_KEY_FEE_CODE + "_" + UserManager.TENANT_ID);
|
|
|
|
var result = await _cache.GetAsync<List<FeeCodeDto>>(CommonConst.CACHE_KEY_FEE_CODE + ":" + UserManager.TENANT_ID);
|
|
|
|
if (result?.Any() != true)
|
|
|
|
if (result?.Any() != true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result = await CacheFeeCode();
|
|
|
|
result = await CacheFeeCode();
|
|
|
@ -165,7 +165,7 @@ namespace Myshipping.Application
|
|
|
|
foreach (var item in groupFeeCodeCache)
|
|
|
|
foreach (var item in groupFeeCodeCache)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var item2 = item.Adapt<List<FeeCodeDto>>();
|
|
|
|
var item2 = item.Adapt<List<FeeCodeDto>>();
|
|
|
|
await _cache.SetTimeoutAsync(CommonConst.CACHE_KEY_FEE_CODE + "_" + item.Key, item2, new TimeSpan(6, 0, 0));
|
|
|
|
await _cache.SetTimeoutAsync(CommonConst.CACHE_KEY_FEE_CODE + ":" + item.Key, item2, new TimeSpan(6, 0, 0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var result = groupFeeCodeCache.FirstOrDefault(x => x.Key == UserManager.TENANT_ID)?.Adapt<List<FeeCodeDto>>();
|
|
|
|
var result = groupFeeCodeCache.FirstOrDefault(x => x.Key == UserManager.TENANT_ID)?.Adapt<List<FeeCodeDto>>();
|
|
|
@ -176,7 +176,7 @@ namespace Myshipping.Application
|
|
|
|
// 否则只缓存当前租户的费用代码
|
|
|
|
// 否则只缓存当前租户的费用代码
|
|
|
|
var tenantFeeCode = await _repCode.AsQueryable().Filter(null, true).Where(x => !x.IsDeleted && x.TenantId == UserManager.TENANT_ID).ToListAsync();
|
|
|
|
var tenantFeeCode = await _repCode.AsQueryable().Filter(null, true).Where(x => !x.IsDeleted && x.TenantId == UserManager.TENANT_ID).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
await _cache.SetTimeoutAsync(CommonConst.CACHE_KEY_FEE_CODE + "_" + UserManager.TENANT_ID, tenantFeeCode, new TimeSpan(6, 0, 0));
|
|
|
|
await _cache.SetTimeoutAsync(CommonConst.CACHE_KEY_FEE_CODE + ":" + UserManager.TENANT_ID, tenantFeeCode, new TimeSpan(6, 0, 0));
|
|
|
|
|
|
|
|
|
|
|
|
var result = tenantFeeCode.Adapt<List<FeeCodeDto>>();
|
|
|
|
var result = tenantFeeCode.Adapt<List<FeeCodeDto>>();
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|