From 888be6430a0816c5147a42aeea19540ad01825af Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 21 Nov 2024 16:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8E=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Doctor/DoctorListService.cs | 1 + .../SiteSurvey/DTO/TrialSiteSurveyViewModel.cs | 2 ++ .../SiteSurvey/TrialSiteSurveyService.cs | 18 ++++++++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs b/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs index 58d844598..f9cbbbb17 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs @@ -77,6 +77,7 @@ namespace IRaCIS.Core.Application.Service var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/ .Where(x=>x.TrialId==null) + .WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId) .WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId) .WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual == true) diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs index 09856aa93..4ecea22d6 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs @@ -231,6 +231,8 @@ namespace IRaCIS.Core.Application.Contracts public class UseEmialGetDoctorInfoInDto { public string EmailOrPhone { get; set; } + + public Guid TrialId { get; set; } } public class VerifyEmialGetDoctorInfoInDto diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index f585a1a84..29e1bf50f 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -125,6 +125,8 @@ namespace IRaCIS.Core.Application.Contracts { var dockerInfo = await _doctorRepository.Where(t => t.EMail == inDto.EmailOrPhone || t.Phone == inDto.EmailOrPhone).FirstOrDefaultAsync(); + + if (dockerInfo != null) { return new UseEmialGetDoctorInfoOutDto() @@ -134,13 +136,21 @@ namespace IRaCIS.Core.Application.Contracts } else { + + var isVirtual = true; + + if (inDto.TrialId != null) + { + isVirtual = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => x.TrialType != TrialType.OfficialTrial).FirstNotNullAsync(); + } + Doctor doctor = new Doctor() { EMail = inDto.EmailOrPhone, - IsVirtual = false, - AcceptingNewTrial = false, - ActivelyReading = false, - CooperateStatus = ContractorStatusEnum.Noncooperation, + IsVirtual = isVirtual, + AcceptingNewTrial = true, + ResumeStatus = ResumeStatusEnum.Pass, + CooperateStatus = ContractorStatusEnum.Cooperation, ReviewStatus = ReviewerInformationConfirmStatus.ConfirmRefuse };