diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index a797fec..2190595 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -18,7 +18,7 @@ - 获取医生详情 + @@ -30,7 +30,15 @@ - 系统用户登录接口[New] + + + + + + + + + 添加实验项目-返回新增Id[AUTH] diff --git a/IRaCIS.Core.API/Program.cs b/IRaCIS.Core.API/Program.cs index 2255af3..a6b6c61 100644 --- a/IRaCIS.Core.API/Program.cs +++ b/IRaCIS.Core.API/Program.cs @@ -19,13 +19,14 @@ using System.Text.Json.Nodes; using Microsoft.EntityFrameworkCore; using IRaCIS.Core.Infra.EFCore; using Microsoft.Data.SqlClient; +using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.API { public class Program { public readonly string environment; - public static async Task Main(string[] args) + public static async Task Main(string[] args) { @@ -51,6 +52,8 @@ namespace IRaCIS.Core.API //Dicom //ImageManager.SetImplementation(WinFormsImageManager.Instance); + StaticData.CurrentEnvName = enviromentName; + var host = CreateHostBuilder(args) .UseEnvironment(enviromentName) //д뻷 .ConfigureAppConfiguration((hostContext, config) => @@ -64,6 +67,7 @@ namespace IRaCIS.Core.API + NewId.SetProcessIdProvider(new CurrentProcessIdProvider()); diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 2f6cece..db59113 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -96,8 +96,14 @@ namespace IRaCIS.Core.API services.AddOptions().Configure( _configuration.GetSection("SystemEmailSendConfig")); services.AddOptions().Configure(_configuration.GetSection("BasicSystemConfig")); + StaticData.SystemBasicConfig = new ServiceVerifyConfigOption(); + // ͬʱ󶨵̬󣬷ȫַ + _configuration.GetSection("BasicSystemConfig") + .Bind(StaticData.SystemBasicConfig); + Console.WriteLine(StaticData.SystemBasicConfig); + //̬WebApi + UnifiedApiResultFilter ʡ services.AddDynamicWebApiSetup(); //AutoMapper diff --git a/IRaCIS.Core.API/appsettings.LiLi_DICOM_Viewer.json b/IRaCIS.Core.API/appsettings.LiLi_DICOM_Viewer.json index e348de6..87f003a 100644 --- a/IRaCIS.Core.API/appsettings.LiLi_DICOM_Viewer.json +++ b/IRaCIS.Core.API/appsettings.LiLi_DICOM_Viewer.json @@ -7,25 +7,25 @@ } }, "ConnectionStrings": { - "RemoteNew": "Server=192.168.3.68,1434;Database=Test_510K;User ID=sa;Password=xc@123456;TrustServerCertificate=true" + "RemoteNew": "Server=192.168.3.68,1434;Database=LiLi_DB;User ID=Lili_User;Password=Eleveta@2025;TrustServerCertificate=true" }, "BasicSystemConfig": { "OpenUserComplexPassword": true, - "OpenSignDocumentBeforeWork": false, + "OpenLoginLimit": true, - "OpenTrialRelationDelete": true, + "OpenCustomStoragePathConfig": false, - "OpenLoginLimit": true + "FileStoragePath": "" }, "SystemEmailSendConfig": { - "Port": 465, - "Host": "smtp.qiye.aliyun.com", - "FromEmail": "test@extimaging.com", + "Port": 587, + "Host": "smtp-mail.outlook.com", + "FromEmail": "donotreply@elevateimaging.ai", "FromName": "LiLi DICOM Viewer", - "AuthorizationCode": "SHzyyl2021" + "AuthorizationCode": "Q#669869497420ul" } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs index 19ced47..817c08c 100644 --- a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs @@ -12,7 +12,7 @@ public static class FileStoreHelper //处理文件名 压缩包,或者目录类的 会带上相对路径 - public static (string TrustedFileNameForFileStorage, string RealName) GetStoreFileName(string fileName,bool isChangeToPdfFormat=false) + public static (string TrustedFileNameForFileStorage, string RealName) GetStoreFileName(string fileName, bool isChangeToPdfFormat = false) { //带目录层级,需要后端处理前端的路径 @@ -37,14 +37,14 @@ public static class FileStoreHelper var trustedFileNameForFileStorage = string.Empty; - if (isChangeToPdfFormat==false) + if (isChangeToPdfFormat == false) { - trustedFileNameForFileStorage= Guid.NewGuid().ToString() + fileName; + trustedFileNameForFileStorage = Guid.NewGuid().ToString() + fileName; } else { - trustedFileNameForFileStorage=Guid.NewGuid().ToString() + Path.GetFileNameWithoutExtension(fileName) + ".pdf"; + trustedFileNameForFileStorage = Guid.NewGuid().ToString() + Path.GetFileNameWithoutExtension(fileName) + ".pdf"; } return (trustedFileNameForFileStorage, fileName); @@ -53,8 +53,23 @@ public static class FileStoreHelper //API vue 部署目录 public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment) { - var rootPath = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName; - return rootPath; + if (StaticData.SystemBasicConfig.OpenCustomStoragePathConfig) + { + var rootPath = StaticData.SystemBasicConfig.FileStoragePath; + + if (!Directory.Exists(rootPath)) + { + throw new BusinessValidationFailedException($"{rootPath} not exist"); + } + + return rootPath; + } + else + { + var rootPath = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName; + return rootPath; + } + } @@ -119,7 +134,7 @@ public static class FileStoreHelper { var trialClinicalData = await _clinicalDataTrialSetRepository.FirstOrDefaultAsync(t => t.Id == id); - if (trialClinicalData == null|| trialClinicalData.Path==string.Empty) + if (trialClinicalData == null || trialClinicalData.Path == string.Empty) { throw new BusinessValidationFailedException("数据库没有找到对应的数据模板文件,请联系系统运维人员。"); } @@ -212,7 +227,7 @@ public static class FileStoreHelper var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName); - var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.SystemDataFolder}/{ StaticData.Folder.SignDocumentFolder}/{trustedFileNameForFileStorage}"; + var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.SystemDataFolder}/{StaticData.Folder.SignDocumentFolder}/{trustedFileNameForFileStorage}"; var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage); @@ -263,7 +278,7 @@ public static class FileStoreHelper } // 获取一致性核查路径 - public static (string PhysicalPath, string RelativePath) GetTrialCheckFilePath(IWebHostEnvironment _hostEnvironment, string fileName,Guid trialId) + public static (string PhysicalPath, string RelativePath) GetTrialCheckFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -285,9 +300,9 @@ public static class FileStoreHelper } - public static (string PhysicalPath, string RelativePath, string FileRealName) GetClinicalTemplatePath(IWebHostEnvironment _hostEnvironment, string fileName,Guid trialId) + public static (string PhysicalPath, string RelativePath, string FileRealName) GetClinicalTemplatePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId) { - + var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, "ClinicalTemplate", trialId.ToString(), StaticData.Folder.TreatmenthistoryFolder); @@ -306,7 +321,7 @@ public static class FileStoreHelper } - public static (string PhysicalPath, string RelativePath, string FileRealName) GetReadClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId, Guid readingId) + public static (string PhysicalPath, string RelativePath, string FileRealName) GetReadClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId, Guid readingId) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -326,11 +341,11 @@ public static class FileStoreHelper } //获取临床数据存放路径 - public static (string PhysicalPath, string RelativePath,string FileRealName) GetClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName,Guid trialId,Guid siteId,Guid subjectId,Guid subjectVisitId) + public static (string PhysicalPath, string RelativePath, string FileRealName) GetClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId, Guid subjectVisitId) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); - string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(),siteId.ToString(), subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.TreatmenthistoryFolder); + string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), siteId.ToString(), subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.TreatmenthistoryFolder); if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath); @@ -346,11 +361,11 @@ public static class FileStoreHelper } - public static (string PhysicalPath, string RelativePath, string FileRealName) GetClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId , Guid subjectId) + public static (string PhysicalPath, string RelativePath, string FileRealName) GetClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid subjectId) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); - string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), subjectId.ToString(), StaticData.Folder.TreatmenthistoryFolder); + string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), subjectId.ToString(), StaticData.Folder.TreatmenthistoryFolder); if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath); @@ -404,7 +419,7 @@ public static class FileStoreHelper /// /// /// - public static (string PhysicalPath, string RelativePath, string FileRealName) GetFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid id,string type) + public static (string PhysicalPath, string RelativePath, string FileRealName) GetFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid id, string type) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -461,7 +476,7 @@ public static class FileStoreHelper // 获取 入组确认 PD 进展发送邮件Word|PDF 存放路径 - public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId,bool isChangeToPdfFormat=false) + public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteId, Guid subjectId, bool isChangeToPdfFormat = false) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -480,7 +495,7 @@ public static class FileStoreHelper } - public static string GetSubjectVisitDicomFolderPhysicalPath(IWebHostEnvironment _hostEnvironment,Guid trialId, Guid siteId, Guid subjectId, Guid subjectVisitId) + public static string GetSubjectVisitDicomFolderPhysicalPath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid siteId, Guid subjectId, Guid subjectVisitId) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -500,7 +515,7 @@ public static class FileStoreHelper Directory.CreateDirectory(path); } - var physicalPath = Path.Combine(path, instanceId.ToString() ); + var physicalPath = Path.Combine(path, instanceId.ToString()); var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{siteId}/{subjectId}/{subjectVisitId}/{StaticData.Folder.DicomFolder}/{studyId}/{instanceId}"; @@ -512,11 +527,11 @@ public static class FileStoreHelper } - + // 获取医生通用文件存放路径 - public static (string PhysicalPath, string RelativePath) GetDoctorOrdinaryFilePath(IWebHostEnvironment _hostEnvironment, string fileName,Guid doctorId,string attachmentType) + public static (string PhysicalPath, string RelativePath) GetDoctorOrdinaryFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid doctorId, string attachmentType) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -537,7 +552,7 @@ public static class FileStoreHelper return (serverFilePath, relativePath); } - public static (string PhysicalPath, string RelativePath) GetNonDoctorFilePath(IWebHostEnvironment _hostEnvironment, string fileName, string attachmentType) + public static (string PhysicalPath, string RelativePath) GetNonDoctorFilePath(IWebHostEnvironment _hostEnvironment, string fileName, string attachmentType) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -558,7 +573,7 @@ public static class FileStoreHelper return (serverFilePath, relativePath); } - + } diff --git a/IRaCIS.Core.Domain/_Config/_AppSettings.cs b/IRaCIS.Core.Domain/_Config/_AppSettings.cs index 8811dca..35c0d30 100644 --- a/IRaCIS.Core.Domain/_Config/_AppSettings.cs +++ b/IRaCIS.Core.Domain/_Config/_AppSettings.cs @@ -8,7 +8,7 @@ namespace IRaCIS.Core.Domain.Share public static class Jurisdiction { - public static List MenuActionList { get; set; }=new List (); + public static List MenuActionList { get; set; } = new List(); public static bool IsSearch { get; set; } = false; } @@ -32,20 +32,24 @@ namespace IRaCIS.Core.Domain.Share public bool OpenTrialRelationDelete { get; set; } public bool OpenLoginLimit { get; set; } + + public bool OpenCustomStoragePathConfig { get; set; } + + public string FileStoragePath { get; set; } = ""; } public class SystemEmailSendConfig { - public int Port { get; set; } + public int Port { get; set; } - public string Host { get; set; } + public string Host { get; set; } public string FromEmail { get; set; } public string FromName { get; set; } - public string AuthorizationCode { get; set; } + public string AuthorizationCode { get; set; } } @@ -72,13 +76,15 @@ namespace IRaCIS.Core.Domain.Share public static string SystemSiteCodePrefix { get; set; } - public static string BlindTaskPrefix { get; set; } + public static string BlindTaskPrefix { get; set; } /// /// 用户默认密码 /// public static readonly string DefaultPassword = "123456"; + + static AppSettings() { @@ -87,7 +93,7 @@ namespace IRaCIS.Core.Domain.Share { Path = "appsettings.json", ReloadOnChange = true - }) + }) .Build(); DoctorCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("DoctorCodePrefix"); @@ -95,7 +101,7 @@ namespace IRaCIS.Core.Domain.Share QCChallengeCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("QCChallengeCodePrefix"); NoneDicomStudyCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("NoneDicomStudyCodePrefix"); DicomStudyCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("DicomStudyCodePrefix"); - DefaultPassword= configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultPassword"); + DefaultPassword = configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultPassword"); SystemSiteCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("SystemSiteCodePrefix"); DefaultInternalOrganizationName = configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultInternalOrganizationName"); @@ -108,7 +114,7 @@ namespace IRaCIS.Core.Domain.Share //获取实体编码字符串 - public static string GetCodeStr(int codeInt ,string typeStr) + public static string GetCodeStr(int codeInt, string typeStr) { switch (typeStr) { @@ -122,7 +128,7 @@ namespace IRaCIS.Core.Domain.Share case nameof(QCChallenge): - return QCChallengeCodePrefix+ codeInt.ToString("D5"); + return QCChallengeCodePrefix + codeInt.ToString("D5"); case nameof(NoneDicomStudy): @@ -147,5 +153,5 @@ namespace IRaCIS.Core.Domain.Share } - + } \ No newline at end of file diff --git a/IRaCIS.Core.Domain/_Config/_StaticData.cs b/IRaCIS.Core.Domain/_Config/_StaticData.cs index dd36860..cdb36f0 100644 --- a/IRaCIS.Core.Domain/_Config/_StaticData.cs +++ b/IRaCIS.Core.Domain/_Config/_StaticData.cs @@ -3,7 +3,9 @@ public static class StaticData { + public static string CurrentEnvName { get; set; } + public static ServiceVerifyConfigOption SystemBasicConfig { get; set; } #region 字典表项固定值 public static readonly string Title = "Title";