diff --git a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs index 5387af99..84d3e60e 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysUserController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysUserController.cs @@ -214,10 +214,11 @@ namespace ZR.Admin.WebApi.Controllers.System return ExportExcel(result.Item2, result.Item1); } - [HttpGet("getPullDown")] - public ApiResult GetUserPullDown() + [HttpGet("getAlarmPullDown")] + [AllowAnonymous] + public ApiResult GetAlarmUserPullDown() { - var apiResult = UserService.GetUserPullDown(); + var apiResult = UserService.GetAlarmUserPullDown(); return apiResult; } } diff --git a/ZR.Service/System/IService/ISysUserService.cs b/ZR.Service/System/IService/ISysUserService.cs index 19cd71bf..b9bf8430 100644 --- a/ZR.Service/System/IService/ISysUserService.cs +++ b/ZR.Service/System/IService/ISysUserService.cs @@ -82,6 +82,6 @@ namespace ZR.Service.System.IService SysUser Login(LoginBodyDto user); void UpdateLoginInfo(LoginBodyDto user, long userId); - ApiResult GetUserPullDown(); + ApiResult GetAlarmUserPullDown(); } } diff --git a/ZR.Service/System/SysUserService.cs b/ZR.Service/System/SysUserService.cs index 4ea0bbd4..e1343ddf 100644 --- a/ZR.Service/System/SysUserService.cs +++ b/ZR.Service/System/SysUserService.cs @@ -336,11 +336,15 @@ namespace ZR.Service Update(new SysUser() { LoginIP = user.LoginIP, LoginDate = DateTime.Now, UserId = userId }, it => new { it.LoginIP, it.LoginDate }); } - public ApiResult GetUserPullDown() + public ApiResult GetAlarmUserPullDown() { try { - var queryData = Queryable() + string sql = @"select u.UserId,u.UserName from sys_user u + inner join sys_user_role ur on u.UserId = ur.user_id + inner join sys_role r on r.RoleId = ur.role_id + where r.RoleName = '报警联系人'"; + var queryData = SqlQueryToList(sql) .Select(it => new UserPullDownDto { label = it.UserName,