From 490306f5c45a4655c4d2bbd47c0c5afefb52576c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 16 Nov 2022 15:37:10 +0800 Subject: [PATCH] =?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/WorkLoad/EnrollService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs b/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs index bb2793a3d..07f5f4b0e 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs @@ -391,10 +391,14 @@ namespace IRaCIS.Application.Services if( !await _trialUserRepository.AnyAsync(t=>t.TrialId==trialId && t.UserId== userId, true)) { await _trialUserRepository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId }); + } - await _enrollRepository.BatchUpdateNoTrackingAsync(t => t.Id == intoGroupItem.Id, u => new Enroll() { DoctorUserId = userId }); + await _enrollRepository.BatchUpdateNoTrackingAsync(t => t.Id == intoGroupItem.Id, u => new Enroll() { DoctorUserId = userId }); + + if (!await _taskAllocationRuleRepository.AnyAsync(t => t.TrialId == trialId && t.DoctorUserId == userId&& t.EnrollId == intoGroupItem.Id, true)) + { + await _taskAllocationRuleRepository.AddAsync(new TaskAllocationRule() { TrialId = trialId, DoctorUserId = userId, EnrollId = intoGroupItem.Id }); - await _taskAllocationRuleRepository.AddAsync(new TaskAllocationRule() { TrialId = trialId, DoctorUserId = userId,EnrollId= intoGroupItem.Id }); }