This commit is contained in:
2022-08-02 10:26:39 +08:00
parent 5ec77b40c7
commit 98ceaa007c
4 changed files with 40 additions and 12 deletions
@@ -1104,16 +1104,16 @@ namespace IRaCIS.Core.Application.Service.Allocation
{
var visitGroupQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id)
.Where(x => !x.Subject.IsDeleted)
.Where(t => (t.ReadingTaskState != ReadingTaskState.HaveSigned || t.ReReadingApplyState == ReReadingApplyState.HaveApplyed) && t.TaskState == TaskState.Effect)
.Where(t => (t.ReadingTaskState != ReadingTaskState.HaveSigned || t.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed) && t.TaskState == TaskState.Effect)
.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
{
SubjectId = x.Key.SubjectId,
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
UnReadTaskCount = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.HaveApplyed).Count(),
ExistReadingApply = x.Any(y => y.ReReadingApplyState == ReReadingApplyState.HaveApplyed),
UnReadTaskList = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.HaveApplyed).OrderBy(x => x.VisitTaskNum)
UnReadTaskCount = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.DocotorHaveApplyed).Count(),
ExistReadingApply = x.Any(y => y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed),
UnReadTaskList = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.DocotorHaveApplyed).OrderBy(x => x.VisitTaskNum)
.Select(u => new IRUnreadTaskView()
{
Id = u.Id,
@@ -1130,7 +1130,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
var count = visitGroupQuery.Select(x => new
{
UnReadTaskCount = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.HaveApplyed).Count(),
UnReadTaskCount = x.Where(y => y.ReReadingApplyState != ReReadingApplyState.DocotorHaveApplyed).Count(),
}).Where(x => x.UnReadTaskCount > 0).Count();
return (count, visitTaskQuery);
}
@@ -1197,7 +1197,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
throw new BusinessValidationFailedException("未阅片完成,或者未生效的任务不允许申请重阅");
}
if (task.ReReadingApplyState == ReReadingApplyState.HaveApplyed || task.ReReadingApplyState == ReReadingApplyState.Agree)
if (task.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.Agree)
{
throw new BusinessValidationFailedException("重阅已申请,或者重阅已同意状态下不允许申请重阅");
}
@@ -1216,6 +1216,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
throw new BusinessValidationFailedException("PM 仅仅允许对访视类型的任务申请重阅");
}
task.ReReadingApplyState = ReReadingApplyState.TrialGroupHaveApplyed;
//// 有序
@@ -1235,6 +1236,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
}
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
{
task.ReReadingApplyState = ReReadingApplyState.DocotorHaveApplyed;
// 有序
if (trialConfig.IsReadingTaskViewInOrder)
{
@@ -1273,7 +1276,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
task.ReReadingApplyState = ReReadingApplyState.HaveApplyed;
var rootReReadingTaskId = _visitTaskReReadingRepository.Where(t => t.NewReReadingTaskId == task.Id).Select(u => u.RootReReadingTaskId).FirstOrDefault();
@@ -1423,7 +1425,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
#region PM 访
await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.OriginalReReadingTask.SubjectId == visitTaskReReadingAppply.OriginalReReadingTask.SubjectId &&
t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.HaveApplyed &&
t.OriginalReReadingTask.ReReadingApplyState==ReReadingApplyState.TrialGroupHaveApplyed &&
//t.RequestReReadingResultEnum==RequestReReadingResult.Default &&
t.RequestReReadingType == RequestReReadingType.TrialGroupApply &&
t.OriginalReReadingTask.VisitTaskNum == origenalTask.VisitTaskNum &&
t.Id != item.Id, u => new VisitTaskReReading()
@@ -1432,8 +1435,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
RequestReReadingResultEnum = RequestReReadingResult.Agree,
});
//只更新 PM 申请 同一访视的数据
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == origenalTask.SubjectId &&
t.ReReadingApplyState == ReReadingApplyState.HaveApplyed &&
t.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed &&
t.IsAnalysisCreate == origenalTask.IsAnalysisCreate &&
t.VisitTaskNum == origenalTask.VisitTaskNum &&
t.Id != origenalTask.Id, u => new VisitTask()