@ -244,9 +244,9 @@ public class ClientCommonService : IClientCommonService
exp = exp . And ( c = > SqlFunc . Subqueryable < InfoClientStakeholder > ( ) . Where ( "SYSDATE() BETWEEN StartDate and EndDate" ) . Where ( x = > userids . Contains ( x . UserId . ToString ( ) ) & & x . ClientId = = c . Id ) . Any ( ) ) ;
var queryData1 = tenantDb . Queryable < InfoClient > ( ) . ClearFilter < ISharedOrgId > ( ) . Where ( c = > c . Status = = StatusEnum . Enable . ToEnumInt ( ) & & SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = c . Id & & b . Value = = " isC ontroller") . Any ( ) ) . Where ( exp . ToExpression ( ) ) ;
b = > b . ClientId = = c . Id & & b . Value = = " c ontroller") . Any ( ) ) . Where ( exp . ToExpression ( ) ) ;
var queryData2 = queryData . Where ( c = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = c . Id & & b . Value = = " isC ontroller") . Any ( ) ) . Where ( conditions ) ;
b = > b . ClientId = = c . Id & & b . Value = = " c ontroller") . Any ( ) ) . Where ( conditions ) ;
var queryData0 = tenantDb . UnionAll ( queryData1 , queryData2 ) ;
var data = await queryData0
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) //&& c.CreateBy == long.Parse(user.UserId) && c.StartDate <= DateTime.Now && c.EndDate >= DateTime.Now
@ -524,7 +524,7 @@ public class ClientCommonService : IClientCommonService
var code = req . Code . ToLower ( ) ;
if ( req . BusinessType = = BusinessType . OceanShippingExport )
{
var info = tenantDb . Queryable < SeaExport > ( ) . Fi rst( x = > x . Id = = req . BusinessId ) ;
var info = tenantDb . Queryable < SeaExport > ( ) . Fi lter( null , true ) . Fi rst( x = > x . Id = = req . BusinessId ) ;
if ( info . IsNull ( ) )
{
return DataResult < ClientSelectInfoRes > . Failed ( "业务信息不存在!" ) ;
@ -614,15 +614,15 @@ public class ClientCommonService : IClientCommonService
data . ClientId = seaExport . AgentId ;
data . ClientName = seaExport . Agent ;
break ;
case "ware h ouse":
case "ware H ouse":
data . ClientId = seaExport . WareHouseId ;
data . ClientName = seaExport . WareHouse ;
break ;
case "agent c n":
case "agent n":
break ;
case "express" :
break ;
case "air l ines":
case "air L ines":
break ;
case "wharf" :
break ;
@ -638,17 +638,17 @@ public class ClientCommonService : IClientCommonService
data . ClientId = ( long ) seaExport . ShipperId ;
data . ClientName = seaExport . Shipper ;
break ;
case "shipper c n":
case "shipper C n":
data . ClientId = ( long ) seaExport . ShipperCnId ;
data . ClientName = seaExport . ShipperCn ;
break ;
case "notify p arty":
case "notify P arty":
data . ClientId = ( long ) seaExport . NotifyPartyId ;
data . ClientName = seaExport . NotifyParty ;
break ;
case "trading a gency":
case "trading A gency":
break ;
case "ship a gency":
case "ship A gency":
data . ClientId = seaExport . ShipAgencyId ;
data . ClientName = seaExport . ShipAgency ;
break ;
@ -662,385 +662,6 @@ public class ClientCommonService : IClientCommonService
# endregion
#region 获取往来单位下拉集合列表
/// <summary>
/// 获取往来单位下拉集合列表
/// </summary>
/// <returns></returns>
public async Task < DataResult < List < ClientSelectMultiRes > > > GetMultiClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = new List < ClientSelectMultiRes > ( ) ;
var parList = tenantDb . Queryable < InfoClientParam > ( )
. Where ( x = > x . Status = = StatusEnum . Enable )
. Select < ClientParamRes > ( )
. ToList ( ) ;
var carrier = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isCarrier" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "carrier" , carrier ) ) ;
var yard = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isYard" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "yard" , yard ) ) ;
var booking = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isBooking" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "booking" , booking ) ) ;
var truck = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isTruck" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "truck" , truck ) ) ;
var controller = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isController" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "controller" , controller ) ) ;
var custom = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isCustom" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "custom" , custom ) ) ;
var agent = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isAgent" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "agent" , agent ) ) ;
var agentcn = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isAgentCn" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "agentcn" , agentcn ) ) ;
var express = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isExpress" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "express" , express ) ) ;
var airlines = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isAirLines" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "airlines" , airlines ) ) ;
var shipper = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isShipper" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "shipper" , shipper ) ) ;
var shippercn = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isShipperCn" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "shippercn" , shippercn ) ) ;
var notifyparty = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isNotifyParty" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "notifyparty" , notifyparty ) ) ;
var warehouse = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isWareHouse" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "warehouse" , warehouse ) ) ;
var wharf = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isWharf" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "wharf" , wharf ) ) ;
var insurer = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isInsurer" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "insurer" , insurer ) ) ;
var leasing = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isLeasing" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "leasing" , leasing ) ) ;
var tradingagency = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isTradingAgency" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "tradingagency" , tradingagency ) ) ;
var shipagency = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isShipAgency" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
data . Add ( new ClientSelectMultiRes ( "shipagency" , shipagency ) ) ;
var enterprise = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isEnterprise" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName ,
BLContent = a . BLContent ,
Description = a . Description ,
} )
. Mapper ( it = >
{
it . ClientParams = parList . Where ( x = > x . CustomerId = = it . Id ) . ToList ( ) ;
} )
. ToListAsync ( ) ;
return await Task . FromResult ( DataResult < List < ClientSelectMultiRes > > . Success ( data ) ) ;
}
# endregion
/// <summary>
/// 提取汇率信息