模板查询条件

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.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();
}

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

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

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

@ -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)
@ -91,13 +91,13 @@ namespace Myshipping.Core.Service
/// </summary>
/// <returns></returns>
[HttpGet("/DjyVesselInfoService/GetList")]
public async Task<dynamic> GetList([FromQuery] string CarrierID, string KeyWord = "")
public async Task<dynamic> GetList([FromQuery] string CarrierID, string KeyWord = "")
{
//获取船名
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,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<dynamic>(all);
}
}
}

Loading…
Cancel
Save