From 721826e346b2b7ff930348b422701fff4b153212 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 20 Aug 2025 11:18:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/TrialService.cs | 43 ++++++++++++++++++- IRaCIS.Core.Domain/Trial/Trial.cs | 5 +++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index e45d2bfcf..e7218afef 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -101,9 +101,48 @@ namespace IRaCIS.Core.Application.Service //过滤废除的项目 public async Task> 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 sap = new List() { (int)UserTypeEnum.SuperAdmin, (int)UserTypeEnum.Admin, (int)UserTypeEnum.OP, (int)UserTypeEnum.OA }; + // pm + List pm = new List() { (int)UserTypeEnum.ProjectManager }; + + // QA EA + List qAEq = new List() { (int)UserTypeEnum.QA, (int)UserTypeEnum.EA }; + + // GA + List ga = new List() { (int)UserTypeEnum.GA }; + + List other = new List() { }; + + other.AddRange(sap); + other.AddRange(pm); + other.AddRange(qAEq); + + List trialState = new List() { 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(_mapper.ConfigurationProvider).ToListAsync(); } diff --git a/IRaCIS.Core.Domain/Trial/Trial.cs b/IRaCIS.Core.Domain/Trial/Trial.cs index 20664a6fb..9cd1a1f7d 100644 --- a/IRaCIS.Core.Domain/Trial/Trial.cs +++ b/IRaCIS.Core.Domain/Trial/Trial.cs @@ -19,6 +19,11 @@ public partial class Trial : BaseFullDeleteAuditEntity public List TrialBodyPartList { get; set; } [JsonIgnore] public List TaskMedicalReviewList { get; set; } + + + [JsonIgnore] + public List TrialIdentityUserList { get; set; } + [JsonIgnore] public List TaskConsistentRuleList { get; set; } [JsonIgnore] From b301d51b2dcf73a0ddfae13951c4609168479917 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 20 Aug 2025 11:21:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index e7218afef..6dd57d482 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -118,6 +118,7 @@ namespace IRaCIS.Core.Application.Service other.AddRange(sap); other.AddRange(pm); other.AddRange(qAEq); + other.AddRange(ga); List trialState = new List() { StaticData.TrialState.TrialOngoing, StaticData.TrialState.TrialCompleted, StaticData.TrialState.TrialStopped }; @@ -132,6 +133,8 @@ namespace IRaCIS.Core.Application.Service && 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(x.TrialStatusStr)) // QA EA .WhereIf(qAEq.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false From 53007ccb6aeb10f3bf95c483557aaeddcdf05cae Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 20 Aug 2025 11:30:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 6dd57d482..8cf136a27 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -125,7 +125,7 @@ namespace IRaCIS.Core.Application.Service return await _trialRepository.AsQueryable() - //SuperAdmin Admin OP + //SuperAdmin Admin OP OA .WhereIf(sap.Contains(_userInfo.UserTypeEnumInt), x => trialState.Contains(x.TrialStatusStr)) // pm @@ -134,7 +134,7 @@ namespace IRaCIS.Core.Application.Service && t.IsDeleted == false) // ga - .WhereIf(ga.Contains(_userInfo.UserTypeEnumInt), t => _userInfo.HospitalGroupIdList.Contains(t.HospitalGroupId)&& trialState.Contains(x.TrialStatusStr)) + .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