项目下拉修改
continuous-integration/drone/push Build is passing Details

Uat_IRC_Net8
he 2025-02-18 13:35:22 +08:00
parent 77d920a2ef
commit 263f43b1a9
2 changed files with 6 additions and 11 deletions

View File

@ -1384,8 +1384,7 @@ namespace IRaCIS.Core.Application
var isIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer; var isIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer;
var query = _trialRepository.AsQueryable().IgnoreQueryFilters() var query = _trialRepository.AsQueryable().IgnoreQueryFilters()
.WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId) .WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId)
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code)) .WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo)) .WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
@ -1393,7 +1392,6 @@ namespace IRaCIS.Core.Application
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, .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 => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false)) && t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& (t.TrialStatusStr != StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
&& t.IsDeleted == false) && t.IsDeleted == false)
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm)) .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))) .WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialIdentityUserList.Any(t => t.IdentityUser.EMail.Contains(inQuery.PM_EMail)))

View File

@ -10,6 +10,7 @@ using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using NPOI.SS.Formula.Functions;
using Panda.DynamicWebApi.Attributes; using Panda.DynamicWebApi.Attributes;
using ZiggyCreatures.Caching.Fusion; using ZiggyCreatures.Caching.Fusion;
@ -104,15 +105,11 @@ namespace IRaCIS.Core.Application.Service
//过滤废除的项目 //过滤废除的项目
public async Task<List<TrialSelectDTO>> GetTrialSelect() public async Task<List<TrialSelectDTO>> GetTrialSelect()
{ {
List<int> userTypes = new List<int> { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP };
return await _trialRepository.AsQueryable() return await _trialRepository.AsQueryable()
.WhereIf( !userTypes.Contains(_userInfo.UserTypeEnumInt), .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.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)) && t.IsDeleted == false)
&& (t.TrialStatusStr!= StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) .Where(t=>t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId))
&& t.IsDeleted == false) && (t.TrialStatusStr != StaticData.TrialState.TrialStopped || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager))
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync(); .ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
} }