获取机构修改

dev
cjy 2 months ago
parent 5441b21e18
commit 5adbb97c5c

@ -15,3 +15,20 @@ public class ApiSelectViewModel
/// </summary>
public long Value { get; set; }
}
/// <summary>
/// 机构远程Api 下拉选项
/// </summary>
public class OrgApiSelectViewModel
{
/// <summary>
///
/// </summary>
public string Label { get; set; }
/// <summary>
///
/// </summary>
public long Id { get; set; }
}

@ -101,7 +101,7 @@ public interface ICommonService
/// 获取机构下拉列表
/// </summary>
/// <returns></returns>
DataResult<List<ApiSelectViewModel>> GetOrgList(string queryKey = "");
DataResult<List<OrgApiSelectViewModel>> GetOrgList(string queryKey = "");
/// <summary>
/// 获取商品类型下拉列表
/// </summary>

@ -967,19 +967,19 @@ public class CommonService : ICommonService
/// 获取机构下拉列表
/// </summary>
/// <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)
.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,
Value = a.Id,
Id = a.Id,
})
.Take(20)
.WithCache($"{SqlSugarCacheConst.Org}{user.TenantId}")
.ToList();
return DataResult<List<ApiSelectViewModel>>.Success("获取数据成功!", list);
return DataResult<List<OrgApiSelectViewModel>>.Success("获取数据成功!", list);
}
#endregion 获取机构下拉列表

@ -164,7 +164,7 @@ public class CommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetOrgList")]
public DataResult<List<ApiSelectViewModel>> GetOrgList([FromQuery] string queryKey = "")
public DataResult<List<OrgApiSelectViewModel>> GetOrgList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetOrgList(queryKey);
return res;

Loading…
Cancel
Save