From 0c56b55c2ab64904ec33b5b2659a7895f8e47c17 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 28 Jun 2023 09:23:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helper/InternationalizationHelper.cs | 43 +++++++++++++++++++ .../TrialSiteUser/PersonalWorkstation.cs | 6 +-- 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 IRaCIS.Core.Application/Helper/InternationalizationHelper.cs diff --git a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs new file mode 100644 index 000000000..47270ae7d --- /dev/null +++ b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs @@ -0,0 +1,43 @@ +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static BeetleX.Redis.Commands.HSCAN; +using static IRaCIS.Core.Application.Service.Common.SystemMonitor; + +namespace IRaCIS.Core.Application.Helper +{ + public static class InternationalizationHelper + { + + public static void AddOrUpdateJsonKeyValueAsync(string jsonFileFolder,string key ,string value) + { + + + + if (!Directory.Exists(jsonFileFolder) || + Directory.GetFiles(jsonFileFolder).Any(filePath => Path.GetExtension(filePath).Equals(".json", StringComparison.OrdinalIgnoreCase))) + { + throw new BusinessValidationFailedException("国际化Json文件目录有误"); + } + + var json = File.ReadAllText("appsettings.json"); + + JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load }); + + + // 添加或更新指定的键值对 + jsonObject[key] = value; + + //jsonObject["testArray"] = JArray.FromObject(generalRules); + + // 将更改保存回 Json 文件 + File.WriteAllText(jsonFilePath, jsonObject.ToString()); + + } + } +} diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index e4ae123d9..547f7dc5f 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -204,7 +204,7 @@ namespace IRaCIS.Core.Application - var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); + var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(CheckToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync(); @@ -246,7 +246,7 @@ namespace IRaCIS.Core.Application }); - var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); + var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApplyToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var toBeApprovalCount = _visitTaskReReadingRepository @@ -283,7 +283,7 @@ namespace IRaCIS.Core.Application ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count() }); - var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc); + var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync(); From 808ade6e8d3d6df41e9b551b1db1dacd8415a33e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 28 Jun 2023 09:35:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Helper/InternationalizationHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs index 47270ae7d..8b09c78cb 100644 --- a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs +++ b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs @@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Helper //jsonObject["testArray"] = JArray.FromObject(generalRules); // 将更改保存回 Json 文件 - File.WriteAllText(jsonFilePath, jsonObject.ToString()); + //File.WriteAllText(jsonFilePath, jsonObject.ToString()); } } From c63251b832471ff171ca7cfd56afd7fb01f2df26 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 28 Jun 2023 10:03:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helper/InternationalizationHelper.cs | 23 ++++++++++--------- .../Service/Doctor/TrialExperienceService.cs | 2 -- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs index 8b09c78cb..e1feefcea 100644 --- a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs +++ b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs @@ -14,29 +14,30 @@ namespace IRaCIS.Core.Application.Helper public static class InternationalizationHelper { - public static void AddOrUpdateJsonKeyValueAsync(string jsonFileFolder,string key ,string value) + public static async void AddOrUpdateJsonKeyValueAsync(string key, string value) { + var jsonFileFolder = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources); - - if (!Directory.Exists(jsonFileFolder) || + if (!Directory.Exists(jsonFileFolder) || Directory.GetFiles(jsonFileFolder).Any(filePath => Path.GetExtension(filePath).Equals(".json", StringComparison.OrdinalIgnoreCase))) { throw new BusinessValidationFailedException("国际化Json文件目录有误"); } - var json = File.ReadAllText("appsettings.json"); + // + foreach (var filePath in Directory.GetFiles(jsonFileFolder).Where(filePath => Path.GetExtension(filePath).Equals(".json", StringComparison.OrdinalIgnoreCase))) + { + var json = await File.ReadAllTextAsync(filePath); - JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load }); + JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load }); + // 添加或更新指定的键值对 + jsonObject[key] = value; - // 添加或更新指定的键值对 - jsonObject[key] = value; + await File.WriteAllTextAsync(filePath, jsonObject.ToString()); - //jsonObject["testArray"] = JArray.FromObject(generalRules); - - // 将更改保存回 Json 文件 - //File.WriteAllText(jsonFilePath, jsonObject.ToString()); + } } } diff --git a/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs b/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs index 16a7a2ee1..6f629e9db 100644 --- a/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs @@ -155,8 +155,6 @@ namespace IRaCIS.Application.Services await _repository.BatchDeleteAsync(a => a.Id == updateGCPExperienceParam.GCPId); } - - return ResponseOutput.Result(successs, updateGCPExperienceParam.GCPId.ToString()); } From 4c4905e60b0558e5e8e97042cca4b18a7f34f3e4 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 28 Jun 2023 11:59:23 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9hospital?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Institution/HospitalService.cs | 10 ++++++---- IRaCIS.Core.Domain/SQLFile/20230613.sql | 13 ++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Institution/HospitalService.cs b/IRaCIS.Core.Application/Service/Institution/HospitalService.cs index 7df472ba9..28ba06b8b 100644 --- a/IRaCIS.Core.Application/Service/Institution/HospitalService.cs +++ b/IRaCIS.Core.Application/Service/Institution/HospitalService.cs @@ -35,12 +35,14 @@ namespace IRaCIS.Application.Services VerifyMsg = _localizer["Hospital_DupName"] }; - if (await _hospitalRepository.AnyAsync(x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null)) + var exp1 = new EntityVerifyExp() { - //---当前Site已经添加到其他Hospital了 - throw new BusinessValidationFailedException(_localizer["Hospital_SiteAdded"]); - } + VerifyExp = x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null, + //---已经存在同名的医院,请确认。 + VerifyMsg = _localizer["Hospital_SiteAdded"] + }; + var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp); return ResponseOutput.Ok(hospital.Id.ToString()); diff --git a/IRaCIS.Core.Domain/SQLFile/20230613.sql b/IRaCIS.Core.Domain/SQLFile/20230613.sql index 24e792201..c071ae52a 100644 --- a/IRaCIS.Core.Domain/SQLFile/20230613.sql +++ b/IRaCIS.Core.Domain/SQLFile/20230613.sql @@ -90,4 +90,15 @@ WHERE ---------------------------维护临床数据是否应用 之前默认都是应用 现在添加字段 把状态都改为应用 - update ClinicalDataTrialSet set IsApply=1 \ No newline at end of file + update ClinicalDataTrialSet set IsApply=1 + + +--维护 删除临床数据配置,导致删除阅片期问题 + delete ReadingClinicalData +--88020000-3E02-0016-9DA6-08DB6705F7C1 +--select * +from ReadingClinicalData +INNER JOIN ReadModule on ReadingClinicalData.ReadingId = ReadModule.Id + + +where not EXISTS (select Id from TrialClinicalDataSetCriterion where ReadModule.TrialReadingCriterionId =TrialClinicalDataSetCriterion.TrialReadingCriterionId) \ No newline at end of file