This commit is contained in:
he
2022-07-27 15:18:35 +08:00
parent b83e3344e2
commit 0055cb37fc
2 changed files with 22 additions and 6 deletions
@@ -705,7 +705,7 @@ namespace IRaCIS.Core.Application.Service
case GenerateTaskCategory.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();
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm && x.IsConfirmed).FirstOrDefaultAsync();
VisitTask visitTask = new VisitTask()
{
@@ -726,6 +726,7 @@ namespace IRaCIS.Core.Application.Service
DoctorUserId = subjectUser == null ? null : subjectUser.DoctorUserId,
TaskAllocationState = subjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated,
AllocateTime = subjectUser == null ? null : DateTime.Now,
SuggesteFinishedTime = subjectUser == null ? null : DateTime.Now.AddDays(7),
};
@@ -768,6 +769,7 @@ namespace IRaCIS.Core.Application.Service
DoctorUserId = originalTaskInfo.DoctorUserId,
AllocateTime = DateTime.Now,
TaskAllocationState = TaskAllocationState.Allocated,
SuggesteFinishedTime = DateTime.Now.AddDays(7),
Code = currentMaxCodeInt + 1,
TaskBlindName = item.ReadingName,
@@ -781,8 +783,12 @@ namespace IRaCIS.Core.Application.Service
}
break;
case GenerateTaskCategory.Oncology:
foreach (var item in generateTaskCommand.ReadingGenerataTaskList)
{
var oncologySubjectUser = await _subjectUserRepository.Where(x => x.SubjectId == item.SubjectId && x.ArmEnum == Arm.TumorArm && x.IsConfirmed).FirstOrDefaultAsync();
var singleTask = await _visitTaskRepository.AddAsync(new VisitTask()
{
TrialId = trialId,
@@ -794,6 +800,12 @@ namespace IRaCIS.Core.Application.Service
Code = currentMaxCodeInt + 1,
SouceReadModuleId = item.ReadModuleId,
TaskBlindName = item.ReadingName,
DoctorUserId = oncologySubjectUser == null ? null : oncologySubjectUser.DoctorUserId,
AllocateTime = oncologySubjectUser == null ? null : DateTime.Now,
TaskAllocationState = oncologySubjectUser == null ? TaskAllocationState.NotAllocate : TaskAllocationState.Allocated,
SuggesteFinishedTime = oncologySubjectUser == null ? null : DateTime.Now.AddDays(7),
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
ReadingCategory = item.ReadingCategory