diff --git a/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs b/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs index a0e71f568..9c0124c9b 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs @@ -194,6 +194,7 @@ namespace IRaCIS.Application.Services var trial = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId); + var hasSPMOrCPM = await _repository.AnyAsync(t => t.TrialId == trialId && t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM); if (trial != null) { @@ -217,15 +218,14 @@ namespace IRaCIS.Application.Services { if (doctorIdArray.Contains(intoGroupItem.DoctorId)) { - intoGroupItem.EnrollStatus = EnrollStatus.HasCommittedToCRO; - //_enrollRepository.Update(intoGroupItem); + intoGroupItem.EnrollStatus = hasSPMOrCPM ? EnrollStatus.HasCommittedToCRO : EnrollStatus.InviteIntoGroup; await _enrollDetailRepository.AddAsync(new EnrollDetail() { TrialDetailId = trialDetail.Id, DoctorId = intoGroupItem.DoctorId, TrialId = trialId, - EnrollStatus = EnrollStatus.HasCommittedToCRO, + EnrollStatus = hasSPMOrCPM? EnrollStatus.HasCommittedToCRO :EnrollStatus.InviteIntoGroup, OptUserType = (int)SystemUserType.AdminUser, //后台用户 }); }