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);