diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index a7e0c5e45..73f85eb32 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -1,9 +1,6 @@ using System; using System.Net.Http; using EasyCaching.Core; -using gRPC.ZHiZHUN.AuthServer.protos; -using Grpc.Net.Client; -using Grpc.Net.Client.Configuration; using IRaCIS.Application.Interfaces; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Auth; diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.csproj b/IRaCIS.Core.API/IRaCIS.Core.API.csproj index 65b1434e0..4b04686c8 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.csproj +++ b/IRaCIS.Core.API/IRaCIS.Core.API.csproj @@ -72,16 +72,6 @@ - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - true - - diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index 659916ddf..430c4af5f 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -401,113 +401,5 @@ - - Holder for reflection information generated from Protos/GrpcToken.proto - - - File descriptor for Protos/GrpcToken.proto - - - - 新增用户时需要传递数据消息, 可理解为一个类 - - - - Field number for the "id" field. - - - Field number for the "userName" field. - - - Field number for the "realName" field. - - - Field number for the "reviewerCode" field. - - - Field number for the "userTypeEnumInt" field. - - - Field number for the "userTypeShortName" field. - - - Field number for the "isAdmin" field. - - - - 新增时返回的消息格式 - - - - Field number for the "code" field. - - - Field number for the "token" field. - - - - service 用标识定义服务的,里面写对应的方法 - - - - Service descriptor - - - Client for TokenGrpcService - - - Creates a new client for TokenGrpcService - The channel to use to make remote calls. - - - Creates a new client for TokenGrpcService that uses a custom CallInvoker. - The callInvoker to use to make remote calls. - - - Protected parameterless constructor to allow creation of test doubles. - - - Protected constructor to allow creation of configured clients. - The client configuration. - - - - 获取token - - The request to send to the server. - The initial metadata to send with the call. This parameter is optional. - An optional deadline for the call. The call will be cancelled if deadline is hit. - An optional token for canceling the call. - The response received from the server. - - - - 获取token - - The request to send to the server. - The options for the call. - The response received from the server. - - - - 获取token - - The request to send to the server. - The initial metadata to send with the call. This parameter is optional. - An optional deadline for the call. The call will be cancelled if deadline is hit. - An optional token for canceling the call. - The call object. - - - - 获取token - - The request to send to the server. - The options for the call. - The call object. - - - Creates a new instance of client from given ClientBaseConfiguration. - diff --git a/IRaCIS.Core.API/_PipelineExtensions/Hangfire/HangfireConfig.cs b/IRaCIS.Core.API/_PipelineExtensions/Hangfire/HangfireConfig.cs deleted file mode 100644 index 48423534d..000000000 --- a/IRaCIS.Core.API/_PipelineExtensions/Hangfire/HangfireConfig.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Hangfire; -using Hangfire.Dashboard; -using IRaCIS.Application.Services.BackGroundJob; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; - -namespace IRaCIS.Core.API -{ - - - public static class HangfireConfig - { - - public static void UseHangfireConfig(this IApplicationBuilder app, IWebHostEnvironment env) - { - app.UseHangfireDashboard("/api/hangfire", new DashboardOptions() - { - //直接访问,没有带token 获取不到用户身份信息,所以这种自定义授权暂时没法使用 - //Authorization = new[] { new hangfireAuthorizationFilter() } - - //本地请求 才能看 - Authorization = new[] { new LocalRequestsOnlyAuthorizationFilter() } - - }); - - #region hangfire - //// 延迟任务执行 1秒之后执行 有时启动没运行 换成添加到队列中 - //BackgroundJob.Schedule(t => t.MemoryCacheTrialStatus(), TimeSpan.FromSeconds(1)); - ////添加到后台任务队列, - //BackgroundJob.Enqueue(t => t.MemoryCacheTrialStatus()); - - //周期性任务,1天执行一次 - - RecurringJob.AddOrUpdate(t => t.ProjectStartCache(), Cron.Daily); - - #endregion - - } - } -} diff --git a/IRaCIS.Core.API/_PipelineExtensions/Hangfire/hangfireAuthorizationFilter.cs b/IRaCIS.Core.API/_PipelineExtensions/Hangfire/hangfireAuthorizationFilter.cs deleted file mode 100644 index 707b55234..000000000 --- a/IRaCIS.Core.API/_PipelineExtensions/Hangfire/hangfireAuthorizationFilter.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Hangfire.Dashboard; - -namespace IRaCIS.Core.API.Filter -{ - public class hangfireAuthorizationFilter : IDashboardAuthorizationFilter - { - public bool Authorize(DashboardContext context) - { - var httpContext = context.GetHttpContext(); - - // Allow all authenticated users to see the Dashboard (potentially dangerous). - return httpContext.User.Identity.IsAuthenticated; - - //return true; - } - } -} \ No newline at end of file diff --git a/IRaCIS.Core.API/_PipelineExtensions/Serilog/SerilogConfig.cs b/IRaCIS.Core.API/_PipelineExtensions/Serilog/SerilogConfig.cs index c5aab64f1..c5af7adbe 100644 --- a/IRaCIS.Core.API/_PipelineExtensions/Serilog/SerilogConfig.cs +++ b/IRaCIS.Core.API/_PipelineExtensions/Serilog/SerilogConfig.cs @@ -1,6 +1,4 @@ -using Hangfire; -using Hangfire.Dashboard; -using IRaCIS.Core.API._PipelineExtensions.Serilog; +using IRaCIS.Core.API._PipelineExtensions.Serilog; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Serilog; diff --git a/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs deleted file mode 100644 index a5dd1fc09..000000000 --- a/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Hangfire; -using Hangfire.SqlServer; -using Hangfire.Tags.SqlServer; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using System; - -namespace IRaCIS.Core.API -{ - public static class hangfireSetup - { - public static void AddhangfireSetup(this IServiceCollection services, IConfiguration configuration) - { - var hangFireConnStr = configuration.GetSection("ConnectionStrings:Hangfire").Value; - - services.AddHangfire(hangFireConfig => - { - //指定存储介质 - hangFireConfig.UseSqlServerStorage(hangFireConnStr, new SqlServerStorageOptions() - { - SchemaName = "hangfire", - CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), - SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5), - QueuePollInterval = TimeSpan.Zero, - UseRecommendedIsolationLevel = true, - UsePageLocksOnDequeue = true, - DisableGlobalLocks = true - }); - - hangFireConfig.UseTagsWithSql(); //nuget引入Hangfire.Tags.SqlServer - //.UseHangfireHttpJob(); - - }); - - services.AddHangfireServer(); - - } - } -} diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 4e4181763..cd21a404b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1432,18 +1432,6 @@ namespace IRaCIS.Core.Application.Service.Allocation Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze); - if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment) - { - //影像退回,必定影响两个标准的任务 - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); - - - } - else - { - //默认影响的都是该标准的任务 - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId); - } //PM 才允许操作 if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) @@ -1670,50 +1658,16 @@ namespace IRaCIS.Core.Application.Service.Allocation //IR 申请1.1 基线重阅,影响附加评估所有的任务 var isIR1Point1AdditionalAssessmentBaseline = false; - //附加评估 IR 和PM 看到的影响列表不一样 - if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment) - { - - // IR 申请 PM 同意 - if (((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId != null && await _visitTaskReReadingRepository.AnyAsync(t => t.Id == applyId && t.CreateUser.UserTypeEnum == UserTypeEnum.IndependentReviewer)) - || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null))) - { - - // 1.1 基线任务影响BM任务 - if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && _subjectVisitRepository.Any(t => t.Id == filterObj.SourceSubjectVisitId && t.IsBaseLine == true)) - { - - isIR1Point1AdditionalAssessmentBaseline = true; - //filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); - } - // 1.1 非基线任务不影响BM任务 - else - { - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); - } - - } - //(1、PM回退,PM申请重阅,SPM同意回退) - else - { - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB); - - } - } - else - { - //默认影响的都是该标准的任务 - filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); - } //重阅影响 if (isReReading) { - + //默认影响的都是该标准的任务 + filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId); //IR 申请 PM 同意 仅仅影响自己 @@ -1738,7 +1692,6 @@ namespace IRaCIS.Core.Application.Service.Allocation filterExpression = filterExpression.And(t => t.Id == filterObj.Id || t.Id == filterObj.JudgeVisitTaskId); } - //throw new BusinessValidationFailedException("仅允许PM 同意 IR 申请的任务"); } else @@ -1747,8 +1700,6 @@ namespace IRaCIS.Core.Application.Service.Allocation throw new BusinessValidationFailedException(_localizer["VisitTask_UndefinedList"]); } - - } @@ -1805,146 +1756,6 @@ namespace IRaCIS.Core.Application.Service.Allocation { influenceTask.OptType = influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned ? ReReadingOrBackOptType.Return : ReReadingOrBackOptType.Abandon; - - #region 变更前 注释 - - //if (isReReading) - //{ - - // if ((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId != null) || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null)) - // { - // //有序 - // if (criterionConfig.IsReadingTaskViewInOrder) - // { - // if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Return; - // } - // else - // { - // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // } - // //else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading) - // //{ - // // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // //} - // //else - // //{ - // // throw new BusinessValidationFailedException("IR 申请重阅,不会影响到后续未读的任务,当前影响列表有未读的任务,请核查"); - // //} - // } - // else - // { - // if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Return; - // } - // else - // { - // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // } - // } - // } - // if (((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM) && applyId != null) || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId == null)) - // { - // //有序 - // if (criterionConfig.IsReadingTaskViewInOrder) - // { - // //申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配 - // if (influenceTask.ReadingCategory == ReadingCategory.Visit && influenceTask.VisitTaskNum != filterObj.VisitTaskNum) - // { - // if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Return; - // } - // else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // } - // else - // { - // influenceTask.OptType = ReReadingOrBackOptType.CancelAssign; - // } - // } - // else - // { - // if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Return; - // } - // else - // { - // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // } - // } - // } - // else - // { - // if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Return; - // } - // else - // { - // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // } - // } - // } - - //} - ////PM退回 - //else - //{ - - - - // //有序 - // if (criterionConfig.IsReadingTaskViewInOrder) - // { - // //申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配 - // if (influenceTask.ReadingCategory == ReadingCategory.Visit && influenceTask.VisitTaskNum != filterObj.VisitTaskNum) - // { - // //后续访视处理访视 - // if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Return; - // } - // else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // } - // else - // { - // influenceTask.OptType = ReReadingOrBackOptType.CancelAssign; - // } - // } - // else - // { - // //申请的访视 全局肿瘤学 - - // if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // { - // influenceTask.OptType = ReReadingOrBackOptType.Return; - // } - // else - // { - // influenceTask.OptType = ReReadingOrBackOptType.Abandon; - // } - // } - // } - // //无序 - // else - // { - // //重阅重置或者失效 - // influenceTask.OptType = influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned ? ReReadingOrBackOptType.Return : ReReadingOrBackOptType.Abandon; - // } - - - //} - - - #endregion - } #endregion