修改参数名字

Uat_Study
hang 2022-06-23 16:54:02 +08:00
parent 9a5ed8d4dc
commit 2741678aeb
7 changed files with 67 additions and 47 deletions

View File

@ -22,7 +22,7 @@ namespace IRaCIS.Core.Application.ViewModel
public ReadingCategory ReadingCategory { get; set; } public ReadingCategory ReadingCategory { get; set; }
public TaskState TaskState { get; set; } public TaskAllocationState TaskAllocationState { get; set; }
public bool IsJudgeTaskReturn { get; set; } public bool IsJudgeTaskReturn { get; set; }
@ -188,7 +188,7 @@ namespace IRaCIS.Core.Application.ViewModel
public ReadingCategory? ReadingCategory { get; set; } public ReadingCategory? ReadingCategory { get; set; }
public TaskState? TaskState { get; set; } public TaskAllocationState? TaskAllocationState { get; set; }
public ReadingTaskState? ReadingTaskState { get; set; } public ReadingTaskState? ReadingTaskState { get; set; }

View File

@ -83,7 +83,7 @@ namespace IRaCIS.Core.Application.Service
case ReadingCategory.Visit: case ReadingCategory.Visit:
foreach (var subjectVisit in generateTaskCommand.VisitGenerataTaskList) foreach (var subjectVisit in generateTaskCommand.VisitGenerataTaskList)
{ {
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync(); var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.OrignalSubjectUserId== null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
if (trialConfig.ReadingType == ReadingMethod.Double) if (trialConfig.ReadingType == ReadingMethod.Double)
@ -163,11 +163,11 @@ namespace IRaCIS.Core.Application.Service
//配置了医生 //配置了医生
if (assignConfigList.Count > 0) if (assignConfigList.Count > 0)
{ {
var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskState.InitAllocated : TaskState.Allocated; var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
task1.TaskState = defaultState; task1.TaskAllocationState = defaultState;
task2.TaskState = defaultState; task2.TaskAllocationState = defaultState;
//分配给对应Arm的人 //分配给对应Arm的人
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId; task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
@ -251,9 +251,9 @@ namespace IRaCIS.Core.Application.Service
//配置了医生 //配置了医生
if (assignConfigList.Count > 0) if (assignConfigList.Count > 0)
{ {
var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskState.InitAllocated : TaskState.Allocated; var defaultState = trialConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
singleTask.TaskState = defaultState; singleTask.TaskAllocationState = defaultState;
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == 0).DoctorUserId; singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == 0).DoctorUserId;
@ -293,7 +293,15 @@ namespace IRaCIS.Core.Application.Service
await _visitTaskRepository.AddAsync(new VisitTask() await _visitTaskRepository.AddAsync(new VisitTask()
{ {
OriginalReReadingId=reReadingVisitTask.Id, OriginalReReadingId = reReadingVisitTask.Id,
TrialId = reReadingVisitTask.TrialId,
SubjectId = reReadingVisitTask.SubjectId,
ArmEnum= reReadingVisitTask.ArmEnum,
TaskName= reReadingVisitTask.TaskName,
TaskBlindName = reReadingVisitTask.TaskBlindName,
TaskAllocationState= reReadingVisitTask.TaskAllocationState,
ReadingCategory = reReadingVisitTask.ReadingCategory,
Code = currentMaxCodeInt + 1, Code = currentMaxCodeInt + 1,
TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)), TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
AllocateTime=DateTime.Now, AllocateTime=DateTime.Now,

View File

@ -104,7 +104,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent) .WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId) .WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory) .WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) .WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate) .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
@ -138,7 +138,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId) .WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent) .WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId) .WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) .WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState) .WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
@ -175,7 +175,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId) .WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory) .WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState) .WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) .WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate) .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
@ -210,7 +210,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent) .WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId) .WhereIf(queryVisitTask.DoctorUserId != null, t => t.DoctorUserId == queryVisitTask.DoctorUserId)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState) .WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) .WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate) .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
@ -323,7 +323,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId) .WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent) .WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory) .WhereIf(queryVisitTask.ReadingCategory != null, t => t.ReadingCategory == queryVisitTask.ReadingCategory)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) .WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate) .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
@ -358,7 +358,7 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent) .WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState) .WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState) .WhereIf(queryVisitTask.TaskAllocationState != null, t => t.TaskAllocationState == queryVisitTask.TaskAllocationState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate) .WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
@ -430,12 +430,12 @@ namespace IRaCIS.Core.Application.Service
var armEnum = assginSubjectDoctorCommand.DoctorUserIdArmList.Where(t => t.DoctorUserId == doctorUserId).First().ArmEnum; var armEnum = assginSubjectDoctorCommand.DoctorUserIdArmList.Where(t => t.DoctorUserId == doctorUserId).First().ArmEnum;
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum)) if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum && t.OrignalSubjectUserId==null))
{ {
throw new BusinessValidationFailedException("有Subject 在其他Arm组已有该医生不允许在新的组添加该医生"); throw new BusinessValidationFailedException("有Subject 在其他Arm组已有该医生不允许在新的组添加该医生");
} }
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum)) if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum && t.OrignalSubjectUserId == null))
{ {
throw new BusinessValidationFailedException("有Subject 已有该Arm组的医生不允许继续分配,请刷新页面,确认页面数据是否过期"); throw new BusinessValidationFailedException("有Subject 已有该Arm组的医生不允许继续分配,请刷新页面,确认页面数据是否过期");
} }
@ -466,7 +466,7 @@ namespace IRaCIS.Core.Application.Service
{ {
foreach (var subjectId in cancelSubjectAssignCommand.SubjectIdList) foreach (var subjectId in cancelSubjectAssignCommand.SubjectIdList)
{ {
if (await _visitTaskRepository.AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId != null && t.ArmEnum == Arm.JudgeArm)) if (await _visitTaskRepository.AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId != null && t.ArmEnum == Arm.JudgeArm ))
{ {
throw new BusinessValidationFailedException("有Subject任务已应用不允许取消分配"); throw new BusinessValidationFailedException("有Subject任务已应用不允许取消分配");
} }
@ -540,7 +540,7 @@ namespace IRaCIS.Core.Application.Service
if (assignConfirmCommand.SubjectDoctorUserList.Count == 0) if (assignConfirmCommand.SubjectDoctorUserList.Count == 0)
{ {
subjectDoctorIdArmList = _subjectUserRepository.Where(t => t.SubjectId == subjectId).Select(t => new DoctorArm() { DoctorUserId = t.DoctorUserId, ArmEnum = t.ArmEnum }).ToList(); subjectDoctorIdArmList = _subjectUserRepository.Where(t => t.SubjectId == subjectId && t.OrignalSubjectUserId == null).Select(t => new DoctorArm() { DoctorUserId = t.DoctorUserId, ArmEnum = t.ArmEnum }).ToList();
} }
@ -560,7 +560,7 @@ namespace IRaCIS.Core.Application.Service
{ {
task.DoctorUserId = subjectDoctorArm.DoctorUserId; task.DoctorUserId = subjectDoctorArm.DoctorUserId;
task.AllocateTime = DateTime.Now; task.AllocateTime = DateTime.Now;
task.TaskState = TaskState.Allocated; task.TaskAllocationState = TaskAllocationState.Allocated;
task.SuggesteFinishedTime = task.IsUrgent ? DateTime.Now.AddDays(2) : DateTime.Now.AddDays(7); task.SuggesteFinishedTime = task.IsUrgent ? DateTime.Now.AddDays(2) : DateTime.Now.AddDays(7);
@ -615,8 +615,10 @@ namespace IRaCIS.Core.Application.Service
.Select(t => new .Select(t => new
{ {
SubjectId = t.Id, SubjectId = t.Id,
DoctorUserList = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Select(t => new { t.DoctorUserId, t.ArmEnum }),
IsApplyed = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).SelectMany(t => t.SubjectArmVisitTaskList).Any(c => c.DoctorUserId != null) //给Subject分配医生的时候 未确认绑定关系的
DoctorUserList = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t=> t.OrignalSubjectUserId==null).Select(t => new { t.DoctorUserId, t.ArmEnum }),
IsApplyed = t.SubjectDoctorList.Where(t => isJudge ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t => t.OrignalSubjectUserId == null).SelectMany(t => t.SubjectArmVisitTaskList).Any(c => c.DoctorUserId != null)
}).ToList(); }).ToList();
//已产生任务的Subject数量裁判情况下就是产生裁判任务Subject 的数量) //已产生任务的Subject数量裁判情况下就是产生裁判任务Subject 的数量)
@ -815,7 +817,7 @@ namespace IRaCIS.Core.Application.Service
if (visitTask.SourceSubjectVisitId != null) if (visitTask.SourceSubjectVisitId != null)
{ {
if(await _visitTaskRepository.AnyAsync(t=>t.SourceSubjectVisitId== visitTask.SourceSubjectVisitId && t.DoctorUserId== assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id)) if (await _visitTaskRepository.AnyAsync(t => t.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && t.DoctorUserId == assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id))
{ {
return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配"); return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配");
} }
@ -836,7 +838,7 @@ namespace IRaCIS.Core.Application.Service
visitTask.AllocateTime = DateTime.Now; visitTask.AllocateTime = DateTime.Now;
visitTask.DoctorUserId = assignSubjectTaskToDoctorCommand.DoctorUserId; visitTask.DoctorUserId = assignSubjectTaskToDoctorCommand.DoctorUserId;
visitTask.TaskState = TaskState.Allocated; visitTask.TaskAllocationState = TaskAllocationState.Allocated;
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == visitTask.SourceSubjectVisitId, u => new SubjectVisit() { ReadingStatus = ReadingStatusEnum.ImageReading }); await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == visitTask.SourceSubjectVisitId, u => new SubjectVisit() { ReadingStatus = ReadingStatusEnum.ImageReading });
@ -858,13 +860,13 @@ namespace IRaCIS.Core.Application.Service
else if (assignSubjectTaskToDoctorCommand.TaskOptType == TaskOptType.Confirm) else if (assignSubjectTaskToDoctorCommand.TaskOptType == TaskOptType.Confirm)
{ {
visitTask.TaskState = TaskState.Allocated; visitTask.TaskAllocationState = TaskAllocationState.Allocated;
} }
else if (assignSubjectTaskToDoctorCommand.TaskOptType == TaskOptType.CancelAssign) else if (assignSubjectTaskToDoctorCommand.TaskOptType == TaskOptType.CancelAssign)
{ {
visitTask.AllocateTime = null; visitTask.AllocateTime = null;
visitTask.DoctorUserId = null; visitTask.DoctorUserId = null;
visitTask.TaskState = TaskState.NotAllocate; visitTask.TaskAllocationState = TaskAllocationState.NotAllocate;
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == visitTask.SourceSubjectVisitId, u => new SubjectVisit() { ReadingStatus = ReadingStatusEnum.TaskAllocate }); await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == visitTask.SourceSubjectVisitId, u => new SubjectVisit() { ReadingStatus = ReadingStatusEnum.TaskAllocate });
@ -885,15 +887,18 @@ namespace IRaCIS.Core.Application.Service
[UnitOfWork] [UnitOfWork]
public async Task<IResponseOutput> ApplyReReading(ApplyReReadingCommand applyReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService) public async Task<IResponseOutput> ApplyReReading(ApplyReReadingCommand applyReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService)
{ {
var taskList = await _visitTaskRepository.Where(t => applyReReadingCommand.TaskIdList.Contains(t.Id), true).Include(t=>t.JudgeVisitTask).ToListAsync(); var taskList = await _visitTaskRepository.Where(t => applyReReadingCommand.TaskIdList.Contains(t.Id), true).Include(t => t.JudgeVisitTask).ToListAsync();
var reReadingTaskList = taskList.Clone(); var reReadingTaskList = taskList.Clone();
foreach (var task in taskList) foreach (var task in taskList)
{ {
if(await _visitTaskRepository.AnyAsync(t=>t.OriginalReReadingId==task.Id))
{
throw new BusinessValidationFailedException("已产生重阅任务,不允许再次申请");
}
task.IsReReading = true;
task.RequestReReadingReason = applyReReadingCommand.RequestReReadingReason; task.RequestReReadingReason = applyReReadingCommand.RequestReReadingReason;
task.RequestReReadingType = applyReReadingCommand.RequestReReadingTypeEnum; task.RequestReReadingType = applyReReadingCommand.RequestReReadingTypeEnum;
task.RequestReReadingTime = DateTime.Now; task.RequestReReadingTime = DateTime.Now;
@ -902,16 +907,15 @@ namespace IRaCIS.Core.Application.Service
//产生了裁判 //产生了裁判
if (task.JudgeVisitTaskId != null) if (task.JudgeVisitTaskId != null)
{ {
if(task.ReadingTaskState==ReadingTaskState.WaitReading || task.ReadingTaskState == ReadingTaskState.Reading) if (task.ReadingTaskState == ReadingTaskState.WaitReading || task.ReadingTaskState == ReadingTaskState.Reading)
{ {
task.JudgeVisitTask.ReadingTaskState = ReadingTaskState.HaveCanceled; task.JudgeVisitTask.TaskState = TaskState.HaveCanceled;
} }
else else
{ {
task.JudgeVisitTask.ReadingTaskState = ReadingTaskState.HaveReturned; task.JudgeVisitTask.TaskState = TaskState.HaveReturned;
//task.JudgeVisitTask.IsJudgeTaskReturn = true;
} }
} }
@ -953,6 +957,7 @@ namespace IRaCIS.Core.Application.Service
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => agreeReReadingCommand.TaskIdList.Contains(t.Id), u => new VisitTask() await _visitTaskRepository.UpdatePartialFromQueryAsync(t => agreeReReadingCommand.TaskIdList.Contains(t.Id), u => new VisitTask()
{ {
IsReReading = true,
RequestReReadingResultEnum = agreeReReadingCommand.RequestReReadingResultEnum, RequestReReadingResultEnum = agreeReReadingCommand.RequestReReadingResultEnum,
RequestReReadingConfirmUserId = _userInfo.Id RequestReReadingConfirmUserId = _userInfo.Id
}, true); }, true);

View File

@ -34,8 +34,8 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.SelfApplyedTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId))) .ForMember(o => o.SelfApplyedTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId == u.DoctorUserId)))
.ForMember(o => o.ApplyedTotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId != null))) .ForMember(o => o.ApplyedTotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count(t => t.DoctorUserId != null)))
.ForMember(o => o.SelfApplyedSubjectCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(t => t.DoctorUserId == u.DoctorUserId && t.SubjectArmVisitTaskList.Any(c => c.DoctorUserId != null)).Count())) .ForMember(o => o.SelfApplyedSubjectCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(t => t.DoctorUserId == u.DoctorUserId && t.SubjectArmVisitTaskList.Any(c => c.DoctorUserId != null)).Count()))
.ForMember(o => o.SelfSubjectCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(t => t.DoctorUserId == u.DoctorUserId).Count())) .ForMember(o => o.SelfSubjectCount, t => t.MapFrom(u => u.Trial.SubjectDoctorUserList.Where(t => t.DoctorUserId == u.DoctorUserId ).Count()))
.ForMember(o => o.ApplyedTotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count(c => c.SubjectVisitTaskList.Any(d => d.DoctorUserId != null)))) .ForMember(o => o.ApplyedTotalSubjectCount, t => t.MapFrom(u => u.Trial.SubjectList.Count(c => c.SubjectVisitTaskList.Any(d => d.DoctorUserId != null))))

View File

@ -108,13 +108,13 @@ namespace IRaCIS.Core.Application.Triggers
// if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.Allocated) // if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.Allocated)
// { // {
// task1.TaskState = TaskState.Allocated; // task1.TaskAllocationState = TaskAllocationState.Allocated;
// task2.TaskState = TaskState.Allocated; // task2.TaskAllocationState = TaskAllocationState.Allocated;
// } // }
// else if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.InitAllocated) // else if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.InitAllocated)
// { // {
// task1.TaskState = TaskState.InitAllocated; // task1.TaskAllocationState = TaskAllocationState.InitAllocated;
// task2.TaskState = TaskState.InitAllocated; // task2.TaskAllocationState = TaskAllocationState.InitAllocated;
// } // }
// if (trialConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject) // if (trialConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
@ -199,11 +199,11 @@ namespace IRaCIS.Core.Application.Triggers
// if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.Allocated) // if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.Allocated)
// { // {
// singleTask.TaskState = TaskState.Allocated; // singleTask.TaskAllocationState = TaskAllocationState.Allocated;
// } // }
// else if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.InitAllocated) // else if (trialConfig.TaskAllocateDefaultState == TaskAllocateDefaultState.InitAllocated)
// { // {
// singleTask.TaskState = TaskState.InitAllocated; // singleTask.TaskAllocationState = TaskAllocationState.InitAllocated;
// } // }
// if (trialConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject) // if (trialConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)

View File

@ -26,7 +26,7 @@ namespace IRaCIS.Core.Domain.Share
ReReading = 6, ReReading = 6,
} }
public enum TaskState public enum TaskAllocationState
{ {
//未分配 //未分配
NotAllocate = 0, NotAllocate = 0,
@ -93,6 +93,14 @@ namespace IRaCIS.Core.Domain.Share
} }
public enum TaskState
{
// 裁判任务,没做,或者做了没签名 已取消
HaveCanceled = 3,
HaveReturned = 4
}
//阅片状态 //阅片状态
public enum ReadingTaskState public enum ReadingTaskState
{ {
@ -102,10 +110,7 @@ namespace IRaCIS.Core.Domain.Share
HaveSigned = 2, HaveSigned = 2,
// 裁判任务,没做,或者做了没签名 已取消
HaveCanceled = 3,
HaveReturned = 4
} }
// //

View File

@ -121,9 +121,11 @@ namespace IRaCIS.Core.Domain.Models
//分配状态 //分配状态
public TaskState TaskState { get; set; } public TaskAllocationState TaskAllocationState { get; set; }
public TaskState TaskState { get; set; }
/// <summary> /// <summary>
/// DoctorUserId /// DoctorUserId
/// </summary> /// </summary>