|
|
@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using Myshipping.Core.Service.CommonDB.Dto;
|
|
|
|
using Myshipping.Core.Service.CommonDB.Dto;
|
|
|
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Core.Service;
|
|
|
|
namespace Myshipping.Core.Service;
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -39,7 +40,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
private readonly SqlSugarRepository<MappingPackage> _mappingPackageRep;
|
|
|
|
private readonly SqlSugarRepository<MappingPackage> _mappingPackageRep;
|
|
|
|
private readonly SqlSugarRepository<MappingService> _mappingServiceRep;
|
|
|
|
private readonly SqlSugarRepository<MappingService> _mappingServiceRep;
|
|
|
|
private readonly ISysCacheService _sysCacheService;
|
|
|
|
private readonly ISysCacheService _sysCacheService;
|
|
|
|
|
|
|
|
private readonly ILogger<CommonDBService> _logger;
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
|
SqlSugarRepository<CodeVessel> codeVesselRep,
|
|
|
|
SqlSugarRepository<CodeVessel> codeVesselRep,
|
|
|
|
SqlSugarRepository<CodeForwarder> codeForwarderRep,
|
|
|
|
SqlSugarRepository<CodeForwarder> codeForwarderRep,
|
|
|
@ -59,6 +60,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
SqlSugarRepository<MappingPort> mappingPortRep,
|
|
|
|
SqlSugarRepository<MappingPort> mappingPortRep,
|
|
|
|
SqlSugarRepository<MappingPackage> mappingPackageRep,
|
|
|
|
SqlSugarRepository<MappingPackage> mappingPackageRep,
|
|
|
|
SqlSugarRepository<MappingService> mappingServiceRep,
|
|
|
|
SqlSugarRepository<MappingService> mappingServiceRep,
|
|
|
|
|
|
|
|
ILogger<CommonDBService> logger,
|
|
|
|
ISysCacheService sysCacheService)
|
|
|
|
ISysCacheService sysCacheService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
@ -81,6 +83,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
_mappingPortRep = mappingPortRep;
|
|
|
|
_mappingPortRep = mappingPortRep;
|
|
|
|
_mappingPackageRep = mappingPackageRep;
|
|
|
|
_mappingPackageRep = mappingPackageRep;
|
|
|
|
_mappingServiceRep = mappingServiceRep;
|
|
|
|
_mappingServiceRep = mappingServiceRep;
|
|
|
|
|
|
|
|
_logger = logger;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -786,6 +790,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
public async Task<List<CodeCarrier>> GetAllCarrier()
|
|
|
|
public async Task<List<CodeCarrier>> GetAllCarrier()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var list = await _codeCarrierRep.ToListAsync();
|
|
|
|
var list = await _codeCarrierRep.ToListAsync();
|
|
|
|
|
|
|
|
_logger.LogInformation("船公司缓存");
|
|
|
|
|
|
|
|
_logger.LogInformation(list.ToJsonString());
|
|
|
|
await _sysCacheService.SetAllCodeCarrier(list);
|
|
|
|
await _sysCacheService.SetAllCodeCarrier(list);
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|