获取往来单位下拉集合列表修改

dev
cjy 1 month ago
parent bfe4150725
commit 428cc664d1

@ -600,10 +600,9 @@ public class ClientCommonService : IClientCommonService
.Where(x => x.Status == StatusEnum.Enable) .Where(x => x.Status == StatusEnum.Enable)
.Select<ClientParamRes>() .Select<ClientParamRes>()
.ToList(); .ToList();
var clientList = tenantDb.Queryable<InfoClient>() var carrier = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()); .Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a=> SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsCarrier == true).Any())
var carrier = await clientList.Where(a=> SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsCarrier == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -619,7 +618,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("carrier", carrier)); data.Add(new ClientSelectMultiRes("carrier", carrier));
var yard = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsYard == true).Any()) var yard = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsYard == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -635,7 +635,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("yard", yard)); data.Add(new ClientSelectMultiRes("yard", yard));
var booking = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsBooking == true).Any()) var booking = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsBooking == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -651,7 +652,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("booking", booking)); data.Add(new ClientSelectMultiRes("booking", booking));
var truck = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsTruck == true).Any()) var truck = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsTruck == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -667,7 +669,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("truck", truck)); data.Add(new ClientSelectMultiRes("truck", truck));
var controller = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsController == true).Any()) var controller = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsController == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -683,7 +686,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("controller", controller)); data.Add(new ClientSelectMultiRes("controller", controller));
var custom = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsCustom == true).Any()) var custom = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsCustom == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -699,7 +703,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("custom", custom)); data.Add(new ClientSelectMultiRes("custom", custom));
var agent = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsAgent == true).Any()) var agent = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsAgent == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -715,7 +720,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("agent", agent)); data.Add(new ClientSelectMultiRes("agent", agent));
var agentcn = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsAgentCn == true).Any()) var agentcn = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsAgentCn == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -731,7 +737,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("agentcn", agentcn)); data.Add(new ClientSelectMultiRes("agentcn", agentcn));
var express = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsExpress == true).Any()) var express = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsExpress == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -747,7 +754,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("express", express)); data.Add(new ClientSelectMultiRes("express", express));
var airlines = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsAirLines == true).Any()) var airlines = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsAirLines == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -763,7 +771,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("airlines", airlines)); data.Add(new ClientSelectMultiRes("airlines", airlines));
var shipper = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsShipper == true).Any()) var shipper = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsShipper == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -779,7 +788,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("shipper", shipper)); data.Add(new ClientSelectMultiRes("shipper", shipper));
var shippercn = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsShipperCn == true).Any()) var shippercn = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsShipperCn == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -795,7 +805,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("shippercn", shippercn)); data.Add(new ClientSelectMultiRes("shippercn", shippercn));
var notifyparty = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsNotifyParty == true).Any()) var notifyparty = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsNotifyParty == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -812,7 +823,8 @@ public class ClientCommonService : IClientCommonService
data.Add(new ClientSelectMultiRes("notifyparty", notifyparty)); data.Add(new ClientSelectMultiRes("notifyparty", notifyparty));
var warehouse = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsWareHouse == true).Any()) var warehouse = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsWareHouse == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -829,7 +841,8 @@ public class ClientCommonService : IClientCommonService
data.Add(new ClientSelectMultiRes("warehouse", warehouse)); data.Add(new ClientSelectMultiRes("warehouse", warehouse));
var wharf = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsWharf == true).Any()) var wharf = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsWharf == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -845,7 +858,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("wharf", wharf)); data.Add(new ClientSelectMultiRes("wharf", wharf));
var insurer = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsInsurer == true).Any()) var insurer = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsInsurer == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -861,7 +875,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("insurer", insurer)); data.Add(new ClientSelectMultiRes("insurer", insurer));
var leasing = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsLeasing == true).Any()) var leasing = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsLeasing == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -877,7 +892,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("leasing", leasing)); data.Add(new ClientSelectMultiRes("leasing", leasing));
var tradingagency = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsTradingAgency == true).Any()) var tradingagency = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsTradingAgency == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -893,7 +909,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("tradingagency", tradingagency)); data.Add(new ClientSelectMultiRes("tradingagency", tradingagency));
var shipagency = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsShipAgency == true).Any()) var shipagency = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsShipAgency == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,
@ -909,7 +926,8 @@ public class ClientCommonService : IClientCommonService
.ToListAsync(); .ToListAsync();
data.Add(new ClientSelectMultiRes("shipagency", shipagency)); data.Add(new ClientSelectMultiRes("shipagency", shipagency));
var enterprise = await clientList.Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsEnterprise == true).Any()) var enterprise = await tenantDb.Queryable<InfoClient>()
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()).Where(a => SqlFunc.Subqueryable<InfoClientTag>().Where(s => s.ClientId == a.Id && s.IsEnterprise == true).Any())
.Select(a => new ClientSelectRes .Select(a => new ClientSelectRes
{ {
Id = a.Id, Id = a.Id,

Loading…
Cancel
Save