From 04e4e786b08bea9ca07771be6d9ff8b959366799 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 26 Nov 2024 10:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Doctor/DoctorService.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs index 288ebff2d..8d41dda22 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs @@ -246,8 +246,19 @@ namespace IRaCIS.Core.Application.Service await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true); } } + + if (inDto.TrialId == null) + { + var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync(); + if (systemCount == 0) + { + inDto.IsMain = true; + } + } + if (inDto.TrialId == null && inDto.IsMain) { + await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null, x => new DoctorSummarize() {