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

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,

@ -249,7 +249,7 @@ public class ClientCommonController : ApiController
/// 获取往来单位下拉集合列表
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpGet, Obsolete]
[Route("GetMultiClientList")]
public async Task<DataResult<List<ClientSelectMultiRes>>> GetMultiClientList()
{

Loading…
Cancel
Save