From 2a983aaa9754e0e51db5fac0b703457e4f0e363a Mon Sep 17 00:00:00 2001 From: quowingwang Date: Fri, 19 Dec 2025 17:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E8=81=94=E7=B3=BB=E4=BA=BA?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/System/SysUserController.cs | 7 ++++--- ZR.Service/System/IService/ISysUserService.cs | 2 +- ZR.Service/System/SysUserService.cs | 8 ++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) 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,