|
|
@ -49,6 +49,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
private readonly SqlSugarRepository<RelaPortCarrierLane> _relaPortCarrierLaneRep;
|
|
|
|
private readonly SqlSugarRepository<RelaPortCarrierLane> _relaPortCarrierLaneRep;
|
|
|
|
private readonly SqlSugarRepository<CodeCountry> _codeCountryRep;
|
|
|
|
private readonly SqlSugarRepository<CodeCountry> _codeCountryRep;
|
|
|
|
private readonly SqlSugarRepository<MappingForwarder> _mappingForwarder;
|
|
|
|
private readonly SqlSugarRepository<MappingForwarder> _mappingForwarder;
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<CodeCity> _codeCityRep;
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<CodeProvince> _codeProvinceRep;
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
|
SqlSugarRepository<CodeVessel> codeVesselRep,
|
|
|
|
SqlSugarRepository<CodeVessel> codeVesselRep,
|
|
|
|
SqlSugarRepository<CodeForwarder> codeForwarderRep,
|
|
|
|
SqlSugarRepository<CodeForwarder> codeForwarderRep,
|
|
|
@ -65,19 +67,22 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
SqlSugarRepository<MappingFrt> mappingFrtRep,
|
|
|
|
SqlSugarRepository<MappingFrt> mappingFrtRep,
|
|
|
|
SqlSugarRepository<MappingYard> mappingYardRep,
|
|
|
|
SqlSugarRepository<MappingYard> mappingYardRep,
|
|
|
|
SqlSugarRepository<MappingPortLoad> mappingPortLoadRep,
|
|
|
|
SqlSugarRepository<MappingPortLoad> mappingPortLoadRep,
|
|
|
|
SqlSugarRepository<MappingPort> mappingPortRep,
|
|
|
|
SqlSugarRepository<MappingPort> mappingPortRep,
|
|
|
|
SqlSugarRepository<MappingPackage> mappingPackageRep,
|
|
|
|
SqlSugarRepository<MappingPackage> mappingPackageRep,
|
|
|
|
SqlSugarRepository<MappingService> mappingServiceRep,
|
|
|
|
SqlSugarRepository<MappingService> mappingServiceRep,
|
|
|
|
SqlSugarRepository<CodeIssueType> codeIssueTypeRep,
|
|
|
|
SqlSugarRepository<CodeIssueType> codeIssueTypeRep,
|
|
|
|
SqlSugarRepository<CommonModule> commonModuleRep,
|
|
|
|
SqlSugarRepository<CommonModule> commonModuleRep,
|
|
|
|
ILogger<CommonDBService> logger,
|
|
|
|
ILogger<CommonDBService> logger,
|
|
|
|
ISysCacheService sysCacheService,
|
|
|
|
ISysCacheService sysCacheService,
|
|
|
|
SqlSugarRepository<CodeLane> codeLaneRep,
|
|
|
|
SqlSugarRepository<CodeLane> codeLaneRep,
|
|
|
|
SqlSugarRepository<RelaPortCarrierLane> relaPortCarrierLaneRep,
|
|
|
|
SqlSugarRepository<RelaPortCarrierLane> relaPortCarrierLaneRep,
|
|
|
|
SqlSugarRepository<MappingIssueType> mappingIssueTypeRep,
|
|
|
|
SqlSugarRepository<MappingIssueType> mappingIssueTypeRep,
|
|
|
|
SqlSugarRepository<CodeCountry> codeCountryRep,
|
|
|
|
SqlSugarRepository<CodeCountry> codeCountryRep,
|
|
|
|
SqlSugarRepository<MappingForwarder> mappingForwarder)
|
|
|
|
SqlSugarRepository<MappingForwarder> mappingForwarder,
|
|
|
|
{
|
|
|
|
SqlSugarRepository<CodeCity> codeCityRep,
|
|
|
|
|
|
|
|
SqlSugarRepository<CodeProvince> codeProvinceRep
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
{
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
|
_codeVesselRep = codeVesselRep;
|
|
|
|
_codeVesselRep = codeVesselRep;
|
|
|
|
_codeForwarderRep = codeForwarderRep;
|
|
|
|
_codeForwarderRep = codeForwarderRep;
|
|
|
@ -106,6 +111,9 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
_codeCountryRep = codeCountryRep;
|
|
|
|
_codeCountryRep = codeCountryRep;
|
|
|
|
_mappingIssueTypeRep = mappingIssueTypeRep;
|
|
|
|
_mappingIssueTypeRep = mappingIssueTypeRep;
|
|
|
|
_mappingForwarder = mappingForwarder;
|
|
|
|
_mappingForwarder = mappingForwarder;
|
|
|
|
|
|
|
|
_codeCityRep = codeCityRep;
|
|
|
|
|
|
|
|
_codeProvinceRep = codeProvinceRep;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
@ -1357,7 +1365,36 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取省市
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取城市信息
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[HttpGet("/commondb/CodeCityList")]
|
|
|
|
|
|
|
|
public async Task<dynamic> CodeCityList(string Provincecode,string name)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<CodeCity> list = await _sysCacheService.GetAllCodeCity();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(Provincecode), x => x.ProvinceCode == Provincecode).WhereIF(!string.IsNullOrEmpty(name), x => x.CNName.Contains(name)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return queryList.OrderBy(x => x.Sort).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取省份信息
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[HttpGet("/commondb/CodeProvinceList")]
|
|
|
|
|
|
|
|
public async Task<dynamic> CodeProvinceList(string name)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<CodeProvince> list = await _sysCacheService.GetAllCodeProvince();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var queryList = list.Where( x => x.Country == "CN").WhereIF(!string.IsNullOrEmpty(name), x => x.CNName.Contains(name)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return queryList.OrderBy(x => x.Sort).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region 模块列表
|
|
|
|
#region 模块列表
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -2100,6 +2137,57 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取城市信息
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="flag"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
|
|
|
public async Task GetAllCity(bool flag = false)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (flag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_CITY))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var list = await _codeCityRep.AsQueryable().OrderBy(x => x.Sort).ToListAsync();
|
|
|
|
|
|
|
|
await _sysCacheService.SetAllCodeCity(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var list = await _codeCityRep.AsQueryable().OrderBy(x => x.Sort).ToListAsync();
|
|
|
|
|
|
|
|
await _sysCacheService.SetAllCodeCity(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取省份信息
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="flag"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
|
|
|
public async Task GetAllProvince(bool flag = false)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (flag)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!_sysCacheService.Exists(CommonConst.CACHE_KEY_COMMON_DB_PROVINCE))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var list = await _codeProvinceRep.AsQueryable().OrderBy(x => x.Sort).ToListAsync();
|
|
|
|
|
|
|
|
await _sysCacheService.SetAllCodeProvince(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var list = await _codeProvinceRep.AsQueryable().OrderBy(x => x.Sort).ToListAsync();
|
|
|
|
|
|
|
|
await _sysCacheService.SetAllCodeProvince(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|