根据工位id获取任意上级接口
This commit is contained in:
@@ -78,4 +78,12 @@ public interface IOrganizeService
|
|||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<string>> GetChildOrgId(string id);
|
Task<List<string>> GetChildOrgId(string id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据工位id获取其任意上级
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<OrganizeEntity> GetAnyParentByWorkstationId(string id,string type);
|
||||||
}
|
}
|
||||||
@@ -19,6 +19,7 @@ using JNPF.Systems.Interfaces.System;
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.BasicData;
|
||||||
using Yitter.IdGenerator;
|
using Yitter.IdGenerator;
|
||||||
|
|
||||||
namespace JNPF.Systems;
|
namespace JNPF.Systems;
|
||||||
@@ -835,6 +836,14 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
|
|||||||
return (await _repository.GetListAsync(x => x.OrganizeIdTree.Contains(id) && x.EnabledMark == 1 && x.DeleteMark == null)).Select(x => x.Id).ToList();
|
return (await _repository.GetListAsync(x => x.OrganizeIdTree.Contains(id) && x.EnabledMark == 1 && x.DeleteMark == null)).Select(x => x.Id).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<OrganizeEntity> GetAnyParentByWorkstationId(string id, string type)
|
||||||
|
{
|
||||||
|
return await _repository.AsQueryable()
|
||||||
|
.LeftJoin<OrganizeEntity>((a,b)=>a.OrganizeIdTree.Contains(b.Id) && b.Category==type)
|
||||||
|
.Where((a,b)=>a.Id==id)
|
||||||
|
.Select((a,b)=>b).FirstAsync();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 处理组织树 名称.
|
/// 处理组织树 名称.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user