@@ -124,9 +124,15 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
else
|
||||
{
|
||||
// 先添加
|
||||
await GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||
{
|
||||
DoctorId = inDto.DoctorId,
|
||||
TrialId = inDto.TrialId.Value,
|
||||
});
|
||||
// 当前项目没有则复制
|
||||
if (!(await _trialExperienceRepository.AnyAsync(x => x.TrialId == inDto.TrialId&&x.DoctorId==inDto.DoctorId &&x.ExperienceDataType== ExperienceDataType.Trial))
|
||||
&&!(await _doctorRepository.AnyAsync(x => x.TrialId == inDto.TrialId && x.DoctorId == inDto.DoctorId))
|
||||
&&!(await _doctorRepository.AnyAsync(x => x.TrialId == inDto.TrialId && x.IsAddTrialExperienceToTrial==false && x.DoctorId == inDto.DoctorId))
|
||||
)
|
||||
{
|
||||
var trialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == inDto.DoctorId)
|
||||
@@ -151,6 +157,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
await _trialExperienceCriteriaRepository.AddRangeAsync(criteriaList);
|
||||
await _trialExperienceRepository.AddRangeAsync(trialExperienceList);
|
||||
await _doctorRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId, x => new Doctor()
|
||||
{
|
||||
IsAddTrialExperienceToTrial=true
|
||||
|
||||
});
|
||||
await _trialExperienceRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user