From 253b982a804d540c11d4cf7cc0ed8d1405cf3a02 Mon Sep 17 00:00:00 2001 From: "{872297557@qq.com}" <872297557@qq.com> Date: Tue, 29 Nov 2022 14:09:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BackGroundJob/CacheTrialStatusHangfireJob.cs | 2 -- .../BackGroundJob/CacheTrialStatusQuartZJob.cs | 1 - .../Service/Allocation/DTO/VisitTaskViewModel.cs | 2 ++ .../Service/Allocation/VisitTaskHelpeService.cs | 3 +++ .../Service/Allocation/_MapConfig.cs | 3 ++- .../Service/Document/TrialDocumentService.cs | 4 ++-- .../Service/TrialSiteUser/TrialConfigService.cs | 12 ++++-------- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusHangfireJob.cs index a7d82b5b6..2eda2818a 100644 --- a/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusHangfireJob.cs @@ -1,5 +1,4 @@ using EasyCaching.Core; -using IRaCIS.Core.Infra.EFCore; using Microsoft.Extensions.Logging; namespace IRaCIS.Application.Services.BackGroundJob @@ -28,7 +27,6 @@ namespace IRaCIS.Application.Services.BackGroundJob { var list = _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr }) .ToList(); - //_provider.GetCount(""); list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7))); } diff --git a/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs b/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs index ab4c0ac7f..dcc0f40ac 100644 --- a/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/CacheTrialStatusQuartZJob.cs @@ -33,7 +33,6 @@ namespace IRaCIS.Application.Services.BackGroundJob { var list = _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr }) .ToList(); - //_provider.GetCount(""); list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(1))); diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 35a1a430b..abf867cf8 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -156,6 +156,8 @@ namespace IRaCIS.Core.Application.ViewModel public ReReadingApplyState ReReadingApplyState { get; set; } public DateTime? SuggesteFinishedTime { get; set; } + public bool IsClinicalDataSigned { get; set; } = false; + } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 5f31b1858..8cf8ff24d 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -380,8 +380,11 @@ namespace IRaCIS.Core.Application.Service #endregion } + //最近的未一致性核查通过的访视任务 var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync(); + //大于当前访视 同时小于最近的未一致性核查通过的访视任务分配 或者生成 + //存在退回访视1 又退回基线 这种情况 生成任务 考虑基线先一致性核查通过,但是访视1还未通过时 生成任务 var followVisitTaskList = await _visitTaskRepository .Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true) diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index fb87a66f0..440e77680 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -134,7 +134,8 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList)); - CreateMap().IncludeBase(); + CreateMap().IncludeBase() + .ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c=>c.IsSign && (c.ReadingId==u.SouceReadModuleId ||c.ReadingId==u.SourceSubjectVisitId)))); CreateMap().IncludeBase() .ForMember(o => o.IsReReadingOrBackInfluenceAnalysis, t => t.MapFrom(u => u.Subject.IsReReadingOrBackInfluenceAnalysis)); diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 76fd7ebd5..8351fdf96 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -204,12 +204,12 @@ namespace IRaCIS.Core.Application.Services var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) - .Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId)) + .Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime!=null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .CountAsync(); var needSignSystemDocCount = await _systemDocumentRepository - .Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId)) + .Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .CountAsync(); var trialTaskConfig = _trialRepository.Where(t => t.Id == querySystemDocument.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefault(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 07dcc5c1a..b647d0f37 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -811,10 +811,10 @@ namespace IRaCIS.Core.Application return ResponseOutput.NotOk("项目没有进入启动状态,不能设置为停止或完成状态"); } - if (trialStatusStr != StaticData.TrialState.TrialOngoing) - { - trial.TrialFinishTime = DateTime.Now; - } + //if (trialStatusStr != StaticData.TrialState.TrialOngoing) + //{ + // trial.TrialFinishTime = DateTime.Now; + //} trial.TrialStateChangeList.Add(new TrialStateChange() { OriginState = trial.TrialStatusStr, NowState = trialStatusStr, Reason = reason ?? String.Empty, TrialId = trialId }); @@ -837,10 +837,6 @@ namespace IRaCIS.Core.Application await _repository.SaveChangesAsync(); - - //var success = await _repository.BatchUpdateAsync(t => t.Id == signId, u => new TrialSign() { IsCompleted = true }); - - return ResponseOutput.Ok(); }