Compare commits

..

2 Commits

Author SHA1 Message Date
he b5d259f907 Merge branch 'Test_HIR_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_HIR_Net8
continuous-integration/drone/push Build is running Details
2025-08-20 11:18:11 +08:00
he 721826e346 修改项目下拉查询 2025-08-20 11:18:10 +08:00
2 changed files with 46 additions and 2 deletions

View File

@ -101,9 +101,48 @@ namespace IRaCIS.Core.Application.Service
//过滤废除的项目
public async Task<List<TrialSelectDTO>> GetTrialSelect()
{
return await _trialRepository.AsQueryable()
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId) && t.IsDeleted == false)
// SuperAdmin Admin OP OA
List<int> sap = new List<int>() { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP, (int)UserTypeEnum.OA };
// pm
List<int> pm = new List<int>() { (int)UserTypeEnum.ProjectManager };
// QA EA
List<int> qAEq = new List<int>() { (int)UserTypeEnum.QA, (int)UserTypeEnum.EA };
// GA
List<int> ga = new List<int>() { (int)UserTypeEnum.GA };
List<int> other = new List<int>() { };
other.AddRange(sap);
other.AddRange(pm);
other.AddRange(qAEq);
List<string> trialState = new List<string>() { StaticData.TrialState.TrialOngoing, StaticData.TrialState.TrialCompleted, StaticData.TrialState.TrialStopped };
return await _trialRepository.AsQueryable()
//SuperAdmin Admin OP
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt), x => trialState.Contains(x.TrialStatusStr))
// pm
.WhereIf(pm.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false)
// QA EA
.WhereIf(qAEq.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false && trialState.Contains(t.TrialStatusStr))
// other
.WhereIf(!other.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
&& t.IsDeleted == false && t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
}

View File

@ -19,6 +19,11 @@ public partial class Trial : BaseFullDeleteAuditEntity
public List<TrialBodyPart> TrialBodyPartList { get; set; }
[JsonIgnore]
public List<TaskMedicalReview> TaskMedicalReviewList { get; set; }
[JsonIgnore]
public List<TrialIdentityUser> TrialIdentityUserList { get; set; }
[JsonIgnore]
public List<TaskConsistentRule> TaskConsistentRuleList { get; set; }
[JsonIgnore]