分单操作

master
wanghaomei 6 months ago
parent efa2289cac
commit f767c226c6

@ -17790,6 +17790,14 @@
<param name="tenantId">默认0 获取当前用户,可不传 传租户id获取当前租户</param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysUserService.GetTenantUserByRole(System.String,System.String)">
<summary>
根据角色代码获取用户
</summary>
<param name="keyword">关键字</param>
<param name="roleCode">角色代码</param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysUserService.QueryUserByPos(System.String,System.String)">
<summary>
通过职位获取用户信息

@ -648,18 +648,25 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
.OrderBy(x => x.Name).ToListAsync();
}
[HttpGet("/sysUser/DecryptPassword")]
public async Task<string> DecryptPassword(long id)
/// <summary>
/// 根据角色代码获取用户
/// </summary>
/// <param name="keyword">关键字</param>
/// <param name="roleCode">角色代码</param>
/// <returns></returns>
[HttpGet("/sysUser/GetTenantUserByRole")]
public async Task<List<SysUser>> GetTenantUserByRole(string keyword, string roleCode)
{
if (UserManager.IsSuperAdmin)
{
var user = await _sysUserRep.AsQueryable().Filter(null, false).FirstAsync(u => u.Id == id);
var keyDES = App.GetOptions<EncryptKeyOptions>().DES;
var pwdDecrypt = DESCEncryption.Decrypt(user.Password, keyDES);
return pwdDecrypt;
}
var list = await _sysUserRep.AsQueryable()
.InnerJoin<SysUserRole>((u, ur) => u.Id == ur.SysUserId)
.InnerJoin<SysRole>((u, ur, r) => ur.SysRoleId == r.Id)
.WhereIF(!string.IsNullOrEmpty(keyword), (u, ur, r) => u.Name.Contains(keyword) || u.UserCode.StartsWith(keyword))
.Where((u, ur, r) => r.Code == roleCode && u.Status == CommonStatus.ENABLE)
.Select((u, ur, r) => u)
.OrderBy(u => u.Name)
.ToListAsync();
throw Oops.Bah("没有权限");
return list;
}
/// <summary>

Loading…
Cancel
Save