|
|
|
@ -36,7 +36,7 @@ namespace Myshipping.Core.Service
|
|
|
|
|
public async Task<dynamic> GetListPage([FromQuery] string KeyWord)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return await _rep.AsQueryable().Filter(null, true).Where(x=>x.TenantId==UserManager.TENANT_ID).
|
|
|
|
|
return await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID).
|
|
|
|
|
WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)
|
|
|
|
|
|| x.CARRIER.Contains(KeyWord) || x.Voyno.Contains(KeyWord) || x.PortLoading.Contains(KeyWord) || x.PortTransit.Contains(KeyWord) ||
|
|
|
|
|
x.PortDischarge.Contains(KeyWord) || x.VoynoInside.Contains(KeyWord)
|
|
|
|
@ -96,8 +96,8 @@ namespace Myshipping.Core.Service
|
|
|
|
|
//获取船名
|
|
|
|
|
List<CodeVessel> list = await _sysCacheService.GetAllCodeVessel();
|
|
|
|
|
|
|
|
|
|
var tlist = await _rep.AsQueryable().Filter(null, true).WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)).
|
|
|
|
|
Where(x=> x.CARRIERID == CarrierID && x.ETD > DateTime.Now.AddDays(-7)&&x.TenantId==UserManager.TENANT_ID).
|
|
|
|
|
var tlist = await _rep.AsQueryable().Filter(null, true).WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.StartsWith(KeyWord)).
|
|
|
|
|
Where(x => x.CARRIERID == CarrierID && x.ETD > DateTime.Now.AddDays(-7) && x.TenantId == UserManager.TENANT_ID).
|
|
|
|
|
Select(x => new
|
|
|
|
|
{
|
|
|
|
|
Voyno = x.Voyno,
|
|
|
|
@ -108,9 +108,9 @@ namespace Myshipping.Core.Service
|
|
|
|
|
}).Take(20).
|
|
|
|
|
ToListAsync();
|
|
|
|
|
|
|
|
|
|
if (tlist.Count() == 0)
|
|
|
|
|
{
|
|
|
|
|
return list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.Contains(KeyWord)).Select(x => new
|
|
|
|
|
var ves = tlist.Select(x => x.Vessel).ToList();
|
|
|
|
|
var all = list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.StartsWith(KeyWord)).
|
|
|
|
|
Select(x => new
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Voyno = "",
|
|
|
|
@ -119,11 +119,11 @@ namespace Myshipping.Core.Service
|
|
|
|
|
ETD = "",
|
|
|
|
|
ATD = "",
|
|
|
|
|
}).Take(20).ToList();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
foreach (var item in ves)
|
|
|
|
|
{
|
|
|
|
|
return tlist;
|
|
|
|
|
all.RemoveAll(x => x.Vessel.StartsWith(item));
|
|
|
|
|
}
|
|
|
|
|
return tlist.Union<dynamic>(all);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|