diff --git a/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs b/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs index 3adc80599..447d291cc 100644 --- a/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs @@ -74,7 +74,8 @@ namespace IRaCIS.Application.Services.BusinessFilter else if(statusCode != 200&&!(objectResult.Value is IResponseOutput)) { - var apiResponse = ResponseOutput.NotOk("Program error, please contact developer."); + //---程序错误,请联系开发人员。 + var apiResponse = ResponseOutput.NotOk(StaticData.International("UnifiedAPI_ProgramError")); objectResult.Value = apiResponse; objectResult.DeclaredType = apiResponse.GetType(); @@ -114,4 +115,4 @@ namespace IRaCIS.Application.Services.BusinessFilter return false; } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs index e8da8a52b..53f8cf11d 100644 --- a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs @@ -93,14 +93,16 @@ public static class FileStoreHelper if (systemClinicalData == null || systemClinicalData.Path == string.Empty) { - throw new BusinessValidationFailedException("数据库没有找到对应的数据模板文件,请联系系统运维人员。"); + //---数据库没有找到对应的数据模板文件,请联系系统运维人员。 + throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileNotFound")); } var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, systemClinicalData.Path); if (!System.IO.File.Exists(filePath)) { - throw new BusinessValidationFailedException("数据模板文件存储路径上未找对应文件,请联系系统运维人员。"); + //---数据模板文件存储路径上未找对应文件,请联系系统运维人员。 + throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileStoragePathInvalid")); } return (filePath, systemClinicalData.FileName); @@ -121,14 +123,16 @@ public static class FileStoreHelper if (trialClinicalData == null|| trialClinicalData.Path==string.Empty) { - throw new BusinessValidationFailedException("数据库没有找到对应的数据模板文件,请联系系统运维人员。"); + //---数据库没有找到对应的数据模板文件,请联系系统运维人员。 + throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileNotFound")); } var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, trialClinicalData.Path); if (!System.IO.File.Exists(filePath)) { - throw new BusinessValidationFailedException("数据模板文件存储路径上未找对应文件,请联系系统运维人员。"); + //---数据模板文件存储路径上未找对应文件,请联系系统运维人员。 + throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileStoragePathInvalid")); } return (filePath, trialClinicalData.FileName); @@ -143,14 +147,16 @@ public static class FileStoreHelper if (doc == null) { - throw new BusinessValidationFailedException("数据库没有找到对应的数据模板文件,请联系系统运维人员。"); + //---数据库没有找到对应的数据模板文件,请联系系统运维人员。 + throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileNotFound")); } var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, doc.Path); if (!System.IO.File.Exists(filePath)) { - throw new BusinessValidationFailedException("数据模板文件存储路径上未找对应文件,请联系系统运维人员。"); + //---数据模板文件存储路径上未找对应文件,请联系系统运维人员。 + throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileStoragePathInvalid")); } return (filePath, doc.Name.Trim('/')); diff --git a/IRaCIS.Core.Application/Helper/SendEmailHelper.cs b/IRaCIS.Core.Application/Helper/SendEmailHelper.cs index 45a129e77..41ed362a2 100644 --- a/IRaCIS.Core.Application/Helper/SendEmailHelper.cs +++ b/IRaCIS.Core.Application/Helper/SendEmailHelper.cs @@ -42,7 +42,8 @@ public static class SendEmailHelper catch (Exception ex) { - throw new Exception("邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员"); + //---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员 + throw new Exception(StaticData.International("SendEmail_SendFail")); } @@ -62,7 +63,8 @@ public static class SendEmailHelper if (sMTPEmailConfig.ToMailAddressList.Count == 0) { - throw new ArgumentException("没有收件人"); + //---没有收件人 + throw new ArgumentException(StaticData.International("SendEmail_NoRecipient")); } else { diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index b3235d739..94a5b6519 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -507,7 +507,7 @@ //SubjectVisitFinalVisitTrigger "SubjectVisit_CannotSetAsLastVisit": "The subject's follow-up visits has uploaded images or submitted , and the current visit is not allowed to be set as the last visit.", - // ------------------------------------------------------------Helper-------------------------------------------------------------------- + // ------------------------------------------------------------BusinessFilter-------------------------------------------------------------------- //LimitUserRequestAuthorization "LimitUser_AuthTokenMissing": "User token was not retrieved from Header/URL, please contact developer", "LimitUser_AccountLoggedInElsewhere": "User token was not retrieved from Header/URL, please contact developer", @@ -522,6 +522,14 @@ "TrialResource_InterceptedProjectStatusRule": "This request was blocked by configured rules: only operations allowed when project status is in progress, please contact developer if this logic is incorrect and needs to be modified", "TrialResource_MissingProjectNumber": "Project number not passed in the API parameters, please verify.", //UnifiedApiResultFilter - "UnifiedAPI_ProgramError": "Program error, please contact developer." + "UnifiedAPI_ProgramError": "Program error, please contact developer.", + + // ------------------------------------------------------------Helper-------------------------------------------------------------------- + //FileStoreHelper + "FileStore_TemplateFileNotFound": "Database did not find the corresponding data template file for FileStoreHelper, please contact system maintenance personnel.", + "FileStore_TemplateFileStoragePathInvalid": "No corresponding file was found on the storage path for the data template file of FileStoreHelper, please contact system maintenance personnel.", + //SendEmailHelper + "SendEmail_SendFail": "Failed to send email in SendEmailHelper. Your operation was unsuccessful, please check your email or contact maintenance personnel.", + "SendEmail_NoRecipient": "No recipient in SendEmailHelper." } diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index d356e2ea8..52a7e105e 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -507,7 +507,7 @@ //SubjectVisitFinalVisitTrigger "SubjectVisit_CannotSetAsLastVisit": "该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。", - // ------------------------------------------------------------Helper-------------------------------------------------------------------- + // ------------------------------------------------------------BusinessFilter-------------------------------------------------------------------- //LimitUserRequestAuthorization "LimitUser_AuthTokenMissing": "当前请求未从Header/Url取到用户Token,请联系开发者", "LimitUser_AccountLoggedInElsewhere": "您的账户在其他地方已登陆,您被迫下线。", @@ -522,6 +522,14 @@ "TrialResource_InterceptedProjectStatusRule": "本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改", "TrialResource_MissingProjectNumber": "该接口参数中,没有传递项目编号,请核对。", //UnifiedApiResultFilter - "UnifiedAPI_ProgramError": "程序错误,请联系开发人员。" + "UnifiedAPI_ProgramError": "程序错误,请联系开发人员。", + + // ------------------------------------------------------------Helper-------------------------------------------------------------------- + //FileStoreHelper + "FileStore_TemplateFileNotFound": "数据库没有找到对应的数据模板文件,请联系系统运维人员。", + "FileStore_TemplateFileStoragePathInvalid": "数据模板文件存储路径上未找对应文件,请联系系统运维人员。", + //SendEmailHelper + "SendEmail_SendFail": "邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员", + "SendEmail_NoRecipient": "没有收件人" } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 4650b7434..dcf4d7a74 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -44,7 +44,8 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task> GetTrialList(TrialQueryDTO searchParam) { - var multiModalityIdSelectCount = searchParam.ModalityIds.Count; + + var multiModalityIdSelectCount = searchParam.ModalityIds.Count; var multiCriteriaSelectCount = searchParam.CriterionIds.Count; var multiReviewTypeSelectCount = searchParam.ReviewTypeIds.Count; diff --git a/IRaCIS.Core.Domain/_Config/_StaticData.cs b/IRaCIS.Core.Domain/_Config/_StaticData.cs index c77d20da2..daf810d2b 100644 --- a/IRaCIS.Core.Domain/_Config/_StaticData.cs +++ b/IRaCIS.Core.Domain/_Config/_StaticData.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Threading; namespace IRaCIS.Core.Domain.Share; @@ -16,11 +17,52 @@ public static class StaticData public static readonly string Zh_CN_Json = "zh-CN.json"; - + /// + /// 获取国际化 + /// + /// + /// + public static string International(string key, params object?[] args) + { + try + { + return string.Format(GetLanguageDictionary(key), args); + } + catch (Exception) + { + + return string.Empty; + } + } - #region 字典表项固定值 - public static readonly string Title = "Title"; + public static string GetLanguageDictionary(string key) + { + try + { + var type = Thread.CurrentThread.CurrentUICulture.Name; + if (type == "zh-CN") + { + return Zh_CN_Dic[key]; + + } + else + { + return En_US_Dic[key]; + + } + } + catch (Exception) + { + + return string.Empty; + } + + } + + + #region 字典表项固定值 + public static readonly string Title = "Title"; public static readonly string ReadingType = "ReadingType"; public static readonly string Subspeciality = "Subspeciality"; diff --git a/后端提示语.xlsx b/后端提示语.xlsx index b6c5e9b61..bdba57b20 100644 Binary files a/后端提示语.xlsx and b/后端提示语.xlsx differ