|
|
|
@ -464,7 +464,7 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
//var data = new ClientSelectInfoRes();
|
|
|
|
|
var contacts = await tenantDb.Queryable<InfoClientContact>().Where(x => x.Status == StatusEnum.Enable && x.IsDefault == true).Select<ClientContactRes>().ToListAsync();
|
|
|
|
|
//var contacts = await tenantDb.Queryable<InfoClientContact>().Where(x => x.Status == StatusEnum.Enable && x.IsDefault == true).Select<ClientContactRes>().ToListAsync();
|
|
|
|
|
|
|
|
|
|
var code = req.Code.ToLower();
|
|
|
|
|
if (req.BusinessType == BusinessType.OceanShippingExport)
|
|
|
|
@ -474,49 +474,49 @@ public class ClientCommonService : IClientCommonService
|
|
|
|
|
{
|
|
|
|
|
return DataResult<ClientSelectInfoRes>.Failed("业务信息不存在!");
|
|
|
|
|
}
|
|
|
|
|
var list = await tenantDb.Queryable<InfoClient>()
|
|
|
|
|
.InnerJoin<InfoClientTag>((a, b) => a.Id == b.ClientId)
|
|
|
|
|
.Where((a, b) => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
|
|
|
//.WhereIF(code == "carrier", (a, b) => b.IsCarrier == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "yard", (a, b) => b.IsYard == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "booking", (a, b) => b.IsBooking == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "truck", (a, b) => b.IsTruck == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "controller", (a, b) => b.IsController == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "custom", (a, b) => b.IsCustom == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "agent", (a, b) => b.IsAgent == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "agentcn", (a, b) => b.IsAgentCn == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "express", (a, b) => b.IsExpress == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "airlines", (a, b) => b.IsAirLines == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "shipper", (a, b) => b.IsShipper == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "shippercn", (a, b) => b.IsShipperCn == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "notifyparty", (a, b) => b.IsNotifyParty == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "warehouse", (a, b) => b.IsWareHouse == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "wharf", (a, b) => b.IsWharf == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "insurer", (a, b) => b.IsInsurer == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "leasing", (a, b) => b.IsLeasing == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "tradingagency", (a, b) => b.IsTradingAgency == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "shipagency", (a, b) => b.IsShipAgency == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "enterprise", (a, b) => b.IsEnterprise == true)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(code) && code == "contract", (a, b) => b.IsContract == true)
|
|
|
|
|
.WhereIF(string.IsNullOrEmpty(code), (a, b) => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
|
|
|
.Select((a, b) => new ClientSelectRes
|
|
|
|
|
{
|
|
|
|
|
Id = a.Id,
|
|
|
|
|
CodeName = a.CodeName,
|
|
|
|
|
ShortName = a.ShortName,
|
|
|
|
|
EnShortName = a.EnShortName,
|
|
|
|
|
BLContent = a.BLContent,
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
//.Mapper(it =>
|
|
|
|
|
//var list = await tenantDb.Queryable<InfoClient>()
|
|
|
|
|
//.InnerJoin<InfoClientTag>((a, b) => a.Id == b.ClientId)
|
|
|
|
|
//.Where((a, b) => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
|
|
|
////.WhereIF(code == "carrier", (a, b) => b.IsCarrier == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "yard", (a, b) => b.IsYard == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "booking", (a, b) => b.IsBooking == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "truck", (a, b) => b.IsTruck == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "controller", (a, b) => b.IsController == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "custom", (a, b) => b.IsCustom == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "agent", (a, b) => b.IsAgent == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "agentcn", (a, b) => b.IsAgentCn == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "express", (a, b) => b.IsExpress == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "airlines", (a, b) => b.IsAirLines == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "shipper", (a, b) => b.IsShipper == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "shippercn", (a, b) => b.IsShipperCn == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "notifyparty", (a, b) => b.IsNotifyParty == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "warehouse", (a, b) => b.IsWareHouse == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "wharf", (a, b) => b.IsWharf == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "insurer", (a, b) => b.IsInsurer == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "leasing", (a, b) => b.IsLeasing == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "tradingagency", (a, b) => b.IsTradingAgency == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "shipagency", (a, b) => b.IsShipAgency == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "enterprise", (a, b) => b.IsEnterprise == true)
|
|
|
|
|
//.WhereIF(!string.IsNullOrEmpty(code) && code == "contract", (a, b) => b.IsContract == true)
|
|
|
|
|
//.WhereIF(string.IsNullOrEmpty(code), (a, b) => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
|
|
|
//.Select((a, b) => new ClientSelectRes
|
|
|
|
|
//{
|
|
|
|
|
// //it.ClientContact = tenantDb.Queryable<InfoClientContact>().Where(x => x.ClientId == it.Id && x.Status == StatusEnum.Enable && x.IsDefault == true)
|
|
|
|
|
// //.Select<ClientContactRes>().First();
|
|
|
|
|
// it.ClientContact = contacts.Where(x => x.ClientId == it.Id).FirstOrDefault();
|
|
|
|
|
//})
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
// Id = a.Id,
|
|
|
|
|
// CodeName = a.CodeName,
|
|
|
|
|
// ShortName = a.ShortName,
|
|
|
|
|
// EnShortName = a.EnShortName,
|
|
|
|
|
// BLContent = a.BLContent,
|
|
|
|
|
//}
|
|
|
|
|
//)
|
|
|
|
|
////.Mapper(it =>
|
|
|
|
|
////{
|
|
|
|
|
//// //it.ClientContact = tenantDb.Queryable<InfoClientContact>().Where(x => x.ClientId == it.Id && x.Status == StatusEnum.Enable && x.IsDefault == true)
|
|
|
|
|
//// //.Select<ClientContactRes>().First();
|
|
|
|
|
//// it.ClientContact = contacts.Where(x => x.ClientId == it.Id).FirstOrDefault();
|
|
|
|
|
////})
|
|
|
|
|
//.ToListAsync();
|
|
|
|
|
var data = GetSeaExportClientInfo(info, code);
|
|
|
|
|
data.ClientList = list;
|
|
|
|
|
//data.ClientList = list;
|
|
|
|
|
return await Task.FromResult(DataResult<ClientSelectInfoRes>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|