|
|
@ -967,19 +967,19 @@ public class CommonService : ICommonService
|
|
|
|
/// 获取机构下拉列表
|
|
|
|
/// 获取机构下拉列表
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public DataResult<List<ApiSelectViewModel>> GetOrgList(string queryKey = "")
|
|
|
|
public DataResult<List<OrgApiSelectViewModel>> GetOrgList(string queryKey = "")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var list = db.Queryable<SysOrg>().Where(a => a.Status == StatusEnum.Enable && a.IsDepartment == false)
|
|
|
|
var list = db.Queryable<SysOrg>().Where(a => a.Status == StatusEnum.Enable && a.IsDepartment == false)
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => (a.OrgName.Contains(queryKey) || a.OrgFullName.Contains(queryKey) || a.OrgEnName.Contains(queryKey)))
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(queryKey), a => (a.OrgName.Contains(queryKey) || a.OrgFullName.Contains(queryKey) || a.OrgEnName.Contains(queryKey)))
|
|
|
|
.Select(a => new ApiSelectViewModel
|
|
|
|
.Select(a => new OrgApiSelectViewModel
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Label = a.OrgName,
|
|
|
|
Label = a.OrgName,
|
|
|
|
Value = a.Id,
|
|
|
|
Id = a.Id,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.Take(20)
|
|
|
|
.Take(20)
|
|
|
|
.WithCache($"{SqlSugarCacheConst.Org}{user.TenantId}")
|
|
|
|
.WithCache($"{SqlSugarCacheConst.Org}{user.TenantId}")
|
|
|
|
.ToList();
|
|
|
|
.ToList();
|
|
|
|
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", list);
|
|
|
|
return DataResult<List<OrgApiSelectViewModel>>.Success("获取数据成功!", list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 获取机构下拉列表
|
|
|
|
#endregion 获取机构下拉列表
|
|
|
|