|
|
@ -350,11 +350,19 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 获取船代列表信息
|
|
|
|
/// 获取船代列表信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpGet("/commondb/forwarderlist")]
|
|
|
|
[HttpGet("/commondb/forwarderlist")]
|
|
|
|
public async Task<dynamic> ForwarderList([FromQuery] NameQueryDto input)
|
|
|
|
public async Task<dynamic> ForwarderList([FromQuery] ForwarderListInputDto input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<CodeForwarder> list = await _sysCacheService.GetAllCodeForwarder();
|
|
|
|
List<CodeForwarder> list = await _sysCacheService.GetAllCodeForwarder();
|
|
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.Name.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) || x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.Name.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) || x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果装货港代码不为空,则根据装货港代码查询装货港与船代的映射关系
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.PortLoadCode))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<string> forwarderCodeList = await _relaPortLoadForwarderRep.AsQueryable().Where(x => x.PortLoadCode == input.PortLoadCode).Select(x => x.ForwarderCode).ToListAsync();
|
|
|
|
|
|
|
|
queryList = queryList.Where(x => forwarderCodeList.Contains(x.Code)).ToList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (queryList.Count() > 20)
|
|
|
|
if (queryList.Count() > 20)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList();
|
|
|
|
return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList();
|
|
|
@ -522,7 +530,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)
|
|
|
|
|| x.MapCode.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) || x.MapName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|| x.MapCode.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) || x.MapName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CarrierCode), x => x.CarrierCode==input.CarrierCode);
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CarrierCode), x => x.CarrierCode == input.CarrierCode);
|
|
|
|
if (queryList.Count() > 20)
|
|
|
|
if (queryList.Count() > 20)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList();
|
|
|
|
return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList();
|
|
|
|