diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 2e5b0bcad..deeb0691f 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -1471,6 +1471,11 @@ namespace IRaCIS.Core.Application.Contracts return ResponseOutput.Ok(list, config); } + /// + /// 调研表基本信息 + /// + /// + /// [HttpPost] public async Task GetSiteSurveyInfoList(SiteSurveyInfoQuery inQuery) { @@ -1485,5 +1490,25 @@ namespace IRaCIS.Core.Application.Contracts return ResponseOutput.Ok(list, config); } + + /// + /// SPM 是否参与流程 + /// + /// + /// + public async Task GetTrialIsSPMJoin(Guid trialId) + { + var hasSPMOrCPM = await _trialRepository.Where(t => t.Id == trialId).AnyAsync(t => t.TrialIdentityUserList.SelectMany(t => t.TrialUserRoleList).Any(t => + t.UserRole.IdentityUser.Status == UserStateEnum.Enable + && t.UserRole.IsUserRoleDisabled == false + && (t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)) + ); + + var isTrialSPMJoin = await _trialRepository.AnyAsync(t => t.Id == trialId && t.IsSPMJoinSiteSurvey); + + var isSPMjoin = isTrialSPMJoin && hasSPMOrCPM; + + return isSPMjoin; + } } } diff --git a/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs b/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs index 96277fb83..e13678cf2 100644 --- a/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs +++ b/IRaCIS.Core.Domain/SiteSurvey/TrialSiteSurvey.cs @@ -131,5 +131,4 @@ public enum SiteSurveyOptTyp Update = 4, Over=5, - } \ No newline at end of file