|
|
|
@ -44,6 +44,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
private readonly SqlSugarRepository<CodeIssueType> _codeIssueTypeRep;
|
|
|
|
|
private readonly SqlSugarRepository<CommonModule> _commonModuleRep;
|
|
|
|
|
private readonly ILogger<CommonDBService> _logger;
|
|
|
|
|
private readonly SqlSugarRepository<CodeLane> _codeLaneRep;
|
|
|
|
|
private readonly SqlSugarRepository<RelaPortCarrierLane> _relaPortCarrierLaneRep;
|
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
|
|
SqlSugarRepository<CodeVessel> codeVesselRep,
|
|
|
|
|
SqlSugarRepository<CodeForwarder> codeForwarderRep,
|
|
|
|
@ -66,7 +68,9 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
SqlSugarRepository<CodeIssueType> codeIssueTypeRep,
|
|
|
|
|
SqlSugarRepository<CommonModule> commonModuleRep,
|
|
|
|
|
ILogger<CommonDBService> logger,
|
|
|
|
|
ISysCacheService sysCacheService)
|
|
|
|
|
ISysCacheService sysCacheService,
|
|
|
|
|
SqlSugarRepository<CodeLane> codeLaneRep,
|
|
|
|
|
SqlSugarRepository<RelaPortCarrierLane> relaPortCarrierLaneRep)
|
|
|
|
|
{
|
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
|
|
_codeVesselRep = codeVesselRep;
|
|
|
|
@ -91,7 +95,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
_codeIssueTypeRep = codeIssueTypeRep;
|
|
|
|
|
_commonModuleRep = commonModuleRep;
|
|
|
|
|
_logger = logger;
|
|
|
|
|
|
|
|
|
|
_codeLaneRep = codeLaneRep;
|
|
|
|
|
_relaPortCarrierLaneRep = relaPortCarrierLaneRep;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -1257,6 +1262,52 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取航线信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="flag"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllLane(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_LANE))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeLaneRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeLane(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeLaneRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeLane(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllRelaPortCarrierLane(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_LANE_PORT))
|
|
|
|
|
{
|
|
|
|
|
var list = await _relaPortCarrierLaneRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllRelaPortCarrierLane(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _relaPortCarrierLaneRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllRelaPortCarrierLane(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingCtn(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|