diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 46ead0b40..5bcb1c088 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -1393,7 +1393,7 @@ namespace IRaCIS.Core.Application .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false && t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false)) - && t.TrialStatusStr != StaticData.TrialState.TrialStopped + && (t.TrialStatusStr != StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) && t.IsDeleted == false) .WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm)) .WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialIdentityUserList.Any(t => t.IdentityUser.EMail.Contains(inQuery.PM_EMail))) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 281969f8e..2fbb97757 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -6,6 +6,7 @@ using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; +using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; @@ -103,10 +104,13 @@ namespace IRaCIS.Core.Application.Service //过滤废除的项目 public async Task> GetTrialSelect() { + + List userTypes = new List { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP }; + return await _trialRepository.AsQueryable() - .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, + .WhereIf( !userTypes.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) - && t.TrialStatusStr!= StaticData.TrialState.TrialStopped + && (t.TrialStatusStr!= StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) && t.IsDeleted == false) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync();