diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.csproj b/IRaCIS.Core.API/IRaCIS.Core.API.csproj index af73d1f8..df4feb12 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.csproj +++ b/IRaCIS.Core.API/IRaCIS.Core.API.csproj @@ -82,6 +82,8 @@ + + diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 7bf6254c..6be3082d 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -115,7 +115,8 @@ namespace IRaCIS.Core.API //services.AddDistributedMemoryCache(); // hangfire 定时任务框架 有界面,更友好~ - services.AddhangfireSetup(_configuration); + //services.AddhangfireSetup(_configuration); + // QuartZ 定时任务框架 使用了hangfire 暂时不用,后续需要可以打开,已经配好 services.AddQuartZSetup(_configuration); @@ -172,7 +173,6 @@ namespace IRaCIS.Core.API //响应压缩 app.UseResponseCompression(); - //app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); //不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication. app.UseStaticFiles(); @@ -181,14 +181,9 @@ namespace IRaCIS.Core.API //LogDashboard app.UseLogDashboard("/LogDashboard"); - //hangfire - app.UseHangfireConfig(env); + ////hangfire + //app.UseHangfireConfig(env); - ////暂时废弃 - //app.UseHttpReports(); - - ////限流 中间件 - //app.UseIpRateLimiting(); @@ -202,7 +197,6 @@ namespace IRaCIS.Core.API } Console.WriteLine("当前环境: " + env.EnvironmentName); - //app.UseMiddleware(); // 特殊异常处理 比如 404 app.UseStatusCodePagesWithReExecute("/Error/{0}"); @@ -220,17 +214,9 @@ namespace IRaCIS.Core.API app.UseIRacisHostStaticFileStore(env); - - app.UseAuthentication(); - //app.UseJwtBearerQueryString(); app.UseAuthorization(); - ////文件伺服 必须带Token 访问 - ////app.UseIRacisHostStaticFileStore(env); - - - app.UseEndpoints(endpoints => { diff --git a/IRaCIS.Core.API/_ServiceExtensions/QuartZSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/QuartZSetup.cs index bd48c49a..dec9e061 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/QuartZSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/QuartZSetup.cs @@ -1,6 +1,8 @@ 锘 +using IRaCIS.Application.Services.BackGroundJob; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Quartz; namespace IRaCIS.Core.API { @@ -8,37 +10,35 @@ namespace IRaCIS.Core.API { public static void AddQuartZSetup(this IServiceCollection services, IConfiguration configuration) { - //services.AddTransient(); + services.AddTransient(); - //services.AddQuartz(q => - //{ - // // base quartz scheduler, job and trigger configuration + services.AddQuartz(q => + { + // base quartz scheduler, job and trigger configuration - // // as of 3.3.2 this also injects scoped services (like EF DbContext) without problems - // q.UseMicrosoftDependencyInjectionJobFactory(); + // as of 3.3.2 this also injects scoped services (like EF DbContext) without problems + q.UseMicrosoftDependencyInjectionJobFactory(); - // // 鍩烘湰Quartz璋冨害鍣ㄣ佷綔涓氬拰瑙﹀彂鍣ㄩ厤缃 - // var jobKey = new JobKey("RegularTrialWork", "regularWorkGroup"); - // q.AddJob(jobKey, j => j - // .WithDescription("Trial regular work") - // ); - // q.AddTrigger(t => t - // .WithIdentity("TrialStatusTrigger") - // .ForJob(jobKey) - // //.StartNow() - // //.WithSimpleSchedule(x => x.WithInterval(TimeSpan.FromSeconds(15))//寮濮嬬鏁 15s - // // .RepeatForever())//鎸佺画宸ヤ綔 - // .WithCronSchedule("0 0 0/2 * * ?")//姣忓皬鏃舵墽琛屼竴娆 - // .WithDescription("My regular trial work trigger") - // ); - //}); + // 鍩烘湰Quartz璋冨害鍣ㄣ佷綔涓氬拰瑙﹀彂鍣ㄩ厤缃 + var jobKey = new JobKey("RegularTrialWork", "regularWorkGroup"); + q.AddJob(jobKey, j => j + .WithDescription("Trial regular work") + ); + q.AddTrigger(t => t + .WithIdentity("TrialStatusTrigger") + .ForJob(jobKey) + + .WithCronSchedule("0 0 * * * ?")//姣忓皬鏃舵墽琛屼竴娆 + .WithDescription("My regular trial work trigger") + ); + }); - //// ASP.NET Core hosting - //services.AddQuartzServer(options => - //{ - // // when shutting down we want jobs to complete gracefully - // options.WaitForJobsToComplete = true; - //}); + // ASP.NET Core hosting + services.AddQuartzHostedService(options => + { + // when shutting down we want jobs to complete gracefully + options.WaitForJobsToComplete = true; + }); } } diff --git a/IRaCIS.Core.API/appsettings.Staging.json b/IRaCIS.Core.API/appsettings.Staging.json deleted file mode 100644 index 79ee99b2..00000000 --- a/IRaCIS.Core.API/appsettings.Staging.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "ConnectionStrings": { - "RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_Verify;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true", - "Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Hangfire_IRaCIS;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true" - }, - "BasicSystemConfig": { - - "OpenUserComplexPassword": true, - - "OpenSignDocumentBeforeWork": true, - - "OpenLoginLimit": true - - }, - "SystemEmailSendConfig": { - "Port": 465, - "Host": "smtp.qiye.aliyun.com", - "FromEmail": "uat@extimaging.com", - "FromName": "UAT_IRC", - "AuthorizationCode": "SHzyyl2021" - } - - -} diff --git a/IRaCIS.Core.API/appsettings.USDemo.json b/IRaCIS.Core.API/appsettings.USDemo.json deleted file mode 100644 index 2f062f04..00000000 --- a/IRaCIS.Core.API/appsettings.USDemo.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "ConnectionStrings": { - "RemoteNew": "Server=47.90.161.85,1433\\MSSQLSERVER;Database=IRaCIS_Demo_US;User ID=sa;Password=zhanying2021;TrustServerCertificate=true", - "Hangfire": "Server=47.90.161.85,1433\\MSSQLSERVER;Database=Hangfire.IRaCIS_Demo_US;User ID=sa;Password=zhanying2021;TrustServerCertificate=true" - - }, - "BasicSystemConfig": { - - "OpenUserComplexPassword": false, - - "OpenSignDocumentBeforeWork": false, - - "OpenTrialRelationDelete": true, - - "OpenLoginLimit": false - }, - - "SystemEmailSendConfig": { - "Port": 465, - "Host": "smtp.qiye.aliyun.com", - "FromEmail": "test@extimaging.com", - "FromName": "Test_IRC", - "AuthorizationCode": "SHzyyl2021" - } - -} diff --git a/IRaCIS.Core.API/appsettings.json b/IRaCIS.Core.API/appsettings.json index c200d077..6f0ae839 100644 --- a/IRaCIS.Core.API/appsettings.json +++ b/IRaCIS.Core.API/appsettings.json @@ -1,7 +1,4 @@ { - "ConnectionStrings": { - "hang": "Server=ZHOU;Database=IRaCIS;User ID=sa;Password=sa123456;" - }, "JwtSetting": { "SecurityKey": "3e6dbfa227234a03977a2f421bdb7f4f", // 瀵嗛挜 "Issuer": "IRaCIS", // 棰佸彂鑰 @@ -73,6 +70,7 @@ "QCChallengeCodePrefix": "Q", "NoneDicomStudyCodePrefix": "NST", + "DicomStudyCodePrefix": "ST", diff --git a/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs b/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs index dcc0f40a..e3be2747 100644 --- a/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs @@ -7,6 +7,7 @@ using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Domain.Models; using Microsoft.Extensions.Logging; using Quartz; +using IRaCIS.Core.Domain.Share; namespace IRaCIS.Application.Services.BackGroundJob { @@ -17,36 +18,55 @@ namespace IRaCIS.Application.Services.BackGroundJob private readonly IRepository _trialRepository; private readonly IEasyCachingProvider _provider; private readonly ILogger _logger; + private readonly IRepository _systemAnonymizationRepository; - public CacheTrialStatusQuartZJob(IRepository trialRepository, IEasyCachingProvider provider,ILogger logger) + public CacheTrialStatusQuartZJob(IRepository trialRepository, IEasyCachingProvider provider,ILogger logger, IRepository systemAnonymizationRepository) { _trialRepository = trialRepository; _provider = provider; _logger = logger; + _systemAnonymizationRepository = systemAnonymizationRepository; } - public Task Execute(IJobExecutionContext context) + public async Task Execute(IJobExecutionContext context) { _logger.LogInformation($"寮濮嬫墽琛孮uartZ瀹氭椂浠诲姟浣滀笟"); try { - var list = _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr }) - .ToList(); + await MemoryCacheTrialStatus(); + + await MemoryCacheAnonymizeData(); - list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(1))); - } catch (Exception e) { _logger.LogError($" 鏌ヨ鍜岀紦瀛樿繃绋嬪嚭鐜板紓甯"+e.Message); } _logger.LogInformation("QuartZ瀹氭椂浠诲姟浣滀笟缁撴潫"); - return Task.CompletedTask; } - - + public async Task MemoryCacheTrialStatus() + { + var list = await _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr }) + .ToListAsync(); + + list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7))); + + } + + public async Task MemoryCacheAnonymizeData() + { + var systemAnonymizationList = await _systemAnonymizationRepository.Where(t => t.IsEnable).ToListAsync(); + + _provider.Set(StaticData.Anonymize.Anonymize_AddFixedFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed).ToList(), TimeSpan.FromDays(7)); + _provider.Set(StaticData.Anonymize.Anonymize_AddIRCInfoFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed == false).ToList(), TimeSpan.FromDays(7)); + _provider.Set(StaticData.Anonymize.Anonymize_FixedField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed).ToList(), TimeSpan.FromDays(7)); + _provider.Set(StaticData.Anonymize.Anonymize_IRCInfoField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed == false).ToList(), TimeSpan.FromDays(7)); + } + + + } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 1cd6372e..3223d5c1 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -123,26 +123,28 @@ namespace IRaCIS.Core.Application.Service foreach (var subjectVisit in subjectGroup.SubjectVisitList) { - var blindTaskName = string.Empty; + //var blindTaskName = string.Empty; + + var blindTaskName = subjectVisit.VisitName; var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList); var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId); - if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0) - { - blindTaskName = visitBlindConfig.BlindBaseLineName; - } - else - { - if (trialReadingCriterionConfig.IsReadingTaskViewInOrder) - { - blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum); - } - else - { - blindTaskName = visitBlindConfig.BlindFollowUpPrefix; - } - } + //if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0) + //{ + // blindTaskName = visitBlindConfig.BlindBaseLineName; + //} + //else + //{ + // if (trialReadingCriterionConfig.IsReadingTaskViewInOrder) + // { + // blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum); + // } + // else + // { + // blindTaskName = visitBlindConfig.BlindFollowUpPrefix; + // } + //} //姣忎釜璁胯 鏍规嵁椤圭洰閰嶇疆鐢熸垚浠诲姟 鍙屽鐢熸垚涓や釜 @@ -540,27 +542,27 @@ namespace IRaCIS.Core.Application.Service var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.OrignalSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync(); - var blindTaskName = string.Empty; + var blindTaskName = subjectVisit.VisitName; var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList); var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId); - if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0) - { - blindTaskName = visitBlindConfig.BlindBaseLineName; - } - else - { - if (trialReadingCriterionConfig.IsReadingTaskViewInOrder) - { - blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum); - } - else - { - blindTaskName = visitBlindConfig.BlindFollowUpPrefix; - } - } + //if (visitNumList.IndexOf(subjectVisit.VisitNum) == 0) + //{ + // blindTaskName = visitBlindConfig.BlindBaseLineName; + //} + //else + //{ + // if (trialReadingCriterionConfig.IsReadingTaskViewInOrder) + // { + // blindTaskName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(subjectVisit.VisitNum); + // } + // else + // { + // blindTaskName = visitBlindConfig.BlindFollowUpPrefix; + // } + //} //姣忎釜璁胯 鏍规嵁椤圭洰閰嶇疆鐢熸垚浠诲姟 鍙屽鐢熸垚涓や釜 diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs index 574b33bf..78f9d479 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs @@ -5,6 +5,7 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Infrastructure.Extention; +using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -25,7 +26,7 @@ namespace IRaCIS.Core.Application.Contracts public class UnionDocumentView : SystemDocumentAddOrEdit { - public string FullFilePath { get; set; } = string.Empty; + public string FullFilePath { get; set; } public DateTime CreateTime { get; set; } public DateTime UpdateTime { get; set; } diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index 2f40f256..2b00d708 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -151,7 +151,7 @@ namespace IRaCIS.Core.Application.Services FileType = sysDoc.FileType.MappedValue, UpdateTime = sysDoc.UpdateTime, - FullFilePath = sysDoc.Path + "?access_token=" + _userInfo.UserToken, + FullFilePath = sysDoc.Path , ConfirmUserId = confirm.ConfirmUserId, ConfirmTime = confirm.ConfirmTime, diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index e9ec665a..52f97b95 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -195,6 +195,9 @@ namespace IRaCIS.Application.Services trial.IsHaveFirstGiveMedicineDate = false; trial.TrialStatusStr = StaticData.TrialState.TrialOngoing; + + trial.BlindBaseLineName = "Batch 1"; + trial.BlindBaseLineName = "Batch "; #endregion