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}";