diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 24df3381c..8e25dd90c 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -52,6 +52,7 @@ SerilogExtension.AddSerilogSetup(enviromentName); var builder = WebApplication.CreateBuilder(new WebApplicationOptions { + EnvironmentName = enviromentName }); diff --git a/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs index 8237bc264..28960a9bf 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs @@ -63,7 +63,7 @@ namespace IRaCIS.Core.Application.Contracts public bool? IsDistinguishCriteria { get; set; } public SysEmailLevel? SystemLevel { get; set; } - public int? BusinessModuleEnum { get; set; } + public BusinessModule? BusinessModuleEnum { get; set; } public int? EmailUrgentEnum { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs index 9d928c2e7..49eda1a85 100644 --- a/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs @@ -26,6 +26,7 @@ namespace IRaCIS.Core.Application.Contracts .WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel) .WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria) .WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum) + .WhereIf(inQuery.BusinessModuleEnum != null, t => t.BusinessModuleEnum == inQuery.BusinessModuleEnum) .WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum) .WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired) .WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 547cbdfd4..68041bb70 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -1607,10 +1607,11 @@ namespace IRaCIS.Core.Application.Service.Common var criterion = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId).Select(t => new { t.CriterionType, t.CriterionName, t.ArbitrationRule }).FirstNotNullAsync(); - var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) + var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.TaskAllocationState==TaskAllocationState.Allocated && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)) - //自身一致性分析 + //一致性分析 .WhereIf(inQuery.ReadingExportType == ExportResult.DetailedTableOfIntraReaderAnalysisResults, t => t.IsSelfAnalysis == true || t.IsSelfAnalysis == null) + .WhereIf(inQuery.ReadingExportType == ExportResult.DetailedTableOfIntraReaderAnalysisResults, t => t.IsSelfAnalysis == null? t.Subject.SubjectVisitTaskList.Any(u=>u.IsSelfAnalysis==true &&u.DoctorUserId==t.DoctorUserId ):true) .WhereIf(inQuery.ReadingExportType == ExportResult.DetailedTableOfInterReaderAnalysisResults, t => t.IsSelfAnalysis == false || t.IsSelfAnalysis == null) //访视和全局查询已签名完成的,裁判可以是未签名,未完成的 diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs index c9cc23858..46d3f83f7 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs @@ -116,6 +116,8 @@ namespace IRaCIS.Core.Application.ViewModel public UserTypeEnum? ToUserType { get; set; } public UserTypeEnum? CopyUserType { get; set; } + + public BusinessModule? BusinessModuleEnum { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs index 9ca955b2b..fdec22a27 100644 --- a/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs @@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Interfaces { - Task> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery); + Task>> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery); Task AddOrUpdateTrialEmailNoticeConfig(TrialEmailNoticeConfigAddOrEdit addOrEditTrialEmailNoticeConfig); diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index af613f34f..61440b5bd 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -1243,7 +1243,7 @@ namespace IRaCIS.Core.Application.Service public async Task> GetSysEmailNoticeConfigList(EmailNoticeConfigQuery inQuery) { var emailNoticeConfigQueryable = _emailNoticeConfigRepository - .WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys ) + .WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys) .WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum) .WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired) .WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) @@ -1320,11 +1320,33 @@ namespace IRaCIS.Core.Application.Service } + public async Task BatchAddEnrollOrPdEmailConfig(Guid trialId) + { + var trialConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.IsEnrollementQualificationConfirm, t.IsPDProgressView }).First(); + + var trialEmailNoticeConfigQueryable = _trialEmailNoticeConfigRepository.Where(t => t.TrialId == trialId) + + .WhereIf(trialConfig.IsEnrollementQualificationConfirm == true, t => t.BusinessModuleEnum == BusinessModule.EligibilityVerification) + .WhereIf(trialConfig.IsPDProgressView == true, t => t.BusinessModuleEnum == BusinessModule.PDVerification) + .WhereIf(trialConfig.IsPDProgressView == true && trialConfig.IsEnrollementQualificationConfirm == true, t => t.BusinessModuleEnum == BusinessModule.PDVerification + && t.BusinessModuleEnum == BusinessModule.EligibilityVerification) + .ProjectTo(_mapper.ConfigurationProvider); + + + var list = await trialEmailNoticeConfigQueryable.ToListAsync(); + + + return await BatchAddSysEmailConfig(_mapper.Map>(list)); + + } + [HttpPost] - public async Task> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery) + public async Task>> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery) { //await SyncSystemEmainCofigDocListAsync(inQuery.TrialId); + var trialConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.IsEnrollementQualificationConfirm, t.IsPDProgressView }).First(); + var trialEmailNoticeConfigQueryable = _trialEmailNoticeConfigRepository.Where(t => t.TrialId == inQuery.TrialId) .WhereIf(inQuery.IsDistinguishCriteria == false, t => t.TrialReadingCriterionId == null) .WhereIf(inQuery.IsDistinguishCriteria == true, t => t.CriterionTypeEnum != null) @@ -1334,15 +1356,23 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) .WhereIf(inQuery.ToUserType != null, t => t.TrialEmailNoticeUserList.Any(t => t.UserType == inQuery.ToUserType && t.EmailUserType == EmailUserType.To)) .WhereIf(inQuery.CopyUserType != null, t => t.TrialEmailNoticeUserList.Any(t => t.UserType == inQuery.CopyUserType && t.EmailUserType == EmailUserType.Copy)) + + .WhereIf(inQuery.BusinessModuleEnum != null, t => t.BusinessModuleEnum == inQuery.BusinessModuleEnum) + .WhereIf(trialConfig.IsEnrollementQualificationConfirm == false, t => t.BusinessModuleEnum != BusinessModule.EligibilityVerification) + .WhereIf(trialConfig.IsPDProgressView == false, t => t.BusinessModuleEnum != BusinessModule.PDVerification) + .WhereIf(trialConfig.IsPDProgressView == false && trialConfig.IsEnrollementQualificationConfirm == false, t => t.BusinessModuleEnum != BusinessModule.PDVerification + && t.BusinessModuleEnum != BusinessModule.EligibilityVerification) .ProjectTo(_mapper.ConfigurationProvider); var sortField = string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TrialEmailNoticeConfigView.Code) : inQuery.SortField; var orderQuery = inQuery.Asc ? trialEmailNoticeConfigQueryable.OrderBy(sortField) : trialEmailNoticeConfigQueryable.OrderBy(sortField + " desc"); - return await orderQuery.ToListAsync(); + var list = await orderQuery.ToListAsync(); + + return ResponseOutput.Ok(list, trialConfig); } - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] public async Task AddOrUpdateTrialEmailNoticeConfig(TrialEmailNoticeConfigAddOrEdit addOrEditTrialEmailNoticeConfig) { await TestEmailConfigAsync(addOrEditTrialEmailNoticeConfig); @@ -1529,7 +1559,7 @@ namespace IRaCIS.Core.Application.Service } - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] [HttpDelete("{trialEmailNoticeConfigId:guid}")] public async Task DeleteTrialEmailNoticeConfig(Guid trialEmailNoticeConfigId) { diff --git a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs index af525da59..2311b6420 100644 --- a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs @@ -53,7 +53,7 @@ namespace IRaCIS.Core.Application.Service CreateMap(); - + CreateMap (); CreateMap() diff --git a/IRaCIS.Core.Application/Service/MinimalApiService/OAuthService.cs b/IRaCIS.Core.Application/Service/MinimalApiService/OAuthService.cs index 64474a760..21700e1d7 100644 --- a/IRaCIS.Core.Application/Service/MinimalApiService/OAuthService.cs +++ b/IRaCIS.Core.Application/Service/MinimalApiService/OAuthService.cs @@ -2,8 +2,10 @@ using IdentityModel; using IdentityModel.Client; using IRaCIS.Core.Application.Service.OAuth; +using MassTransit; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NPOI.SS.Formula.Functions; @@ -208,12 +210,16 @@ namespace IRaCIS.Core.Application.Service Console.WriteLine(tokenResponse); //结束回话 + var parameters = new Parameters(); - var endUrl = new RequestUrl(disco.EndSessionEndpoint).CreateEndSessionUrl(tokenResponse.IdToken, "http://localhost:6100/OAuth/TestPCKEOrgin"); + parameters.Add("clientId", "aj34vqrpvz8olsbxwtcog"); + var endUrl = new RequestUrl(disco.EndSessionEndpoint).CreateEndSessionUrl(tokenResponse.IdToken, "http://localhost:6100/OAuth/TestPCKEOrgin", extra: parameters); - var _endHttpClient = new HttpClient(); + + Results.Redirect(endUrl); + //var _endHttpClient = new HttpClient(); - var dd = await _endHttpClient.GetAsync(endUrl); + //var dd = await _endHttpClient.GetAsync(endUrl); } else diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 343715d62..db167c0c4 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -162,6 +162,12 @@ namespace IRaCIS.Core.Application.Contracts var info=await _doctorRepository.AddAsync(doctor,true); + //await _userRepository.BatchUpdateNoTrackingAsync(x => x.EMail == inDto.EmailOrPhone, x => new User() + //{ + // DoctorId = info.DoctorId, + + //}); + result.DoctorId = info.Id; result.ReviewStatus = info.ReviewStatus; } diff --git a/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs b/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs index 8b8235438..eb7bbe6e4 100644 --- a/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs +++ b/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs @@ -26,7 +26,7 @@ public class EmailNoticeConfig : BaseFullDeleteAuditEntity public int BusinessLevelEnum { get; set; } [Comment("业务模块")] - public int BusinessModuleEnum { get; set; } + public BusinessModule BusinessModuleEnum { get; set; } [Comment("业务场景")] public EmailBusinessScenario BusinessScenarioEnum { get; set; } @@ -83,3 +83,55 @@ public class EmailNoticeUserType : Entity public EmailUserType EmailUserType { get; set; } } +public enum BusinessModule +{ + /// + /// 影像质控 + /// + ImageQualityControl = 1, + /// + /// 影像阅片 + /// + ImageReading = 2, + /// + /// 系统登录 + /// + Login = 4, + /// + /// 后台邮件 + /// + BackstageEmail = 5, + /// + /// 账号信息 + /// + UserAccount = 6, + /// + /// 中心调研 + /// + SiteSurvey = 7, + /// + /// 阅片人管理 + /// + ReviewerManagement = 8, + /// + /// 问题反馈 + /// + UsersSuggestions = 9, + /// + /// 入组确认 + /// + EligibilityVerification = 10, + /// + /// PD确认 + /// + PDVerification = 11, + /// + /// 医学反馈 + /// + MedicalQC = 13, + /// + /// 入组/PD确认 + /// + Eligibility_PDVerification = 12, +} + diff --git a/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs b/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs index 7831bbaca..01a80a558 100644 --- a/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs +++ b/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs @@ -36,7 +36,7 @@ public class TrialEmailNoticeConfig : BaseFullDeleteAuditEntity public int BusinessLevelEnum { get; set; } - public int BusinessModuleEnum { get; set; } + public BusinessModule BusinessModuleEnum { get; set; } public EmailBusinessScenario BusinessScenarioEnum { get; set; }