|
|
|
@ -88,7 +88,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
_mappingServiceRep = mappingServiceRep;
|
|
|
|
|
_codeIssueTypeRep = codeIssueTypeRep;
|
|
|
|
|
_logger = logger;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -118,7 +118,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codeCarrierRep.InsertAsync(entity);
|
|
|
|
|
await GetAllCarrier();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -128,11 +128,14 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
public async Task<dynamic> MappingCarrierList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingCarrier();
|
|
|
|
|
|
|
|
|
|
var queryList = list
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
@ -148,7 +151,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser =UserManager.DjyUserId;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingCarrierRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -174,11 +177,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Name) || input.Name.Length < 2)
|
|
|
|
|
{
|
|
|
|
|
return new List<CodeVessel>();
|
|
|
|
|
throw Oops.Bah("参数过多,请传入船名查询");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<CodeVessel> list = await _sysCacheService.GetAllCodeVessel();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -207,12 +209,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingVessel>();
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingVessel> list = await _sysCacheService.GetAllMappingVessel();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -310,12 +312,14 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingYard>();
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingYard> list = await _sysCacheService.GetAllMappingYard();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -386,12 +390,14 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingPortLoad>();
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingPortLoad> list = await _sysCacheService.GetAllMappingPortLoad();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -431,12 +437,6 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
[HttpGet("/commondb/portlist")]
|
|
|
|
|
public async Task<dynamic> PortList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Name) || input.Name.Length < 2)
|
|
|
|
|
{
|
|
|
|
|
return new List<CodePortLoad>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
@ -467,12 +467,14 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingPort>();
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingPort> list = await _sysCacheService.GetAllMappingPort();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -538,12 +540,14 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingPackage>();
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingPackage> list = await _sysCacheService.GetAllMappingPackage();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -610,12 +614,14 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingService>();
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingService> list = await _sysCacheService.GetAllMappingService();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -682,14 +688,18 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
[HttpGet("/commondb/mappingctnlist")]
|
|
|
|
|
public async Task<dynamic> MappingCtnList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingCtn();
|
|
|
|
|
|
|
|
|
|
var queryList = list
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -754,13 +764,16 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingfrtlist")]
|
|
|
|
|
public async Task<dynamic> MappingFrtList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
{ //数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingFrt();
|
|
|
|
|
|
|
|
|
|
var queryList = list
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.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.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
@ -845,11 +858,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeVessel>> GetAllVessel()
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("缓存船名!");
|
|
|
|
|
var list = await _codeVesselRep.ToListAsync();
|
|
|
|
|
_logger.LogInformation(list.ToJsonString());
|
|
|
|
|
await _sysCacheService.SetAllCodeVessel(list);
|
|
|
|
|
return list;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("缓存船名!");
|
|
|
|
|
var list = await _codeVesselRep.ToListAsync();
|
|
|
|
|
_logger.LogInformation(list.ToJsonString());
|
|
|
|
|
await _sysCacheService.SetAllCodeVessel(list);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("船名" + ex);
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
@ -949,11 +971,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeFrt>> GetAllFrt()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var list = await _codeFrtRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeFrt(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingFrt>> GetAllMappingFrt()
|
|
|
|
|