You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
684 lines
27 KiB
C#
684 lines
27 KiB
C#
using DS.Module.Core;
|
|
using DS.Module.Core.Extensions;
|
|
using DS.Module.SqlSugar;
|
|
using DS.Module.UserModule;
|
|
using DS.WMS.Core.Code.Dtos;
|
|
using DS.WMS.Core.Code.Entity;
|
|
using DS.WMS.Core.Info.Dtos;
|
|
using DS.WMS.Core.Info.Entity;
|
|
using DS.WMS.Core.System.Dtos;
|
|
using DS.WMS.Core.System.Entity;
|
|
using DS.WMS.Core.System.Interface;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using SqlSugar;
|
|
|
|
namespace DS.WMS.Core.System.Method;
|
|
|
|
public class ClientCommonService : IClientCommonService
|
|
{
|
|
private readonly IServiceProvider _serviceProvider;
|
|
private readonly ISqlSugarClient db;
|
|
private readonly IUser user;
|
|
private readonly ISaasDbService saasService;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="serviceProvider"></param>
|
|
public ClientCommonService(IServiceProvider serviceProvider)
|
|
{
|
|
_serviceProvider = serviceProvider;
|
|
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
|
|
user = _serviceProvider.GetRequiredService<IUser>();
|
|
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
|
|
}
|
|
|
|
/// <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);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取签单方式下拉列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<IssueTypeSelectRes>> GetIssueTypeSelectList()
|
|
{
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
var data = tenantDb.Queryable<InfoClient>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt())
|
|
.Select<IssueTypeSelectRes>().ToList();
|
|
return DataResult<List<IssueTypeSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
/// <summary>
|
|
/// 获取集装箱下拉列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<CodeCtnSelectRes>> GetCtnSelectList()
|
|
{
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
var data = tenantDb.Queryable<CodeCtn>()
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
.Select<CodeCtnSelectRes>().ToList();
|
|
return DataResult<List<CodeCtnSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取包装类型下拉列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList()
|
|
{
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
var data = tenantDb.Queryable<CodePackage>()
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
.Select<CodePackageSelectRes>().ToList();
|
|
return DataResult<List<CodePackageSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
/// <summary>
|
|
/// 获取船名下拉列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList()
|
|
{
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
var data = tenantDb.Queryable<CodeVessel>()
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
.Select<CodeVesselSelectRes>().ToList();
|
|
return DataResult<List<CodeVesselSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
/// <summary>
|
|
/// 获取航次下拉列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList()
|
|
{
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
var data = tenantDb.Queryable<CodeVoyno>()
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
.Select<CodeVoynoSelectRes>().ToList();
|
|
return DataResult<List<CodeVoynoSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
/// <summary>
|
|
/// 获取运输条款下拉列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<CodeServiceSelectRes>> GetServiceSelectList()
|
|
{
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
var data = tenantDb.Queryable<CodeService>()
|
|
.Where(a => a.Status == StatusEnum.Enable)
|
|
.Select<CodeServiceSelectRes>().ToList();
|
|
return DataResult<List<CodeServiceSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
/// <summary>
|
|
/// 获取部门列表
|
|
/// </summary>
|
|
/// <param name="orgId">机构id</param>
|
|
/// <returns></returns>
|
|
public DataResult<List<DeptSelectRes>> GetDeptList(string orgId = "")
|
|
{
|
|
var list = db.Queryable<SysOrg>()
|
|
.WhereIF(orgId.IsNotEmptyOrNull(), a => a.ParentId == long.Parse(orgId))
|
|
.Where(a => a.Status == StatusEnum.Enable && a.IsDepartment == true)
|
|
.Select<DeptSelectRes>()
|
|
.ToList();
|
|
return DataResult<List<DeptSelectRes>>.Success("获取数据成功!", list);
|
|
}
|
|
/// <summary>
|
|
/// 获取操作员列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetOperatorUserList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsOperator == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单证员列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetVouchingClerkList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsVouchingClerk == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
/// <summary>
|
|
/// 获取销售员列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetSaleUserList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsSale == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取报关员列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetCustomUserList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsCustom == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取财务员列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetFinancialStaffList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsFinancialStaff == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取客服列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetCustomerServiceList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsCustomerService == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取司机列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetDiverList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsDriver == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
/// <summary>
|
|
/// 获取派车调度人员列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataResult<List<UserSelectRes>> GetDispatcherList()
|
|
{
|
|
var data = db.Queryable<SysUser>()
|
|
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt() && a.IsDispatcher == true)
|
|
.Select(a => new UserSelectRes
|
|
{
|
|
Id = a.Id,
|
|
UserCode= a.UserCode,
|
|
UserName = a.UserName,
|
|
}
|
|
).ToList();
|
|
return DataResult<List<UserSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
|
|
}
|
|
} |