From 84049af89de0251c8bd5a1ca6fa7f05378f5ee3d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 28 Jun 2022 17:53:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=86=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/DTO/VisitTaskViewModel.cs | 5 ++--- .../Service/Allocation/VisitTaskHelpeService.cs | 14 +++++++++++--- .../Service/Allocation/VisitTaskService.cs | 14 +++++++------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 12c1a30ca..627fce43a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -233,8 +233,8 @@ namespace IRaCIS.Core.Application.ViewModel public class SelfConsistentView { - public Guid TrialId { get; set; } - public Guid SiteId { get; set; } + //public Guid TrialId { get; set; } + //public Guid SiteId { get; set; } public Guid SubjectId { get; set; } public String TrialSiteCode { get; set; } = String.Empty; @@ -259,7 +259,6 @@ namespace IRaCIS.Core.Application.ViewModel public ReadingCategory ReadingCategory { get; set; } - public TaskAllocationState TaskAllocationState { get; set; } public TaskState TaskState { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index e172923f5..dd13d0687 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -318,7 +318,7 @@ namespace IRaCIS.Core.Application.Service ArmEnum = reReadingVisitTask.ArmEnum, TaskName = reReadingVisitTask.TaskName, TaskBlindName = reReadingVisitTask.TaskBlindName, - TaskAllocationState = reReadingVisitTask.TaskAllocationState, + ReadingCategory = reReadingVisitTask.ReadingCategory, SourceSubjectVisitId = reReadingVisitTask.SourceSubjectVisitId, @@ -327,8 +327,8 @@ namespace IRaCIS.Core.Application.Service Code = currentMaxCodeInt + 1, TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), - - // AllocateTime = DateTime.Now, + // TaskAllocationState = reReadingVisitTask.TaskAllocationState, + // AllocateTime = DateTime.Now, //DoctorUserId = reReadingVisitTask.DoctorUserId, }); @@ -364,6 +364,8 @@ namespace IRaCIS.Core.Application.Service case ReadingCategory.Judge: var firstTask = await _visitTaskRepository.Where(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id)).FirstOrDefaultAsync(); + + VisitTask visitTask = new VisitTask() { ArmEnum = Arm.JudgeArm, @@ -377,6 +379,12 @@ namespace IRaCIS.Core.Application.Service SourceSubjectVisitId = firstTask.SourceSubjectVisitId, SouceReadModuleId = firstTask.SouceReadModuleId, TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), + + + TaskState = TaskState.Effect, + //DoctorUserId = doctorUserId, + TaskAllocationState = TaskAllocationState.Allocated, + AllocateTime = DateTime.Now, }; await _visitTaskRepository.AddAsync(visitTask); diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 00d6f04c5..4098de072 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -228,29 +228,30 @@ namespace IRaCIS.Core.Application.Service } + [HttpPost] public async Task> GetSelfConsistentList(SelfConsistentQuery inQuery) { - var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.DoctorUserId == inQuery.AnalysisDoctorUserId) + var query = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.DoctorUserId == inQuery.AnalysisDoctorUserId) .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect) .Where(t => t.SignTime!.Value.AddDays(inQuery.IntervalWeeks * 7 + 1) > DateTime.Now) //重阅产生的访视任务 要把之前的访视任务去除 .Where(t => t.ReReadingApplyState != ReReadingApplyState.Agree) .WhereIf(inQuery.IsHaveReadingPeriod == false, t => t.ReadingCategory == ReadingCategory.Visit) .WhereIf(inQuery.IsHaveReadingPeriod == true, t => t.ReadingCategory == ReadingCategory.Visit || t.ReadingCategory == ReadingCategory.Global) - .GroupBy(t => new { t.SubjectId, t.Subject.SiteId, t.Subject.Code, t.TrialId, t.Subject.TrialSite.TrialSiteCode }) + .GroupBy(t => new { t.SubjectId, /*t.TrialId, t.Subject.SiteId,*/ t.Subject.Code, t.Subject.TrialSite.TrialSiteCode }) .Select(g => new SelfConsistentView() { SubjectId = g.Key.SubjectId, - TrialId = g.Key.TrialId, + //TrialId = g.Key.TrialId, + //SiteId = g.Key.SiteId, + SubjectCode = g.Key.Code, TrialSiteCode = g.Key.TrialSiteCode, - SiteId = g.Key.SiteId, VisitTaskList = g.OrderBy(t => t.SubjectVisit.VisitNum).Select(c => new VisitTaskSimpleView() { Id = c.Id, ReadingCategory = c.ReadingCategory, - TaskAllocationState = c.TaskAllocationState, TaskBlindName = c.TaskBlindName, TaskCode = c.TaskCode, TaskName = c.TaskName, @@ -1060,9 +1061,8 @@ namespace IRaCIS.Core.Application.Service await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == item.NewReReadingTaskId, u => new VisitTask() { TaskState = TaskState.Effect, - DoctorUserId = doctorUserId, - + TaskAllocationState=TaskAllocationState.Allocated, AllocateTime = DateTime.Now, }); }