From b0d7be5b663a18defcd18221779beee762fce256 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Wed, 22 Jun 2022 13:36:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 27 ++++++++++++++++- .../Allocation/DTO/VisitTaskViewModel.cs | 28 ++++++++++++++++++ .../Service/Allocation/VisitTaskService.cs | 29 +++++++++++-------- 3 files changed, 71 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index f31512e09..e86a619b6 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -94,7 +94,7 @@ - IR 待阅片任务列表(Subject 维度统计) + IR 待阅片任务列表 @@ -1958,6 +1958,31 @@ VisitTaskView 列表视图模型 + + + 未完成阅片量 + + + + + 完成阅片量 + + + + + 未完成裁判任务数量 + + + + + 完成裁判任务数量 + + + + + 建议完成时间 + + CommonDocumentView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 95aa912fe..a4848155b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -202,6 +202,34 @@ namespace IRaCIS.Core.Application.ViewModel } + public class IRUnReadOutDto + { + /// + /// 未完成阅片量 + /// + public int UnReadTaskCount { get; set; } + + /// + /// 完成阅片量 + /// + public int FinishTaskCount { get; set; } + + /// + /// 未完成裁判任务数量 + /// + public int UnReadJudgeTaskCount { get; set; } + + /// + /// 完成裁判任务数量 + /// + public int FinishJudgeTaskCount { get; set; } + + /// + /// 建议完成时间 + /// + public DateTime? SuggesteFinishedTime { get; set; } + } + public class SubjectAssignQuery : PageInput { [NotDefault] diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index aedc86a0f..b4a61cf8b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -232,24 +232,29 @@ namespace IRaCIS.Core.Application.Service var result= await subjectQuery.ToPagedListAsync(iRUnReadSubjectQuery.PageIndex, iRUnReadSubjectQuery.PageSize, String.IsNullOrEmpty(iRUnReadSubjectQuery.SortField) ? nameof(IRUnReadSubjectView.SubjectId) : iRUnReadSubjectQuery.SortField, iRUnReadSubjectQuery.Asc); return (result, new { - IsReadingTaskViewInOrder=isReadingTaskViewInOrder, + RandomReadInfo = new IRUnReadOutDto(), + IsReadingTaskViewInOrder =isReadingTaskViewInOrder, }); } else { - var taskQuery = _trialRepository.Where(x => x.Id == trialId ) - .Select(s => new IRUnReadSubjectView() - { - SubjectId = null, - SubjectCode = String.Empty, - UnReadTaskCount = s.VisitTaskList.Count(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.DoctorUserId == _userInfo.Id), - UnReadTaskList = s.VisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.DoctorUserId == _userInfo.Id).Select(u => new IRUnreadTaskView() { Id = u.Id, IsUrgent = u.IsUrgent, SuggesteFinishedTime = u.SuggesteFinishedTime }).ToList(), - }) - .Where(t => t.UnReadTaskCount > 0); - var result =await taskQuery.ToPagedListAsync(iRUnReadSubjectQuery.PageIndex, iRUnReadSubjectQuery.PageSize, String.IsNullOrEmpty(iRUnReadSubjectQuery.SortField) ? nameof(IRUnReadSubjectView.SubjectCode) : iRUnReadSubjectQuery.SortField, iRUnReadSubjectQuery.Asc); - return (result, new + + var taskQuery = _visitTaskRepository.Where(x => x.TrialId == iRUnReadSubjectQuery.TrialId&&x.DoctorUserId == _userInfo.Id); + + IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto() + { + + FinishJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(), + FinishTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).CountAsync(), + SuggesteFinishedTime = await taskQuery.Where(x => x.ReadingTaskState != ReadingTaskState.HaveSigned).MaxAsync(x => x.SuggesteFinishedTime), + UnReadJudgeTaskCount = await taskQuery.Where(x => x.ReadingCategory == ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(), + UnReadTaskCount = await taskQuery.Where(x => x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState != ReadingTaskState.HaveSigned).CountAsync(), + }; + + return (new PageOutput(), new { IsReadingTaskViewInOrder = isReadingTaskViewInOrder, + RandomReadInfo= iRUnReadOut, }); }