申请限制
parent
883f06372f
commit
0b880e20da
|
@ -393,7 +393,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == iRUnReadSubjectQuery.TrialId && x.DoctorUserId == _userInfo.Id&&x.TaskState == TaskState.Effect)
|
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == iRUnReadSubjectQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||||
.Where(x => !x.Subject.IsDeleted);
|
.Where(x => !x.Subject.IsDeleted);
|
||||||
|
|
||||||
IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto()
|
IRUnReadOutDto iRUnReadOut = new IRUnReadOutDto()
|
||||||
|
@ -988,15 +988,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
foreach (var task in taskList)
|
foreach (var task in taskList)
|
||||||
{
|
{
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && task.IsAnalysisCreate)
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException("PM 不允许对一致性分析任务进行申请重阅");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && task.ReadingCategory != ReadingCategory.Visit)
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException("PM 仅仅允许对访视类型的任务申请重阅");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (task.ReadingTaskState != ReadingTaskState.HaveSigned || task.TaskState != TaskState.Effect)
|
if (task.ReadingTaskState != ReadingTaskState.HaveSigned || task.TaskState != TaskState.Effect)
|
||||||
{
|
{
|
||||||
|
@ -1009,28 +1001,47 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && !trialConfig.IsReadingTaskViewInOrder && (task.ReadingCategory != ReadingCategory.Visit && task.ReadingCategory != ReadingCategory.Global))
|
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("无序阅片,仅仅允许IR 申请 全局和访视类型类别的任务进行重阅");
|
if (task.IsAnalysisCreate)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("PM 不允许对一致性分析任务进行申请重阅");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task.ReadingCategory == ReadingCategory.Judge && task.TaskState == TaskState.HaveReturned)
|
if (task.ReadingCategory != ReadingCategory.Visit)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("访视重阅导致裁判任务重置的,不能申请重阅");
|
throw new BusinessValidationFailedException("PM 仅仅允许对访视类型的任务申请重阅");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 有序
|
||||||
|
if (trialConfig.IsReadingTaskViewInOrder)
|
||||||
|
{
|
||||||
|
// 当前访视之前 已有任务申请
|
||||||
|
if (await _visitTaskRepository.AnyAsync(t => t.TrialId == task.TrialId && t.SubjectId == task.SubjectId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Visit
|
||||||
|
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.VisitTaskNum <= task.VisitTaskNum && t.Id != task.Id && t.ReReadingApplyState == ReReadingApplyState.HaveApplyed))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk("当前为有序阅片,之前有访视,或其他IR的本次访视已申请重阅,还未处理,不允许申请");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
|
||||||
|
{
|
||||||
|
// 有序
|
||||||
|
if (trialConfig.IsReadingTaskViewInOrder)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == task.TrialId && t.SubjectId == task.SubjectId && t.TaskState == TaskState.Effect
|
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == task.TrialId && t.SubjectId == task.SubjectId && t.TaskState == TaskState.Effect
|
||||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.DoctorUserId == task.DoctorUserId && t.IsAnalysisCreate == false && t.VisitTaskNum > task.VisitTaskNum;
|
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.DoctorUserId == task.DoctorUserId && t.IsAnalysisCreate == false && t.VisitTaskNum > task.VisitTaskNum;
|
||||||
|
|
||||||
|
|
||||||
//当前访视之前 已有任务申请
|
|
||||||
if (trialConfig.IsReadingTaskViewInOrder && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager
|
|
||||||
&& await _visitTaskRepository.AnyAsync(t => t.TrialId == task.TrialId && t.SubjectId == task.SubjectId && t.TaskState == TaskState.Effect && t.ReadingCategory==ReadingCategory.Visit
|
|
||||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.VisitTaskNum <= task.VisitTaskNum && t.Id!= task.Id && t.ReReadingApplyState == ReReadingApplyState.HaveApplyed ))
|
|
||||||
{
|
|
||||||
return ResponseOutput.NotOk("当前为有序阅片,之前有访视,或其他IR的本次访视已申请重阅,还未处理,不允许申请");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Global)))
|
if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Global)))
|
||||||
{
|
{
|
||||||
|
@ -1047,6 +1058,23 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException("只允许申请该受试者阅片人最后一次完成裁判的任务重阅");
|
throw new BusinessValidationFailedException("只允许申请该受试者阅片人最后一次完成裁判的任务重阅");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((task.ReadingCategory != ReadingCategory.Visit && task.ReadingCategory != ReadingCategory.Global))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("无序阅片,仅仅允许IR 申请 全局和访视类型类别的任务进行重阅");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
task.ReReadingApplyState = ReReadingApplyState.HaveApplyed;
|
task.ReReadingApplyState = ReReadingApplyState.HaveApplyed;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1920,7 +1948,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var list = await _visitTaskRepository.Where(filterExpression).OrderBy(t=>t.VisitTaskNum).ProjectTo<VisitTaskSimpleView>(_mapper.ConfigurationProvider).ToListAsync();
|
var list = await _visitTaskRepository.Where(filterExpression).OrderBy(t => t.VisitTaskNum).ProjectTo<VisitTaskSimpleView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue