往来单位下拉列表接口修复

dev
嵇文龙 2 weeks ago
parent 79cb476603
commit 3f2a020ef8

@ -243,16 +243,16 @@ public class ClientCommonService : IClientCommonService
var exp = Expressionable.Create<InfoClient>();
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()).Where(exp.ToExpression());
var queryData2 = queryData.Where(conditions);
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 == "isController").Any()).Where(exp.ToExpression());
var queryData2 = queryData.Where(c=> SqlFunc.Subqueryable<InfoClientAttribute>().Where(
b => b.ClientId == c.Id && b.Value == "isController").Any()).Where(conditions);
var queryData0 = tenantDb.UnionAll(queryData1, queryData2);
//code = code.ToLower();
var data = await queryData0
.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
.Where(a => a.Status == StatusEnum.Enable.ToEnumInt()) //&& c.CreateBy == long.Parse(user.UserId) && c.StartDate <= DateTime.Now && c.EndDate >= DateTime.Now
.WhereIF(!string.IsNullOrEmpty(queryKey), (a) => a.CodeName.Contains(queryKey) || a.ShortName.Contains(queryKey) || a.Description.Contains(queryKey))
.Select((a) => 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,

@ -64,7 +64,7 @@ public class ClientCommonController : ApiController
/// <param name="queryKey">搜索关键词(可空)</param>
/// <returns></returns>
[HttpGet, Route("GetServiceItem")]
public async Task<DataResult<List<SelectListItem>>> GetServiceItemAsync(BusinessType businessType, string? queryKey = null)
public async Task<DataResult<List<SelectListItem>>> GetServiceItemAsync(BusinessType businessType, string? queryKey = null)
{
return await _invokeService.GetServiceItemAsync(businessType, queryKey);
}
@ -75,7 +75,7 @@ public class ClientCommonController : ApiController
/// <param name="queryKey">搜索关键词(可空)</param>
/// <returns></returns>
[HttpGet, Route("GetStlMode")]
public async Task<DataResult<List<CodeStlModeRes>>> GetStlModeAsync(string? queryKey = null)
public async Task<DataResult<List<CodeStlModeRes>>> GetStlModeAsync(string? queryKey = null)
{
return await _invokeService.GetStlModeAsync(queryKey);
}
@ -87,7 +87,7 @@ public class ClientCommonController : ApiController
/// <param name="queryKey">搜索关键词(可空)</param>
/// <returns></returns>
[HttpGet, Route("GetClientBank")]
public async Task<DataResult<List<ClientBankRes>>> GetClientBankAsync(long id, string? queryKey = null)
public async Task<DataResult<List<ClientBankRes>>> GetClientBankAsync(long id, string? queryKey = null)
{
return await _invokeService.GetClientBankAsync(id, queryKey);
}
@ -249,7 +249,7 @@ public class ClientCommonController : ApiController
/// 获取往来单位下拉集合列表
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpGet, Obsolete]
[Route("GetMultiClientList")]
public async Task<DataResult<List<ClientSelectMultiRes>>> GetMultiClientList()
{
@ -364,7 +364,7 @@ public class ClientCommonController : ApiController
var res = _invokeService.GetAllClientList(id, type);
return res;
}
/// <summary>
/// 获取部门列表
/// </summary>

Loading…
Cancel
Save