@ -1,4 +1,3 @@
using Amazon.Runtime.Internal ;
using DS.Module.Core ;
using DS.Module.Core.Constants ;
using DS.Module.Core.Data ;
@ -12,10 +11,8 @@ using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity ;
using DS.WMS.Core.Info.Dtos ;
using DS.WMS.Core.Info.Entity ;
using DS.WMS.Core.Invoice.Dtos ;
using DS.WMS.Core.Op.Dtos ;
using DS.WMS.Core.Op.Entity ;
using DS.WMS.Core.Op.Method ;
using DS.WMS.Core.Sys.Dtos ;
using DS.WMS.Core.Sys.Entity ;
using DS.WMS.Core.Sys.Interface ;
@ -25,8 +22,6 @@ using Masuit.Tools;
using Microsoft.AspNetCore.Mvc.Rendering ;
using Microsoft.Extensions.DependencyInjection ;
using SqlSugar ;
using System.Collections.Generic ;
using System.Linq ;
namespace DS.WMS.Core.Sys.Method ;
@ -78,10 +73,11 @@ public class ClientCommonService : IClientCommonService
public async Task < DataResult < List < BankRes > > > GetBankListAsync ( string? orgId , string? queryKey = null )
{
var list = await db . Queryable < SysBank > ( ) . Where ( x = > x . Status = = StatusEnum . Enable )
. WhereIF ( ! string . IsNullOrEmpty ( orgId ) , x = > x . LinkId = = long . Parse ( orgId ) )
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , x = > x . BankName . Contains ( queryKey ) | | x . AccountName . Contains ( queryKey ) | | x . BankAccountNo . Contains ( queryKey ) )
. WhereIF ( ! string . IsNullOrEmpty ( orgId ) , x = > x . LinkId = = long . Parse ( orgId ) )
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , x = > x . BankName . Contains ( queryKey ) | | x . AccountName . Contains ( queryKey ) | | x . BankAccountNo . Contains ( queryKey ) )
. Select < BankRes > ( )
. Mapper ( it = > {
. Mapper ( it = >
{
it . PinYinCode = it . BankName + "(" + it . BankAccountNo + ")" ;
} )
@ -252,11 +248,11 @@ public class ClientCommonService : IClientCommonService
var queryData0 = tenantDb . UnionAll ( queryData1 , queryData2 ) ;
//code = code.ToLower();
var data = await queryData0
. InnerJoin< InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsController = = true ) //&& c.CreateBy == long.Parse(user.UserId) && c.StartDate <= DateTime.Now && c.EndDate >= DateTime.Now
. Where( ( a ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = a . Id & & b . Value = = "isController" ) . Any ( ) ) //&& c.CreateBy == long.Parse(user.UserId) && c.StartDate <= DateTime.Now && c.EndDate >= DateTime.Now
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , ( a , b ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a , b ) = > new ControllerClientRes
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , ( a ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a ) = > new ControllerClientRes
{
Id = a . Id ,
PinYinCode = a . ShortName + "(" + a . Description + ")" + " " + a . CodeName ,
@ -301,7 +297,7 @@ public class ClientCommonService : IClientCommonService
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var list = await tenantDb . Queryable < CodeCarrier > ( )
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , a = > a . Code . Contains ( queryKey ) | | a . CnName . Contains ( queryKey ) | | a . EnName . Contains ( queryKey ) | | a . CnShortName . Contains ( queryKey ) )
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , a = > a . Code . Contains ( queryKey ) | | a . CnName . Contains ( queryKey ) | | a . EnName . Contains ( queryKey ) | | a . CnShortName . Contains ( queryKey ) )
. Select ( a = > new CodeCarrierRes ( )
{
PinYinCode = a . Code + "(" + a . CnName + ")" ,
@ -682,7 +678,7 @@ public class ClientCommonService : IClientCommonService
. ToList ( ) ;
var carrier = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsCarrier = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isCarrier" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -700,7 +696,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "carrier" , carrier ) ) ;
var yard = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsYard = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isYard" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -718,7 +714,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "yard" , yard ) ) ;
var booking = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsBooking = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isBooking" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -736,7 +732,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "booking" , booking ) ) ;
var truck = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsTruck = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isTruck" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -754,7 +750,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "truck" , truck ) ) ;
var controller = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsController = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isController" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -772,7 +768,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "controller" , controller ) ) ;
var custom = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsCustom = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isCustom" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -790,7 +786,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "custom" , custom ) ) ;
var agent = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsAgent = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isAgent" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -808,7 +804,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "agent" , agent ) ) ;
var agentcn = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsAgentCn = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isAgentCn" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -826,7 +822,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "agentcn" , agentcn ) ) ;
var express = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsExpress = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isExpress" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -844,7 +840,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "express" , express ) ) ;
var airlines = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsAirLines = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isAirLines" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -862,7 +858,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "airlines" , airlines ) ) ;
var shipper = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsShipper = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isShipper" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -880,7 +876,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "shipper" , shipper ) ) ;
var shippercn = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsShipperCn = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isShipperCn" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -898,7 +894,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "shippercn" , shippercn ) ) ;
var notifyparty = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsNotifyParty = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isNotifyParty" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -917,7 +913,7 @@ public class ClientCommonService : IClientCommonService
var warehouse = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsWareHouse = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isWareHouse" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -936,7 +932,7 @@ public class ClientCommonService : IClientCommonService
var wharf = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsWharf = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isWharf" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -954,7 +950,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "wharf" , wharf ) ) ;
var insurer = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsInsurer = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isInsurer" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -972,7 +968,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "insurer" , insurer ) ) ;
var leasing = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsLeasing = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isLeasing" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -990,7 +986,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "leasing" , leasing ) ) ;
var tradingagency = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsTradingAgency = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isTradingAgency" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -1008,7 +1004,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "tradingagency" , tradingagency ) ) ;
var shipagency = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsShipAgency = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isShipAgency" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -1026,7 +1022,7 @@ public class ClientCommonService : IClientCommonService
data . Add ( new ClientSelectMultiRes ( "shipagency" , shipagency ) ) ;
var enterprise = await tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Tag > ( ) . Where ( s = > s . ClientId = = a . Id & & s . IsEnterprise = = true ) . Any ( ) )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) ) . Where ( a = > SqlFunc . Subqueryable < InfoClient Attribute > ( ) . Where ( s = > s . ClientId = = a . Id & & s . Value = = "isEnterprise" ) . Any ( ) )
. Select ( a = > new ClientSelectRes
{
Id = a . Id ,
@ -1334,7 +1330,7 @@ public class ClientCommonService : IClientCommonService
{
foreach ( var item1 in item . ConditionalList )
{
var temp = item1 . Value as SqlSugar. ConditionalModel;
var temp = item1 . Value as ConditionalModel;
if ( temp . FieldName = = "Stakeholders" )
{
userids = temp . FieldValue . Split ( ',' ) . ToList ( ) ;
@ -1356,31 +1352,11 @@ public class ClientCommonService : IClientCommonService
var queryData0 = tenantDb . UnionAll ( queryData1 , queryData2 ) ;
//code = code.ToLower();
var data = await queryData0 //tenantDb.Queryable<InfoClient>()//.Where(a=> tenantDb.Ado.SqlQuery<dynamic>(sql, new SugarParameter($"@ClientId", a.Id)).Contains(user.UserId))
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) | | SqlFunc . Subqueryable < InfoClientStakeholder > ( ) . Where ( "SYSDATE() BETWEEN StartDate and EndDate" ) . Where ( c = > c . ClientId = = a . Id & & userids . Contains ( c . CreateBy . ToString ( ) ) ) . Any ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( code ) & & 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 ( queryKey ) , ( a , b ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a , b ) = > new ClientSelectRes
. Where ( ( a ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) | | SqlFunc . Subqueryable < InfoClientStakeholder > ( ) . Where ( "SYSDATE() BETWEEN StartDate and EndDate" ) . Where ( c = > c . ClientId = = a . Id & & userids . Contains ( c . CreateBy . ToString ( ) ) ) . Any ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( code ) , a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = a . Id & & b . Value = = code ) . Any ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , ( a ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
@ -1412,7 +1388,7 @@ public class ClientCommonService : IClientCommonService
var conditions = new List < IConditionalModel > ( ) ;
var otherConditions = new List < IConditionalModel > ( ) ;
var queryData = tenantDb . Queryable < InfoClient > ( ) . ClearFilter < ISharedOrgId > ( ) . Where ( c = > c . Status = = StatusEnum . Enable . ToEnumInt ( ) & & c . IsCustomer = = true ) ;
var scope = string . Empty ;
( conditions , scope , otherConditions ) = await commonService . GetSpecialVisibleDataRuleFilter < InfoClient > ( queryData , tenantDb ) ;
var userids = new List < string > ( ) ;
@ -1425,7 +1401,7 @@ public class ClientCommonService : IClientCommonService
{
foreach ( var item1 in item . ConditionalList )
{
var temp = item1 . Value as SqlSugar. ConditionalModel;
var temp = item1 . Value as ConditionalModel;
if ( temp . FieldName = = "Stakeholders" )
{
userids = temp . FieldValue . Split ( ',' ) . ToList ( ) ;
@ -1445,34 +1421,14 @@ public class ClientCommonService : IClientCommonService
var queryData1 = tenantDb . Queryable < InfoClient > ( ) . ClearFilter < ISharedOrgId > ( ) . Where ( c = > c . Status = = StatusEnum . Enable . ToEnumInt ( ) & & c . IsCustomer = = true ) . Where ( exp . ToExpression ( ) ) ;
var queryData2 = queryData . Where ( conditions ) ;
var queryData3 = tenantDb . Queryable < InfoClient > ( ) . ClearFilter < ISharedOrgId > ( ) . Where ( c = > c . Status = = StatusEnum . Enable . ToEnumInt ( ) & & c . IsSupplier = = true ) ;
var queryData0 = tenantDb . UnionAll ( queryData1 , queryData2 , queryData3 ) ;
var queryData0 = tenantDb . UnionAll ( queryData1 , queryData2 , queryData3 ) ;
//code = code.ToLower();
var data = await queryData0
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) | | SqlFunc . Subqueryable < InfoClientStakeholder > ( ) . Where ( "SYSDATE() BETWEEN StartDate and EndDate" ) . Where ( c = > c . ClientId = = a . Id & & userids . Contains ( c . CreateBy . ToString ( ) ) ) . Any ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( code ) & & 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 ( queryKey ) , ( a , b ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a , b ) = > new ClientSelectRes
. Where ( ( a ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) | | SqlFunc . Subqueryable < InfoClientStakeholder > ( ) . Where ( "SYSDATE() BETWEEN StartDate and EndDate" ) . Where ( c = > c . ClientId = = a . Id & & userids . Contains ( c . CreateBy . ToString ( ) ) ) . Any ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( code ) , a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = a . Id & & b . Value = = code ) . Any ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , ( a ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
@ -1486,8 +1442,8 @@ public class ClientCommonService : IClientCommonService
)
. ClearFilter < ISharedOrgId > ( ) . MergeTable ( )
. OrderBy ( x = > x . CodeName ) . Distinct ( ) . Take ( 20 ) . WithCache ( $"{SqlSugarCacheConst.AllClient}{user.TenantId}" , SqlSugarCacheConst . CacheDurationInSeconds ) . ToListAsync ( ) ;
return await Task . FromResult ( DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ) ;
}
/// <summary>
@ -1499,31 +1455,11 @@ public class ClientCommonService : IClientCommonService
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
//code = code.ToLower();
var data = await tenantDb . Queryable < InfoClient > ( ) . ClearFilter < ISharedOrgId > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( code ) & & 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 ( queryKey ) , ( a , b ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a , b ) = > new ClientSelectRes
. Where ( ( a ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( code ) , a = > SqlFunc . Subqueryable < InfoClientAttribute > ( ) . Where (
b = > b . ClientId = = a . Id & & b . Value = = code ) . Any ( ) )
. WhereIF ( ! string . IsNullOrEmpty ( queryKey ) , ( a ) = > a . CodeName . Contains ( queryKey ) | | a . ShortName . Contains ( queryKey ) | | a . Description . Contains ( queryKey ) )
. Select ( ( a ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
@ -1566,7 +1502,7 @@ public class ClientCommonService : IClientCommonService
} ) ;
}
var data = tenantDb . Queryable < InfoClient > ( ) . InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
var data = tenantDb . Queryable < InfoClient > ( )
. Where ( a = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) )
. Where ( conditions )
. WhereIF ( id . GetValueOrDefault ( ) > 0 , a = > a . Id ! = id )
@ -1582,429 +1518,6 @@ public class ClientCommonService : IClientCommonService
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
#region 废弃
/// <summary>
/// 获取船公司下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetCarrierClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsCarrier = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取场站下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetYardClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsYard = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取订舱公司下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetBookingClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsBooking = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取车队下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetTruckClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsTruck = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取委托单位下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetControllerClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsController = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取报关行下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetCustomClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsCustom = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取代理(国外)下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetAgentClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsAgent = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取代理(国内)下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetAgentCnClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsAgentCn = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取快递公司下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetExpressClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsExpress = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取航空公司下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetAirLinesClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsAirLines = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取发货人下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetShipperClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsShipper = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取收货人下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetConsigneeClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsConsignee = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取通知人下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetNotifyPartyClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsNotifyParty = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取仓库下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetWareHouseClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsWareHouse = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取码头下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetWharfClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsWharf = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取保险公司下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetInsurerClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsInsurer = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取租箱公司下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetLeasingClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsLeasing = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取贸易代理下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetTradingAgencyClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsTradingAgency = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取船代下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetShipAgencyClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsShipAgency = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
/// <summary>
/// 获取经营单位下拉列表
/// </summary>
/// <returns></returns>
public DataResult < List < ClientSelectRes > > GetEnterpriseClientList ( )
{
var tenantDb = saasService . GetBizDbScopeById ( user . TenantId ) ;
var data = tenantDb . Queryable < InfoClient > ( )
. InnerJoin < InfoClientTag > ( ( a , b ) = > a . Id = = b . ClientId )
. Where ( ( a , b ) = > a . Status = = StatusEnum . Enable . ToEnumInt ( ) & & b . IsEnterprise = = true )
. Select ( ( a , b ) = > new ClientSelectRes
{
Id = a . Id ,
CodeName = a . CodeName ,
ShortName = a . ShortName ,
EnShortName = a . EnShortName
}
) . ToList ( ) ;
return DataResult < List < ClientSelectRes > > . Success ( "获取数据成功!" , data , MultiLanguageConst . DataQuerySuccess ) ;
}
# endregion
/// <summary>
/// 获取签单方式下拉列表
/// </summary>