修改文档查询bug

Uat_Study
{872297557@qq.com} 2022-11-29 14:09:35 +08:00
parent 576fca6d11
commit 253b982a80
7 changed files with 13 additions and 14 deletions

View File

@ -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)));
}

View File

@ -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)));

View File

@ -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;
}

View File

@ -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)

View File

@ -134,7 +134,8 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList));
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>();
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>()
.ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c=>c.IsSign && (c.ReadingId==u.SouceReadModuleId ||c.ReadingId==u.SourceSubjectVisitId))));
CreateMap<VisitTask, AnalysisTaskView>().IncludeBase<VisitTask, VisitTaskView>()
.ForMember(o => o.IsReReadingOrBackInfluenceAnalysis, t => t.MapFrom(u => u.Subject.IsReReadingOrBackInfluenceAnalysis));

View File

@ -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<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();

View File

@ -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<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
return ResponseOutput.Ok();
}