diff --git a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs index 8e6a0940..45cf710f 100644 --- a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs +++ b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs @@ -55,11 +55,14 @@ namespace Myshipping.Core.Service public async Task GetListPage([FromQuery] QueryDjyVesselInfoInput input) { - return await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID). - WhereIF(!string.IsNullOrWhiteSpace(input.KeyWord), x => x.Vessel.Contains(input.KeyWord) - || x.CARRIER.Contains(input.KeyWord) || x.Voyno.Contains(input.KeyWord) || x.PortLoading.Contains(input.KeyWord) || x.PortTransit.Contains(input.KeyWord) || - x.PortDischarge.Contains(input.KeyWord) || x.VoynoInside.Contains(input.KeyWord) - ).ToPagedListAsync(input.PageNo, input.PageSize); + return await _rep.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID) + .WhereIF(!string.IsNullOrWhiteSpace(input.CARRIER), x => x.CARRIER.Contains(input.CARRIER)) + .WhereIF(!string.IsNullOrWhiteSpace(input.Vessel), x => x.Vessel.Contains(input.Vessel)) + .WhereIF(!string.IsNullOrWhiteSpace(input.VoynoInside), x => x.VoynoInside.Contains(input.VoynoInside)) + .WhereIF(!string.IsNullOrWhiteSpace(input.Voyno), x => x.Voyno.Contains(input.Voyno)) + .WhereIF(input.StartETD != null, x => x.ETD >= input.StartETD) + .WhereIF(input.EndETD != null, x => x.ETD <= input.EndETD) + .ToPagedListAsync(input.PageNo, input.PageSize); } diff --git a/Myshipping.Core/Service/DjyVesselInfo/Dto/QueryDjyVesselInfoInput.cs b/Myshipping.Core/Service/DjyVesselInfo/Dto/QueryDjyVesselInfoInput.cs index 35b67c84..65084567 100644 --- a/Myshipping.Core/Service/DjyVesselInfo/Dto/QueryDjyVesselInfoInput.cs +++ b/Myshipping.Core/Service/DjyVesselInfo/Dto/QueryDjyVesselInfoInput.cs @@ -13,9 +13,34 @@ namespace Myshipping.Core.Service /// - /// 关键字 + /// 船公司 /// - public string KeyWord { get; set; } + public string CARRIER { get; set; } + /// + /// 船名 + /// + public string Vessel { get; set; } + /// + /// 内部航次 + /// + public string VoynoInside { get; set; } + + /// + /// 航次 + /// + public string Voyno { get; set; } + + /// + /// 航次 + /// + public DateTime? StartETD { get; set; } + + /// + /// 航次 + /// + public DateTime? EndETD { get; set; } } + + }