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 passing Details

Test_HIR_Net8
hang 2025-08-20 13:25:23 +08:00
commit 893effcefe
2 changed files with 49 additions and 2 deletions

View File

@ -101,9 +101,51 @@ namespace IRaCIS.Core.Application.Service
//过滤废除的项目 //过滤废除的项目
public async Task<List<TrialSelectDTO>> GetTrialSelect() public async Task<List<TrialSelectDTO>> GetTrialSelect()
{ {
return await _trialRepository.AsQueryable() // SuperAdmin Admin OP OA
.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) 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);
other.AddRange(ga);
List<string> trialState = new List<string>() { StaticData.TrialState.TrialOngoing, StaticData.TrialState.TrialCompleted, StaticData.TrialState.TrialStopped };
return await _trialRepository.AsQueryable()
//SuperAdmin Admin OP OA
.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)
// ga
.WhereIf(ga.Contains(_userInfo.UserTypeEnumInt), t => _userInfo.HospitalGroupIdList.Contains(t.HospitalGroupId)&& trialState.Contains(t.TrialStatusStr))
// 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(); .ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
} }

View File

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