|
|
|
@ -896,9 +896,17 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
|
|
|
|
|
#region 实现接口,获取公共数据并缓存
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllCarrier()
|
|
|
|
|
public async Task GetAllCarrier(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CARRIER))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CARRIER))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeCarrierRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeCarrier(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeCarrierRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeCarrier(list);
|
|
|
|
@ -907,202 +915,375 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingCarrier()
|
|
|
|
|
public async Task GetAllMappingCarrier(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CARRIER))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CARRIER))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingCarrierRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingCarrier(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingCarrierRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingCarrier(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllVessel()
|
|
|
|
|
public async Task GetAllVessel(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_VESSEL))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_VESSEL))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeVesselRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeVessel(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeVesselRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeVessel(list);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingVessel()
|
|
|
|
|
public async Task GetAllMappingVessel(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingVesselRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingVessel(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingVesselRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingVessel(list);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingYard()
|
|
|
|
|
public async Task GetAllMappingYard(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_YARD))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_YARD))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingYardRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingYard(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingYardRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingYard(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllForwarder()
|
|
|
|
|
public async Task GetAllForwarder(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeForwarderRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeForwarder(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codeForwarderRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeForwarder(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllYard()
|
|
|
|
|
public async Task GetAllYard(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_YARD))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_YARD))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeYardRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeYard(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codeYardRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeYard(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllPortload()
|
|
|
|
|
public async Task GetAllPortload(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codePortLoadrRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePortLoad(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codePortLoadrRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePortLoad(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllPort()
|
|
|
|
|
public async Task GetAllPort(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PORT))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PORT))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codePortRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePort(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codePortRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePort(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllPackage()
|
|
|
|
|
public async Task GetAllPackage(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codePackageRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePackage(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codePackageRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePackage(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllService()
|
|
|
|
|
public async Task GetAllService(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_SERVICE))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_SERVICE))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeServiceRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeService(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeServiceRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeService(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllCtn()
|
|
|
|
|
public async Task GetAllCtn(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CTN))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CTN))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeCtnRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeCtn(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeCtnRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeCtn(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingCtn()
|
|
|
|
|
public async Task GetAllMappingCtn(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CTN))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CTN))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingCtnRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingCtn(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingCtnRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingCtn(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllFrt()
|
|
|
|
|
public async Task GetAllFrt(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_FRT))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_FRT))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeFrtRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeFrt(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeFrtRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeFrt(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingFrt()
|
|
|
|
|
public async Task GetAllMappingFrt(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_FRT))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_FRT))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingFrtRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingFrt(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingFrtRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingFrt(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingPortLoad()
|
|
|
|
|
public async Task GetAllMappingPortLoad(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORTLOAD))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORTLOAD))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingPortLoadRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPortLoad(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingPortLoadRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPortLoad(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingPort()
|
|
|
|
|
public async Task GetAllMappingPort(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORT))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORT))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingPortRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPort(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingPortRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPort(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingPackage()
|
|
|
|
|
public async Task GetAllMappingPackage(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PACKAGE))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PACKAGE))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingPackageRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPackage(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingPackageRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPackage(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllMappingService()
|
|
|
|
|
public async Task GetAllMappingService(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE))
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingServiceRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingService(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _mappingServiceRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingService(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task GetAllCodeIssueType()
|
|
|
|
|
public async Task GetAllCodeIssueType(bool flag = false)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE))
|
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CODEISSUETYPE))
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeIssueTypeRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeIssueType(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeIssueTypeRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeIssueType(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|