diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 841f975e3..13eb261ef 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -55,6 +55,7 @@ namespace IRaCIS.Application.Services { [ApiExplorerSettings(GroupName = "HIR")] public class PatientService(IRepository _studySubjectVisitRepository, + IRepository _trialIdentityUserRepository, IRepository _subjectPatientRepository, IRepository _SCPStudyHospitalGroupRepository, IRepository _trialRepository, IRepository _cmoveStudyRepository, @@ -316,7 +317,14 @@ namespace IRaCIS.Application.Services //如果是PM, 则需要将该人员添加到 运维人员表 //添加运维人员PM - await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trial.Id, UserId = _userInfo.UserRoleId, JoinTime = DateTime.Now }); + await _trialIdentityUserRepository.AddAsync(new TrialIdentityUser() + { + TrialId = trial.Id, + IdentityUserId = _userInfo.IdentityUserId, + JoinTime = DateTime.Now, + TrialUserRoleList = new List(){ + new TrialUserRole(){TrialId=trial.Id,UserId=_userInfo.UserRoleId} } + }); //默认采用系统邮件