From 8b53517f2c96d39305d5fb4622ec932ac2a53978 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 24 Feb 2025 13:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/DTO/UserTypeRoleModel.cs | 2 +- .../Service/Management/UserTypeService.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs index 2b97741d3..aad08ee57 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserTypeRoleModel.cs @@ -53,7 +53,7 @@ namespace IRaCIS.Core.Application.Contracts public string PermissionStr { get; set; } = string.Empty; public int Order { get; set; } - + public bool IsEnable { get; set; } public List UserTypeGroupIdList { get; set; } = new List(); diff --git a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs index e1a7fffae..109d8ed20 100644 --- a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs @@ -20,6 +20,7 @@ namespace IRaCIS.Core.Application.Contracts { var userTypeRoleQueryable = _userTypeRepository + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.IsEnable == true) .WhereIf(!string.IsNullOrWhiteSpace(userTypeQuery.SearchFilter), t => t.Description.Contains(userTypeQuery.SearchFilter!) || t.UserTypeName.Contains(userTypeQuery.SearchFilter!) || t.UserTypeShortName.Contains(userTypeQuery.SearchFilter!)) .WhereIf(userTypeQuery.GroupId != null, t => t.UserTypeGroupList.Any(t => t.DictionaryId == userTypeQuery.GroupId)) @@ -158,7 +159,9 @@ namespace IRaCIS.Core.Application.Contracts public async Task> GetTrialUserTypeList() { //排除其他组的用户 - var query = _userTypeRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin) + var query = _userTypeRepository + .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.IsEnable == true) + .Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin) .Where(t => !t.UserTypeGroupList.Any(t => t.Group.Code == "3")) .OrderBy(t => t.UserTypeShortName).ProjectTo(_mapper.ConfigurationProvider);