模板查询条件

optimize
wet 2 years ago
parent db58ad91e3
commit 345d85a354

@ -63,6 +63,7 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrWhiteSpace(input.DisplayName), u => u.DisplayName.Contains(input.DisplayName.Trim())) .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.CateCode), u => u.CateCode.Contains(input.CateCode.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.CateName), u => u.CateName.Contains(input.CateName.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); .ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult(); return entities.XnPagedResult();
} }

@ -147,6 +147,10 @@ namespace Myshipping.Application
/// 分类名称 /// 分类名称
/// </summary> /// </summary>
public virtual string CateName { get; set; } public virtual string CateName { get; set; }
/// <summary>
/// 类型FastReport、Excel模板等
/// </summary>
public virtual string Type { get; set; }
} }

@ -10307,7 +10307,7 @@
</member> </member>
<member name="T:Myshipping.Core.Service.DjyTenantConfigService"> <member name="T:Myshipping.Core.Service.DjyTenantConfigService">
<summary> <summary>
公司默认值 租户配置
</summary> </summary>
</member> </member>
<member name="M:Myshipping.Core.Service.DjyTenantConfigService.Page(Myshipping.Core.Service.QueryDjyTenantConfigInput)"> <member name="M:Myshipping.Core.Service.DjyTenantConfigService.Page(Myshipping.Core.Service.QueryDjyTenantConfigInput)">

@ -11,7 +11,7 @@ using Myshipping.Core.Entity;
namespace Myshipping.Core.Service namespace Myshipping.Core.Service
{ {
/// <summary> /// <summary>
/// 公司默认值 /// 租户配置
/// </summary> /// </summary>
[ApiDescriptionSettings(Name = "DjyTenantConfig", Order = 1)] [ApiDescriptionSettings(Name = "DjyTenantConfig", Order = 1)]
public class DjyTenantConfigService : IDjyTenantConfigService, IDynamicApiController, ITransient public class DjyTenantConfigService : IDjyTenantConfigService, IDynamicApiController, ITransient

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

Loading…
Cancel
Save