From 9a958276db7939c8a1db487bf415ae78a07fe6ca Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 25 Jul 2024 16:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E9=83=A8?= =?UTF-8?q?=E4=BD=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs | 6 +++--- .../Service/TrialSiteUser/TrialConfigService.cs | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 81da08136..f135121b6 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -142,7 +142,7 @@ namespace IRaCIS.Application.Services.BackGroundJob }; // 添加文件更改事件的处理程序 - FileSystemWatcher_US.Changed += (sender, e) => LoadJsonFile(usJsonPath); + FileSystemWatcher_US.Changed += (sender, e) => LoadJsonFile(StaticData.Folder.Resources+"\\"+ StaticData.En_US_Json); FileSystemWatcher_CN = new FileSystemWatcher @@ -153,7 +153,7 @@ namespace IRaCIS.Application.Services.BackGroundJob EnableRaisingEvents = true, }; - FileSystemWatcher_CN.Changed += (sender, e) => LoadJsonFile(cnJsonPath); + FileSystemWatcher_CN.Changed += (sender, e) => LoadJsonFile(StaticData.Folder.Resources + "\\" + StaticData.Zh_CN_Json); } @@ -163,7 +163,7 @@ namespace IRaCIS.Application.Services.BackGroundJob private void LoadJsonFile(string filePath) { Console.WriteLine("刷新json内存数据"); - IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile(filePath,false,true); + IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile(filePath,false,false); IConfigurationRoot enConfiguration = builder.Build(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index f976c86ea..636a8c3b2 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -1346,12 +1346,15 @@ namespace IRaCIS.Core.Application public async Task AddOrUpdateTrialBodyPart(AddOrUpdateTrialBodyPartCommand incommand) { - var codeList = await _repository.Where(t => t.TrialId == incommand.TrialId).Select(t => t.Code).ToListAsync(); + var codeList = await _repository.Where(t => t.TrialId == incommand.TrialId) + .WhereIf(incommand.Id!=null,t=>t.Id!=incommand.Id) + .Select(t => t.Code).ToListAsync(); var newString = incommand.Code; // 检查字符串是否在集合中存在,如果存在,则在后面加上一个数字 int count = 1; + while (codeList.Contains(newString)) { newString = $"{newString}{count}";