From 87b784964b7b34ce3a861216f69be60f247d6905 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 28 Jun 2022 18:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Allocation/VisitTaskHelpeService.cs | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index dd13d0687..e9511c71b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -364,29 +364,26 @@ namespace IRaCIS.Core.Application.Service case ReadingCategory.Judge: var firstTask = await _visitTaskRepository.Where(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id)).FirstOrDefaultAsync(); - + var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm).FirstOrDefaultAsync(); VisitTask visitTask = new VisitTask() - { - ArmEnum = Arm.JudgeArm, - Id = NewId.NextGuid(), - SubjectId = firstTask.SubjectId, - ReadingTaskState = ReadingTaskState.WaitReading, - TaskName = firstTask.TaskName, - ReadingCategory = ReadingCategory.Judge, - TrialId = firstTask.TrialId, - Code = currentMaxCodeInt + 1, - SourceSubjectVisitId = firstTask.SourceSubjectVisitId, - SouceReadModuleId = firstTask.SouceReadModuleId, - TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), - - - TaskState = TaskState.Effect, - //DoctorUserId = doctorUserId, - TaskAllocationState = TaskAllocationState.Allocated, - AllocateTime = DateTime.Now, - }; - + { + ArmEnum = Arm.JudgeArm, + Id = NewId.NextGuid(), + SubjectId = firstTask.SubjectId, + ReadingTaskState = ReadingTaskState.WaitReading, + TaskName = firstTask.TaskName, + ReadingCategory = ReadingCategory.Judge, + TrialId = firstTask.TrialId, + Code = currentMaxCodeInt + 1, + SourceSubjectVisitId = firstTask.SourceSubjectVisitId, + SouceReadModuleId = firstTask.SouceReadModuleId, + TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), + TaskState = TaskState.Effect, + DoctorUserId = subjectUser==null ? null : subjectUser.Id, + TaskAllocationState = TaskAllocationState.Allocated, + AllocateTime = DateTime.Now, + }; await _visitTaskRepository.AddAsync(visitTask); currentMaxCodeInt = currentMaxCodeInt + 1;