获取委托单位下拉列表

usertest
cjy 3 months ago
parent 0296fd58f8
commit e9c70f5b56

@ -0,0 +1,124 @@
using DS.Module.Core.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Info.Dtos
{
/// <summary>
/// 委托单位下拉返回信息
/// </summary>
public class ControllerClientRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// Desc:客户代码
/// </summary>
public string CodeName { get; set; }
/// <summary>
/// Desc:客户简称
/// </summary>
public string ShortName { get; set; }
/// <summary>
/// Desc:英文简称
/// </summary>
public string EnShortName { get; set; }
/// <summary>
/// Desc:提单信息
/// </summary>
public string BLContent { get; set; }
/// <summary>
/// 助记码
/// </summary>
public string PinYinCode { get; set; }
/// <summary>
/// Desc:业务来源Id
/// </summary>
public long SourceId { get; set; }
/// <summary>
/// Desc:业务来源明细Id
/// </summary>
public long SourceDetailId { get; set; }
/// <summary>
/// Desc:业务来源名称
/// </summary>
public string SourceName { get; set; }
/// <summary>
/// Desc:业务来源明细名称
/// </summary>
public string SourceDetailName { get; set; }
/// <summary>
/// Desc:所属揽货人
/// </summary>
public long SaleId { get; set; }
/// <summary>
/// Desc:所属操作人
/// </summary>
public long Op { get; set; }
/// <summary>
/// Desc:所属单证
/// </summary>
public long Doc { get; set; }
/// <summary>
/// Desc: 客服
/// </summary>
public long CustomerService { get; set; }
/// <summary>
/// 揽货人名字
/// </summary>
public string SaleName { get; set; }
/// <summary>
/// 操作名字
/// </summary>
public string OpName { get; set; }
/// <summary>
/// 单证名字
/// </summary>
public string DocName { get; set; }
/// <summary>
/// 客服名字
/// </summary>
public string CustomerServiceName { get; set; }
/// <summary>
/// 所属分部值
/// </summary>
[IgnoreDataMember]
public string? SaleOrgId { get; set; }
/// <summary>
/// 所属分部
/// </summary>
public long[] SaleOrgIdList => SaleOrgId.IsNullOrEmpty() ? [] :
SaleOrgId.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
/// <summary>
/// 所属集团ID
/// </summary>
public long? PcorpId { get; set; }
/// <summary>
/// Desc: 所属集团
/// </summary>
public string PcorpName { get; set; }
}
}

@ -14,6 +14,12 @@ namespace DS.WMS.Core.Sys.Interface;
/// </summary>
public interface IClientCommonService
{
/// <summary>
/// 获取委托单位下拉列表
/// </summary>
/// <returns></returns>
public Task<DataResult<List<ControllerClientRes>>> GetControllerClientList(string queryKey = "");
/// <summary>
/// 获取船公司下拉列表
/// </summary>

@ -47,6 +47,26 @@ public class ClientCommonService : IClientCommonService
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
/// 获取委托单位下拉列表
/// </summary>
/// <returns></returns>
public async Task<DataResult<List<ControllerClientRes>>> GetControllerClientList(string queryKey = "")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = await tenantDb.Queryable<InfoClient>()
.InnerJoin<InfoClientTag>((a, b) => a.Id == b.ClientId)
.Where((a, b) => a.Status == StatusEnum.Enable.ToEnumInt() && b.IsController == true)
.WhereIF(!string.IsNullOrEmpty(queryKey), (a, b) => a.CodeName.Contains(queryKey) || a.ShortName.Contains(queryKey))
.Select((a, b) => new ControllerClientRes
{
Id = a.Id,
PinYinCode = a.ShortName + "(" + a.CodeName + ")"
},true
).Take(20).WithCache($"{SqlSugarCacheConst.InfoClient}{user.TenantId}").ToListAsync();
return await Task.FromResult(DataResult<List<ControllerClientRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess));
}
/// <summary>
/// 获取船公司下拉列表
/// </summary>

@ -28,7 +28,18 @@ public class ClientCommonController : ApiController
{
_invokeService = invokeService;
}
/// <summary>
/// 获取委托单位下拉列表-客户端
/// </summary>
/// <param name="queryKey">委托单位代码或中文名称</param>
/// <returns></returns>
[HttpGet]
[Route("GetControllerClientList")]
public async Task<DataResult<List<ControllerClientRes>>> GetControllerClientList([FromQuery] string queryKey)
{
var res = await _invokeService.GetControllerClientList(queryKey);
return res;
}
/// <summary>
/// 获取船公司下拉列表-客户端
/// </summary>
@ -225,237 +236,237 @@ public class ClientCommonController : ApiController
var res = await _invokeService.GetClientListByCode(code, queryKey);
return res;
}
/// <summary>
/// 获取所有往来单位下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetAllClientList")]
public DataResult<List<ClientSelectRes>> GetAllClientList()
{
var res = _invokeService.GetAllClientList();
return res;
}
/// <summary>
/// 获取船公司下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetCarrierClientList")]
public DataResult<List<ClientSelectRes>> GetCarrierClientList()
{
var res = _invokeService.GetCarrierClientList();
return res;
}
/// <summary>
/// 获取场站下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetYardClientList")]
public DataResult<List<ClientSelectRes>> GetYardClientList()
{
var res = _invokeService.GetYardClientList();
return res;
}
/// <summary>
/// 获取订舱公司下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetBookingClientList")]
public DataResult<List<ClientSelectRes>> GetBookingClientList()
{
var res = _invokeService.GetBookingClientList();
return res;
}
/// <summary>
/// 获取车队下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetTruckClientList")]
public DataResult<List<ClientSelectRes>> GetTruckClientList()
{
var res = _invokeService.GetTruckClientList();
return res;
}
/// <summary>
/// 获取委托单位下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetControllerClientList")]
public DataResult<List<ClientSelectRes>> GetControllerClientList()
{
var res = _invokeService.GetControllerClientList();
return res;
}
/// <summary>
/// 获取报关行下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetCustomClientList")]
public DataResult<List<ClientSelectRes>> GetCustomClientList()
{
var res = _invokeService.GetCustomClientList();
return res;
}
/// <summary>
/// 获取代理(国外)下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetAgentClientList")]
public DataResult<List<ClientSelectRes>> GetAgentClientList()
{
var res = _invokeService.GetAgentClientList();
return res;
}
/// <summary>
/// 获取代理(国内)下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetAgentCnClientList")]
public DataResult<List<ClientSelectRes>> GetAgentCnClientList()
{
var res = _invokeService.GetAgentCnClientList();
return res;
}
/// <summary>
/// 获取快递公司下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetExpressClientList")]
public DataResult<List<ClientSelectRes>> GetExpressClientList()
{
var res = _invokeService.GetExpressClientList();
return res;
}
/// <summary>
/// 获取航空公司下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetAirLinesClientList")]
public DataResult<List<ClientSelectRes>> GetAirLinesClientList()
{
var res = _invokeService.GetAirLinesClientList();
return res;
}
/// <summary>
/// 获取发货人下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetShipperClientList")]
public DataResult<List<ClientSelectRes>> GetShipperClientList()
{
var res = _invokeService.GetShipperClientList();
return res;
}
/// <summary>
/// 获取收货人下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetConsigneeClientList")]
public DataResult<List<ClientSelectRes>> GetConsigneeClientList()
{
var res = _invokeService.GetConsigneeClientList();
return res;
}
/// <summary>
/// 获取通知人下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetNotifyPartyClientList")]
public DataResult<List<ClientSelectRes>> GetNotifyPartyClientList()
{
var res = _invokeService.GetNotifyPartyClientList();
return res;
}
/// <summary>
/// 获取仓库下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetWareHouseClientList")]
public DataResult<List<ClientSelectRes>> GetWareHouseClientList()
{
var res = _invokeService.GetWareHouseClientList();
return res;
}
/// <summary>
/// 获取保险公司下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetInsurerClientList")]
public DataResult<List<ClientSelectRes>> GetInsurerClientList()
{
var res = _invokeService.GetInsurerClientList();
return res;
}
/// <summary>
/// 获取租箱公司下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetLeasingClientList")]
public DataResult<List<ClientSelectRes>> GetLeasingClientList()
{
var res = _invokeService.GetLeasingClientList();
return res;
}
/// <summary>
/// 获取贸易代理下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetTradingAgencyClientList")]
public DataResult<List<ClientSelectRes>> GetTradingAgencyClientList()
{
var res = _invokeService.GetTradingAgencyClientList();
return res;
}
/// <summary>
/// 获取船代下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetShipAgencyClientList")]
public DataResult<List<ClientSelectRes>> GetShipAgencyClientList()
{
var res = _invokeService.GetShipAgencyClientList();
return res;
}
/// <summary>
/// 获取经营单位下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetEnterpriseClientList")]
public DataResult<List<ClientSelectRes>> GetEnterpriseClientList()
{
var res = _invokeService.GetEnterpriseClientList();
return res;
}
/// <summary>
/// 获取码头下拉列表
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetWharfClientList")]
public DataResult<List<ClientSelectRes>> GetWharfClientList()
{
var res = _invokeService.GetWharfClientList();
return res;
}
///// <summary>
///// 获取所有往来单位下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetAllClientList")]
//public DataResult<List<ClientSelectRes>> GetAllClientList()
//{
// var res = _invokeService.GetAllClientList();
// return res;
//}
///// <summary>
///// 获取船公司下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetCarrierClientList")]
//public DataResult<List<ClientSelectRes>> GetCarrierClientList()
//{
// var res = _invokeService.GetCarrierClientList();
// return res;
//}
///// <summary>
///// 获取场站下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetYardClientList")]
//public DataResult<List<ClientSelectRes>> GetYardClientList()
//{
// var res = _invokeService.GetYardClientList();
// return res;
//}
///// <summary>
///// 获取订舱公司下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetBookingClientList")]
//public DataResult<List<ClientSelectRes>> GetBookingClientList()
//{
// var res = _invokeService.GetBookingClientList();
// return res;
//}
///// <summary>
///// 获取车队下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetTruckClientList")]
//public DataResult<List<ClientSelectRes>> GetTruckClientList()
//{
// var res = _invokeService.GetTruckClientList();
// return res;
//}
///// <summary>
///// 获取委托单位下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetControllerClientList")]
//public DataResult<List<ClientSelectRes>> GetControllerClientList()
//{
// var res = _invokeService.GetControllerClientList();
// return res;
//}
///// <summary>
///// 获取报关行下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetCustomClientList")]
//public DataResult<List<ClientSelectRes>> GetCustomClientList()
//{
// var res = _invokeService.GetCustomClientList();
// return res;
//}
///// <summary>
///// 获取代理(国外)下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetAgentClientList")]
//public DataResult<List<ClientSelectRes>> GetAgentClientList()
//{
// var res = _invokeService.GetAgentClientList();
// return res;
//}
///// <summary>
///// 获取代理(国内)下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetAgentCnClientList")]
//public DataResult<List<ClientSelectRes>> GetAgentCnClientList()
//{
// var res = _invokeService.GetAgentCnClientList();
// return res;
//}
///// <summary>
///// 获取快递公司下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetExpressClientList")]
//public DataResult<List<ClientSelectRes>> GetExpressClientList()
//{
// var res = _invokeService.GetExpressClientList();
// return res;
//}
///// <summary>
///// 获取航空公司下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetAirLinesClientList")]
//public DataResult<List<ClientSelectRes>> GetAirLinesClientList()
//{
// var res = _invokeService.GetAirLinesClientList();
// return res;
//}
///// <summary>
///// 获取发货人下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetShipperClientList")]
//public DataResult<List<ClientSelectRes>> GetShipperClientList()
//{
// var res = _invokeService.GetShipperClientList();
// return res;
//}
///// <summary>
///// 获取收货人下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetConsigneeClientList")]
//public DataResult<List<ClientSelectRes>> GetConsigneeClientList()
//{
// var res = _invokeService.GetConsigneeClientList();
// return res;
//}
///// <summary>
///// 获取通知人下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetNotifyPartyClientList")]
//public DataResult<List<ClientSelectRes>> GetNotifyPartyClientList()
//{
// var res = _invokeService.GetNotifyPartyClientList();
// return res;
//}
///// <summary>
///// 获取仓库下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetWareHouseClientList")]
//public DataResult<List<ClientSelectRes>> GetWareHouseClientList()
//{
// var res = _invokeService.GetWareHouseClientList();
// return res;
//}
///// <summary>
///// 获取保险公司下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetInsurerClientList")]
//public DataResult<List<ClientSelectRes>> GetInsurerClientList()
//{
// var res = _invokeService.GetInsurerClientList();
// return res;
//}
///// <summary>
///// 获取租箱公司下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetLeasingClientList")]
//public DataResult<List<ClientSelectRes>> GetLeasingClientList()
//{
// var res = _invokeService.GetLeasingClientList();
// return res;
//}
///// <summary>
///// 获取贸易代理下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetTradingAgencyClientList")]
//public DataResult<List<ClientSelectRes>> GetTradingAgencyClientList()
//{
// var res = _invokeService.GetTradingAgencyClientList();
// return res;
//}
///// <summary>
///// 获取船代下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetShipAgencyClientList")]
//public DataResult<List<ClientSelectRes>> GetShipAgencyClientList()
//{
// var res = _invokeService.GetShipAgencyClientList();
// return res;
//}
///// <summary>
///// 获取经营单位下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetEnterpriseClientList")]
//public DataResult<List<ClientSelectRes>> GetEnterpriseClientList()
//{
// var res = _invokeService.GetEnterpriseClientList();
// return res;
//}
///// <summary>
///// 获取码头下拉列表
///// </summary>
///// <returns></returns>
//[HttpGet]
//[Route("GetWharfClientList")]
//public DataResult<List<ClientSelectRes>> GetWharfClientList()
//{
// var res = _invokeService.GetWharfClientList();
// return res;
//}
/// <summary>
/// 获取部门列表
/// </summary>

Loading…
Cancel
Save