From 7b53756753bac1b967088458fa5c2224d928c6ad Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 19 Jan 2024 15:12:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9=E5=8C=BB=E7=94=9Fbug=20?= =?UTF-8?q?=E5=92=8Csite=20bug]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Doctor/DoctorService.cs | 2 +- IRaCIS.Core.Application/Service/Institution/SiteService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs index 8c452b890..4f4a09421 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs @@ -79,7 +79,7 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk(_localizer["Doctor_DupEmail"], new DoctorBasicInfoCommand()); } - doctor.Code = (await _doctorRepository.MaxAsync(t => t.Code)) + 1; + doctor.Code = await _doctorRepository.Select(t => t.Code).DefaultIfEmpty().MaxAsync() + 1; doctor.ReviewerCode = AppSettings.GetCodeStr(doctor.Code, nameof(Doctor)); diff --git a/IRaCIS.Core.Application/Service/Institution/SiteService.cs b/IRaCIS.Core.Application/Service/Institution/SiteService.cs index 4a78b453a..9d77f48ed 100644 --- a/IRaCIS.Core.Application/Service/Institution/SiteService.cs +++ b/IRaCIS.Core.Application/Service/Institution/SiteService.cs @@ -67,7 +67,7 @@ namespace IRaCIS.Application.Services siteCommand.Code = await _siteRepository.Select(t => t.Code).DefaultIfEmpty().MaxAsync() + 1; - siteCommand.SiteCode = AppSettings.GetCodeStr(siteCommand.Code, nameof(User)); + siteCommand.SiteCode = AppSettings.GetCodeStr(siteCommand.Code, nameof(Site)); } var site = await _siteRepository.InsertOrUpdateAsync(siteCommand, true, exp);