booking_auth_dev
wet 2 years ago
parent d8cb5d6970
commit fd7e0c1682

@ -6445,7 +6445,7 @@
获取船公司映射列表信息 获取船公司映射列表信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddOrUpdateCarrier(Myshipping.Core.Entity.MappingCarrier)"> <member name="M:Myshipping.Core.Service.CommonDBService.AddOrUpdateMappingCarrier(Myshipping.Core.Entity.MappingCarrier)">
<summary> <summary>
新增编辑船公司映射信息 新增编辑船公司映射信息
</summary> </summary>
@ -6457,7 +6457,17 @@
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddVessel(Myshipping.Core.Entity.CodeVessel)"> <member name="M:Myshipping.Core.Service.CommonDBService.AddVessel(Myshipping.Core.Entity.CodeVessel)">
<summary> <summary>
新增船公司信息 新增船名信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.MappingVesselList(Myshipping.Core.Service.MappingQueryDto)">
<summary>
获取船名映射
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddOrUpdateMappingVessel(Myshipping.Core.Entity.MappingVessel)">
<summary>
新增编辑船名映射信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.ForwarderList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.ForwarderList(Myshipping.Core.Service.NameQueryDto)">
@ -6465,36 +6475,81 @@
获取船代列表信息 获取船代列表信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddForwarder(Myshipping.Core.Entity.CodeForwarder)">
<summary>
新增船代信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.YardList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.YardList(Myshipping.Core.Service.NameQueryDto)">
<summary> <summary>
获取场站列表信息 获取场站列表信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddYard(Myshipping.Core.Entity.CodeYard)">
<summary>
新增场站信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.PortloadList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.PortloadList(Myshipping.Core.Service.NameQueryDto)">
<summary> <summary>
获取起始港信息 获取起始港信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddPortload(Myshipping.Core.Entity.CodePortLoad)">
<summary>
新增起始港信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.PortList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.PortList(Myshipping.Core.Service.NameQueryDto)">
<summary> <summary>
获取目的港信息 获取目的港信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddPort(Myshipping.Core.Entity.CodePort)">
<summary>
新增目的港信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.PackageList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.PackageList(Myshipping.Core.Service.NameQueryDto)">
<summary> <summary>
获取包装信息 获取包装信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddPackage(Myshipping.Core.Entity.CodePackage)">
<summary>
新增包装信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.ServiceList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.ServiceList(Myshipping.Core.Service.NameQueryDto)">
<summary> <summary>
获取运输条款信息 获取运输条款信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddService(Myshipping.Core.Entity.CodeService)">
<summary>
新增运输条款
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.CtnList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.CtnList(Myshipping.Core.Service.NameQueryDto)">
<summary> <summary>
获取箱型信息 获取箱型信息
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddCtn(Myshipping.Core.Entity.CodeCtn)">
<summary>
新增箱型
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.MappingCtnList(Myshipping.Core.Service.MappingQueryDto)">
<summary>
获取箱型映射列表信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddOrUpdateMappingCtn(Myshipping.Core.Entity.MappingCtn)">
<summary>
新增编辑船公司映射信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.FrtList(Myshipping.Core.Service.NameQueryDto)"> <member name="M:Myshipping.Core.Service.CommonDBService.FrtList(Myshipping.Core.Service.NameQueryDto)">
<summary> <summary>
付费方式 付费方式
@ -6533,6 +6588,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllMappingVessel">
<summary>
获取船名映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllForwarder"> <member name="M:Myshipping.Core.Service.ICommonDBService.GetAllForwarder">
<summary> <summary>
获取船代 获取船代
@ -8128,7 +8189,7 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Core.Service.DjyTenantParamService.Get(System.String)"> <member name="M:Myshipping.Core.Service.DjyTenantParamService.List(System.String)">
<summary> <summary>
获取租户参数类别 获取租户参数类别
</summary> </summary>

@ -22,6 +22,9 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
private readonly SqlSugarRepository<MappingCarrier> _mappingCarrierRep; private readonly SqlSugarRepository<MappingCarrier> _mappingCarrierRep;
private readonly SqlSugarRepository<CodeVessel> _codeVesselRep; private readonly SqlSugarRepository<CodeVessel> _codeVesselRep;
private readonly SqlSugarRepository<MappingVessel> _mappingVesselRep;
private readonly SqlSugarRepository<CodeForwarder> _codeForwarderRep; private readonly SqlSugarRepository<CodeForwarder> _codeForwarderRep;
private readonly SqlSugarRepository<CodeYard> _codeYardRep; private readonly SqlSugarRepository<CodeYard> _codeYardRep;
private readonly SqlSugarRepository<CodePortLoad> _codePortLoadrRep; private readonly SqlSugarRepository<CodePortLoad> _codePortLoadrRep;
@ -29,7 +32,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
private readonly SqlSugarRepository<CodePackage> _codePackageRep; private readonly SqlSugarRepository<CodePackage> _codePackageRep;
private readonly SqlSugarRepository<CodeService> _codeServiceRep; private readonly SqlSugarRepository<CodeService> _codeServiceRep;
private readonly SqlSugarRepository<CodeCtn> _codeCtnRep; private readonly SqlSugarRepository<CodeCtn> _codeCtnRep;
private readonly SqlSugarRepository<MappingCtn> _mappingCtnRep;
private readonly SqlSugarRepository<CodeFrt> _codeFrtRep; private readonly SqlSugarRepository<CodeFrt> _codeFrtRep;
private readonly SqlSugarRepository<MappingFrt> _mappingFrtRep;
private readonly ISysCacheService _sysCacheService; private readonly ISysCacheService _sysCacheService;
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep, public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
@ -43,6 +50,9 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
SqlSugarRepository<CodeCtn> codeCtnRep, SqlSugarRepository<CodeCtn> codeCtnRep,
SqlSugarRepository<CodeFrt> codeFrtRep, SqlSugarRepository<CodeFrt> codeFrtRep,
SqlSugarRepository<MappingCarrier> mappingCarrierRep, SqlSugarRepository<MappingCarrier> mappingCarrierRep,
SqlSugarRepository<MappingVessel> mappingVesselRep,
SqlSugarRepository<MappingCtn> mappingCtnRep,
SqlSugarRepository<MappingFrt> mappingFrtRep,
ISysCacheService sysCacheService) ISysCacheService sysCacheService)
{ {
_codeCarrierRep = codeCarrierRep; _codeCarrierRep = codeCarrierRep;
@ -56,8 +66,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
_codeCtnRep = codeCtnRep; _codeCtnRep = codeCtnRep;
_codeFrtRep = codeFrtRep; _codeFrtRep = codeFrtRep;
_mappingCarrierRep = mappingCarrierRep; _mappingCarrierRep = mappingCarrierRep;
_mappingVesselRep = mappingVesselRep;
_mappingCtnRep = mappingCtnRep;
_mappingFrtRep = mappingFrtRep;
_sysCacheService = sysCacheService; _sysCacheService = sysCacheService;
} }
@ -68,7 +82,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[HttpGet("/commondb/carrierlist")] [HttpGet("/commondb/carrierlist")]
public async Task<dynamic> CarrierList([FromQuery] CodeCnEnQueryDto input) public async Task<dynamic> CarrierList([FromQuery] CodeCnEnQueryDto input)
{ {
var list = await GetAllCarrier(); var list = await _sysCacheService.GetAllCodeCarrier();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase)) var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
.WhereIF(!string.IsNullOrEmpty(input.CnName), x => x.Code.Contains(input.CnName)) .WhereIF(!string.IsNullOrEmpty(input.CnName), x => x.Code.Contains(input.CnName))
.WhereIF(!string.IsNullOrEmpty(input.EnName), x => x.Code.Contains(input.EnName, System.StringComparison.CurrentCultureIgnoreCase)); .WhereIF(!string.IsNullOrEmpty(input.EnName), x => x.Code.Contains(input.EnName, System.StringComparison.CurrentCultureIgnoreCase));
@ -79,7 +93,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增船公司信息 /// 新增船公司信息
/// </summary> /// </summary>
[HttpPost("/commondb/addcarrier")] [HttpPost("/commondb/addcarrier")]
public async Task AddCarrier(CodeCarrier dto) public async Task AddCarrier([FromBody] CodeCarrier dto)
{ {
var entity = dto.Adapt<CodeCarrier>(); var entity = dto.Adapt<CodeCarrier>();
await _codeCarrierRep.InsertAsync(entity); await _codeCarrierRep.InsertAsync(entity);
@ -92,7 +106,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[HttpGet("/commondb/mappingcarrierlist")] [HttpGet("/commondb/mappingcarrierlist")]
public async Task<dynamic> MappingCarrierList([FromQuery] MappingQueryDto input) public async Task<dynamic> MappingCarrierList([FromQuery] MappingQueryDto input)
{ {
var list = await GetAllMappingCarrier(); var list = await _sysCacheService.GetAllMappingCarrier();
var queryList = list var queryList = list
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase)) .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
@ -105,8 +119,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// <summary> /// <summary>
/// 新增编辑船公司映射信息 /// 新增编辑船公司映射信息
/// </summary> /// </summary>
[HttpPost("/commondb/addorupdatecarrier")] [HttpPost("/commondb/addorupdatemappingcarrier")]
public async Task AddOrUpdateCarrier(MappingCarrier dto) public async Task AddOrUpdateMappingCarrier([FromBody] MappingCarrier dto)
{ {
var entity = dto.Adapt<MappingCarrier>(); var entity = dto.Adapt<MappingCarrier>();
if (string.IsNullOrWhiteSpace(dto.GID)) if (string.IsNullOrWhiteSpace(dto.GID))
@ -138,7 +152,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
return new List<CodeVessel>(); return new List<CodeVessel>();
} }
List<CodeVessel> list = await GetAllVessel(); List<CodeVessel> list = await _sysCacheService.GetAllCodeVessel();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
@ -150,59 +164,136 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增船名信息 /// 新增船名信息
/// </summary> /// </summary>
[HttpPost("/commondb/addvessel")] [HttpPost("/commondb/addvessel")]
public async Task AddVessel(CodeVessel dto) public async Task AddVessel([FromBody] CodeVessel dto)
{ {
var entity = dto.Adapt<CodeVessel>(); var entity = dto.Adapt<CodeVessel>();
await _codeVesselRep.InsertAsync(entity); await _codeVesselRep.InsertAsync(entity);
await GetAllVessel();
}
/// <summary>
/// 获取船名映射
/// </summary>
[HttpGet("/commondb/mappingvessellist")]
public async Task<dynamic> MappingVesselList([FromQuery] MappingQueryDto input)
{
//数量太多,不允许查询全部
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
{
return new List<MappingVessel>();
} }
List<MappingVessel> list = await _sysCacheService.GetAllMappingVessel();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.Name.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
/// <summary>
/// 新增编辑船名映射信息
/// </summary>
[HttpPost("/commondb/addorupdatevessel")]
public async Task AddOrUpdateMappingVessel([FromBody] MappingVessel dto)
{
var entity = dto.Adapt<MappingVessel>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
await _mappingVesselRep.InsertAsync(entity);
}
else
{
await _mappingVesselRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
await GetAllMappingVessel();
}
#endregion #endregion
#region 船代
/// <summary> /// <summary>
/// 获取船代列表信息 /// 获取船代列表信息
/// </summary> /// </summary>
[HttpGet("/commondb/forwarderlist")] [HttpGet("/commondb/forwarderlist")]
public async Task<dynamic> ForwarderList([FromQuery] NameQueryDto input) public async Task<dynamic> ForwarderList([FromQuery] NameQueryDto input)
{ {
List<CodeForwarder> list = await GetAllForwarder(); List<CodeForwarder> list = await _sysCacheService.GetAllCodeForwarder();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增船代信息
/// </summary>
[HttpPost("/commondb/addforwarder")]
public async Task AddForwarder([FromBody] CodeForwarder dto)
{
var entity = dto.Adapt<CodeForwarder>();
await _codeForwarderRep.InsertAsync(entity);
await GetAllForwarder();
}
#endregion
#region 场站
/// <summary> /// <summary>
/// 获取场站列表信息 /// 获取场站列表信息
/// </summary> /// </summary>
[HttpGet("/commondb/yardlist")] [HttpGet("/commondb/yardlist")]
public async Task<dynamic> YardList([FromQuery] NameQueryDto input) public async Task<dynamic> YardList([FromQuery] NameQueryDto input)
{ {
List<CodeYard> list = await GetAllYard(); List<CodeYard> list = await _sysCacheService.GetAllCodeYard();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增场站信息
/// </summary>
[HttpPost("/commondb/addyard")]
public async Task AddYard([FromBody] CodeYard dto)
{
var entity = dto.Adapt<CodeYard>();
await _codeYardRep.InsertAsync(entity);
await GetAllYard();
}
#endregion
#region 起始港
/// <summary> /// <summary>
/// 获取起始港信息 /// 获取起始港信息
/// </summary> /// </summary>
[HttpGet("/commondb/portloadlist")] [HttpGet("/commondb/portloadlist")]
public async Task<dynamic> PortloadList([FromQuery] NameQueryDto input) public async Task<dynamic> PortloadList([FromQuery] NameQueryDto input)
{ {
List<CodePortLoad> list = await GetAllPortload(); List<CodePortLoad> list = await _sysCacheService.GetAllCodePortLoad();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增起始港信息
/// </summary>
[HttpPost("/commondb/addportload")]
public async Task AddPortload([FromBody] CodePortLoad dto)
{
var entity = dto.Adapt<CodePortLoad>();
await _codePortLoadrRep.InsertAsync(entity);
await GetAllPortload();
}
#endregion
#region 目的港
/// <summary> /// <summary>
/// 获取目的港信息 /// 获取目的港信息
/// </summary> /// </summary>
@ -215,68 +306,209 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
return new List<CodePortLoad>(); return new List<CodePortLoad>();
} }
List<CodePort> list = await GetAllPort(); List<CodePort> list = await _sysCacheService.GetAllCodePort();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增目的港信息
/// </summary>
[HttpPost("/commondb/addport")]
public async Task AddPort([FromBody] CodePort dto)
{
var entity = dto.Adapt<CodePort>();
await _codePortRep.InsertAsync(entity);
await GetAllPort();
}
#endregion
#region 包装
/// <summary> /// <summary>
/// 获取包装信息 /// 获取包装信息
/// </summary> /// </summary>
[HttpGet("/commondb/package")] [HttpGet("/commondb/package")]
public async Task<dynamic> PackageList([FromQuery] NameQueryDto input) public async Task<dynamic> PackageList([FromQuery] NameQueryDto input)
{ {
List<CodePackage> list = await GetAllPackage(); List<CodePackage> list = await _sysCacheService.GetAllCodePackage();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增包装信息
/// </summary>
[HttpPost("/commondb/addpackage")]
public async Task AddPackage([FromBody] CodePackage dto)
{
var entity = dto.Adapt<CodePackage>();
await _codePackageRep.InsertAsync(entity);
await GetAllPackage();
}
#endregion
#region 运输条款
/// <summary> /// <summary>
/// 获取运输条款信息 /// 获取运输条款信息
/// </summary> /// </summary>
[HttpGet("/commondb/service")] [HttpGet("/commondb/service")]
public async Task<dynamic> ServiceList([FromQuery] NameQueryDto input) public async Task<dynamic> ServiceList([FromQuery] NameQueryDto input)
{ {
List<CodeService> list = await GetAllService(); List<CodeService> list = await _sysCacheService.GetAllCodeService();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增运输条款
/// </summary>
[HttpPost("/commondb/addservice")]
public async Task AddService([FromBody] CodeService dto)
{
var entity = dto.Adapt<CodeService>();
await _codeServiceRep.InsertAsync(entity);
await GetAllService();
}
#endregion
#region 箱型
/// <summary> /// <summary>
/// 获取箱型信息 /// 获取箱型信息
/// </summary> /// </summary>
[HttpGet("/commondb/ctn")] [HttpGet("/commondb/ctn")]
public async Task<dynamic> CtnList([FromQuery] NameQueryDto input) public async Task<dynamic> CtnList([FromQuery] NameQueryDto input)
{ {
List<CodeCtn> list = await GetAllCtn(); List<CodeCtn> list = await _sysCacheService.GetAllCodeCtn();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增箱型
/// </summary>
[HttpPost("/commondb/addctn")]
public async Task AddCtn([FromBody] CodeCtn dto)
{
var entity = dto.Adapt<CodeCtn>();
await _codeCtnRep.InsertAsync(entity);
await GetAllCtn();
}
/// <summary>
/// 获取箱型映射列表信息
/// </summary>
[HttpGet("/commondb/mappingctnlist")]
public async Task<dynamic> MappingCtnList([FromQuery] MappingQueryDto input)
{
var list = await _sysCacheService.GetAllMappingCtn();
var queryList = list
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
.WhereIF(!string.IsNullOrEmpty(input.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.Code.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
/// <summary>
/// 新增编辑箱型映射信息
/// </summary>
[HttpPost("/commondb/addmappingctn")]
public async Task AddOrUpdateMappingCtn([FromBody] MappingCtn dto)
{
var entity = dto.Adapt<MappingCtn>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
await _mappingCtnRep.InsertAsync(entity);
}
else
{
await _mappingCtnRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
await GetAllMappingCtn();
}
#endregion
#region 付费方式
/// <summary> /// <summary>
/// 付费方式 /// 付费方式
/// </summary> /// </summary>
[HttpGet("/commondb/frt")] [HttpGet("/commondb/frt")]
public async Task<dynamic> FrtList([FromQuery] NameQueryDto input) public async Task<dynamic> FrtList([FromQuery] NameQueryDto input)
{ {
List<CodeFrt> list = await GetAllFrt(); List<CodeFrt> list = await _sysCacheService.GetAllCodeFrt();
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase)); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList(); return queryList.ToList();
} }
/// <summary>
/// 新增付费方式
/// </summary>
[HttpPost("/commondb/addfrt")]
public async Task AddFrt([FromBody] CodeFrt dto)
{
var entity = dto.Adapt<CodeFrt>();
await _codeFrtRep.InsertAsync(entity);
await GetAllFrt();
}
/// <summary>
/// 获取付费映射列表信息
/// </summary>
[HttpGet("/commondb/mappingfrtlist")]
public async Task<dynamic> MappingFrtList([FromQuery] MappingQueryDto input)
{
var list = await _sysCacheService.GetAllMappingFrt();
var queryList = list
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
.WhereIF(!string.IsNullOrEmpty(input.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.Code.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
/// <summary>
/// 新增编辑付费映射信息
/// </summary>
[HttpPost("/commondb/addmappingfrt")]
public async Task AddOrUpdateMappingFrt([FromBody] MappingFrt dto)
{
var entity = dto.Adapt<MappingFrt>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
await _mappingFrtRep.InsertAsync(entity);
}
else
{
await _mappingFrtRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
await GetAllMappingFrt();
}
#endregion
@ -300,161 +532,119 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
return list; return list;
} }
[NonAction]
public async Task CacheMappingCarrier()
{
var list = await _mappingCarrierRep.ToListAsync();
await _sysCacheService.SetAllMappingCarrier(list);
}
[NonAction] [NonAction]
public async Task<List<CodeVessel>> GetAllVessel() public async Task<List<CodeVessel>> GetAllVessel()
{
var list = await _sysCacheService.GetAllCodeVessel();
if (list != null && list.Count > 0)
{
return list;
}
else
{
list = await _codeVesselRep.ToListAsync();
await _sysCacheService.SetAllCodeVessel(list);
return list;
}
}
public async Task CacheVessel()
{ {
var list = await _codeVesselRep.ToListAsync(); var list = await _codeVesselRep.ToListAsync();
await _sysCacheService.SetAllCodeVessel(list); await _sysCacheService.SetAllCodeVessel(list);
return list;
} }
[NonAction] [NonAction]
public async Task<List<CodeForwarder>> GetAllForwarder() public async Task<List<MappingVessel>> GetAllMappingVessel()
{
var list = await _sysCacheService.GetAllCodeForwarder();
if (list != null && list.Count > 0)
{ {
var list = await _mappingVesselRep.ToListAsync();
await _sysCacheService.SetAllMappingVessel(list);
return list; return list;
} }
else
[NonAction]
public async Task<List<CodeForwarder>> GetAllForwarder()
{ {
list = await _codeForwarderRep.ToListAsync(); var list = await _codeForwarderRep.ToListAsync();
await _sysCacheService.SetAllCodeForwarder(list); await _sysCacheService.SetAllCodeForwarder(list);
return list; return list;
} }
}
[NonAction] [NonAction]
public async Task<List<CodeYard>> GetAllYard() public async Task<List<CodeYard>> GetAllYard()
{ {
var list = await _sysCacheService.GetAllCodeYard();
if (list != null && list.Count > 0) var list = await _codeYardRep.ToListAsync();
{
return list;
}
else
{
list = await _codeYardRep.ToListAsync();
await _sysCacheService.SetAllCodeYard(list); await _sysCacheService.SetAllCodeYard(list);
return list; return list;
}
} }
[NonAction] [NonAction]
public async Task<List<CodePortLoad>> GetAllPortload() public async Task<List<CodePortLoad>> GetAllPortload()
{ {
var list = await _sysCacheService.GetAllCodePortLoad();
if (list != null && list.Count > 0) var list = await _codePortLoadrRep.ToListAsync();
{
return list;
}
else
{
list = await _codePortLoadrRep.ToListAsync();
await _sysCacheService.SetAllCodePortLoad(list); await _sysCacheService.SetAllCodePortLoad(list);
return list; return list;
}
} }
[NonAction] [NonAction]
public async Task<List<CodePort>> GetAllPort() public async Task<List<CodePort>> GetAllPort()
{ {
var list = await _sysCacheService.GetAllCodePort();
if (list != null && list.Count > 0) var list = await _codePortRep.ToListAsync();
{
return list;
}
else
{
list = await _codePortRep.ToListAsync();
await _sysCacheService.SetAllCodePort(list); await _sysCacheService.SetAllCodePort(list);
return list; return list;
}
} }
[NonAction] [NonAction]
public async Task<List<CodePackage>> GetAllPackage() public async Task<List<CodePackage>> GetAllPackage()
{ {
var list = await _sysCacheService.GetAllCodePackage();
if (list != null && list.Count > 0) var list = await _codePackageRep.ToListAsync();
{
return list;
}
else
{
list = await _codePackageRep.ToListAsync();
await _sysCacheService.SetAllCodePackage(list); await _sysCacheService.SetAllCodePackage(list);
return list; return list;
}
} }
[NonAction] [NonAction]
public async Task<List<CodeService>> GetAllService() public async Task<List<CodeService>> GetAllService()
{ {
var list = await _sysCacheService.GetAllCodeService();
if (list != null && list.Count > 0) var list = await _codeServiceRep.ToListAsync();
{
return list;
}
else
{
list = await _codeServiceRep.ToListAsync();
await _sysCacheService.SetAllCodeService(list); await _sysCacheService.SetAllCodeService(list);
return list; return list;
}
} }
[NonAction] [NonAction]
public async Task<List<CodeCtn>> GetAllCtn() public async Task<List<CodeCtn>> GetAllCtn()
{ {
var list = await _sysCacheService.GetAllCodeCtn(); var list = await _codeCtnRep.ToListAsync();
if (list != null && list.Count > 0) await _sysCacheService.SetAllCodeCtn(list);
{
return list; return list;
} }
else [NonAction]
public async Task<List<MappingCtn>> GetAllMappingCtn()
{ {
list = await _codeCtnRep.ToListAsync();
await _sysCacheService.SetAllCodeCtn(list); var list = await _mappingCtnRep.ToListAsync();
await _sysCacheService.SetAllMappingCtn(list);
return list; return list;
}
}
}
[NonAction] [NonAction]
public async Task<List<CodeFrt>> GetAllFrt() public async Task<List<CodeFrt>> GetAllFrt()
{ {
var list = await _sysCacheService.GetAllCodeFrt();
if (list != null && list.Count > 0) var list = await _codeFrtRep.ToListAsync();
{ await _sysCacheService.SetAllCodeFrt(list);
return list; return list;
} }
else [NonAction]
public async Task<List<MappingFrt>> GetAllMappingFrt()
{ {
list = await _codeFrtRep.ToListAsync();
await _sysCacheService.SetAllCodeFrt(list); var list = await _mappingFrtRep.ToListAsync();
await _sysCacheService.SetAllMappingFrt(list);
return list; return list;
}
}
}
#endregion #endregion

@ -24,6 +24,12 @@ public interface ICommonDBService
/// <returns></returns> /// <returns></returns>
Task<List<CodeVessel>> GetAllVessel(); Task<List<CodeVessel>> GetAllVessel();
/// <summary>
/// 获取船名映射
/// </summary>
/// <returns></returns>
Task<List<MappingVessel>> GetAllMappingVessel();
/// <summary> /// <summary>
/// 获取船代 /// 获取船代
/// </summary> /// </summary>
@ -66,4 +72,21 @@ public interface ICommonDBService
/// <returns></returns> /// <returns></returns>
Task<List<CodeCtn>> GetAllCtn(); Task<List<CodeCtn>> GetAllCtn();
/// <summary>
/// 获取箱型映射
/// </summary>
/// <returns></returns>
Task<List<MappingCtn>> GetAllMappingCtn();
/// <summary>
/// 付费方式
/// </summary>
/// <returns></returns>
Task<List<CodeFrt>> GetAllFrt();
/// <summary>
/// 付费方式映射
/// </summary>
Task<List<MappingFrt>> GetAllMappingFrt();
} }

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System.Collections.Generic; using System.Collections.Generic;
using Myshipping.Core.Entity; using Myshipping.Core.Entity;
using System;
namespace Myshipping.Core.Service namespace Myshipping.Core.Service
{ {
@ -73,10 +74,10 @@ namespace Myshipping.Core.Service
/// 获取租户参数类别 /// 获取租户参数类别
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet("/DJYTenantParam/get")] [HttpGet("/DJYTenantParam/list")]
public async Task<List<DjyTenantParam>> Get(string Type) public async Task<List<DjyTenantParam>> List(string Type)
{ {
return await _rep.AsQueryable().Where(x => x.Type == Type).OrderBy(x => x.Sort).ToListAsync(); return await _rep.AsQueryable().WhereIF(!string.IsNullOrEmpty(Type),x => x.Type == Type).OrderBy(x => x.Sort).ToListAsync();
} }
/// <summary> /// <summary>
@ -86,7 +87,7 @@ namespace Myshipping.Core.Service
[HttpGet("/DJYTenantParam/getParamItem")] [HttpGet("/DJYTenantParam/getParamItem")]
public async Task<List<DjyTenantParamItem>> GetParamItem(string ParaCode) public async Task<List<DjyTenantParamItem>> GetParamItem(string ParaCode)
{ {
return await _itemrep.AsQueryable().Where(x => x.ParaCode == ParaCode).OrderBy(x => x.Sort).ToListAsync(); return await _itemrep.AsQueryable().WhereIF(!string.IsNullOrEmpty(ParaCode), x => x.ParaCode == ParaCode).OrderBy(x => x.Sort).ToListAsync();
} }
@ -139,6 +140,9 @@ namespace Myshipping.Core.Service
[HttpGet("/DJYTenantParam/getParamValue")] [HttpGet("/DJYTenantParam/getParamValue")]
public async Task<List<DjyTenantParamValue>> GetParamValue(long tenantId) public async Task<List<DjyTenantParamValue>> GetParamValue(long tenantId)
{ {
if (tenantId==0) {
tenantId = Convert.ToInt64(UserManager.TENANT_ID);
}
return await _valuerep.AsQueryable().Where(x => x.TenantId == tenantId).OrderBy(x => x.Sort).ToListAsync(); return await _valuerep.AsQueryable().Where(x => x.TenantId == tenantId).OrderBy(x => x.Sort).ToListAsync();
} }

@ -11,7 +11,7 @@ namespace Myshipping.Core.Service
Task Add(AddDJYTenantParamInput input); Task Add(AddDJYTenantParamInput input);
Task Update(UpdateDJYTenantParamInput input); Task Update(UpdateDJYTenantParamInput input);
Task Delete(long Id); Task Delete(long Id);
Task<List<DjyTenantParam>> Get(string Type); Task<List<DjyTenantParam>> List(string Type);
Task<List<DjyTenantParamItem>> GetParamItem(string ParaCode); Task<List<DjyTenantParamItem>> GetParamItem(string ParaCode);
Task AddParamItem(DjyTenantParamItem input); Task AddParamItem(DjyTenantParamItem input);

@ -110,6 +110,7 @@ public class Startup : AppStartup
// 注册 Log 日志订阅者 // 注册 Log 日志订阅者
builder.AddSubscriber<LogEventSubscriber>(); builder.AddSubscriber<LogEventSubscriber>();
}); });
#region 缓存
//缓存EDI数据 //缓存EDI数据
App.GetService<IDjyEdiSettingService>().CacheData(); App.GetService<IDjyEdiSettingService>().CacheData();
@ -119,6 +120,50 @@ public class Startup : AppStartup
//租户参数 //租户参数
App.GetService<IDjyTenantParamService>().CacheData(); App.GetService<IDjyTenantParamService>().CacheData();
//船公司
App.GetService<ICommonDBService>().GetAllCarrier();
//船公司映射
App.GetService<ICommonDBService>().GetAllMappingCarrier();
//船名
App.GetService<ICommonDBService>().GetAllVessel();
//船名映射
App.GetService<ICommonDBService>().GetAllMappingVessel();
//船代
App.GetService<ICommonDBService>().GetAllForwarder();
//场站
App.GetService<ICommonDBService>().GetAllYard();
//起始港
App.GetService<ICommonDBService>().GetAllPortload();
//目的港
App.GetService<ICommonDBService>().GetAllPort();
//包装
App.GetService<ICommonDBService>().GetAllPackage();
//运输方式
App.GetService<ICommonDBService>().GetAllService();
//箱型
App.GetService<ICommonDBService>().GetAllCtn();
//箱型映射
App.GetService<ICommonDBService>().GetAllMappingCtn();
//付费方式
App.GetService<ICommonDBService>().GetAllFrt();
//付费方式映射
App.GetService<ICommonDBService>().GetAllMappingFrt();
#endregion
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

Loading…
Cancel
Save