diff --git a/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs b/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs index 94fe132f..40a70c7e 100644 --- a/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs +++ b/Myshipping.Application/Service/BookingPrintTemplate/BookingPrintTemplateService.cs @@ -63,6 +63,7 @@ namespace Myshipping.Application .WhereIF(!string.IsNullOrWhiteSpace(input.DisplayName), u => u.DisplayName.Contains(input.DisplayName.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.CateCode), u => u.CateCode.Contains(input.CateCode.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.CateName), u => u.CateName.Contains(input.CateName.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input.Type), u => u.Type==input.Type) .ToPagedListAsync(input.PageNo, input.PageSize); return entities.XnPagedResult(); } diff --git a/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs b/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs index bb0be0b9..cc27188c 100644 --- a/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs +++ b/Myshipping.Application/Service/BookingPrintTemplate/Dto/BookingPrintTemplateInput.cs @@ -147,6 +147,10 @@ namespace Myshipping.Application /// 分类名称 /// public virtual string CateName { get; set; } + /// + /// 类型:FastReport、Excel模板等 + /// + public virtual string Type { get; set; } } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 0af807b4..aaaebc52 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -10307,7 +10307,7 @@ - 公司默认值 + 租户配置 diff --git a/Myshipping.Core/Service/DjyTenantConfig/DjyTenantConfigService.cs b/Myshipping.Core/Service/DjyTenantConfig/DjyTenantConfigService.cs index 62c4347c..13a5b17d 100644 --- a/Myshipping.Core/Service/DjyTenantConfig/DjyTenantConfigService.cs +++ b/Myshipping.Core/Service/DjyTenantConfig/DjyTenantConfigService.cs @@ -11,7 +11,7 @@ using Myshipping.Core.Entity; namespace Myshipping.Core.Service { /// - /// 公司默认值 + /// 租户配置 /// [ApiDescriptionSettings(Name = "DjyTenantConfig", Order = 1)] public class DjyTenantConfigService : IDjyTenantConfigService, IDynamicApiController, ITransient diff --git a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs index 280ae343..e2feaca3 100644 --- a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs +++ b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs @@ -36,7 +36,7 @@ namespace Myshipping.Core.Service public async Task 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) @@ -91,13 +91,13 @@ namespace Myshipping.Core.Service /// /// [HttpGet("/DjyVesselInfoService/GetList")] - public async Task GetList([FromQuery] string CarrierID, string KeyWord = "") + public async Task GetList([FromQuery] string CarrierID, string KeyWord = "") { //获取船名 List 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,22 +108,22 @@ namespace Myshipping.Core.Service }).Take(20). ToListAsync(); - if (tlist.Count() == 0) + var ves = tlist.Select(x => x.Vessel).ToList(); + var all = list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.StartsWith(KeyWord)). + Select(x => new { - return list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.Contains(KeyWord)).Select(x => new - { - Voyno = "", - VoynoInside = "", - Vessel = x.Name, - ETD = "", - ATD = "", - }).Take(20).ToList(); - } - else + Voyno = "", + VoynoInside = "", + Vessel = x.Name, + ETD = "", + ATD = "", + }).Take(20).ToList(); + foreach (var item in ves) { - return tlist; + all.RemoveAll(x => x.Vessel.StartsWith(item)); } + return tlist.Union(all); } } }