影响列表

Uat_Study
hang 2022-07-18 11:30:08 +08:00
parent 29d72d847b
commit 23c3797a3e
3 changed files with 40 additions and 38 deletions

View File

@ -285,7 +285,7 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.GetReReadingOrBackInfluenceTaskList(System.Guid,System.Boolean)"> <member name="M:IRaCIS.Core.Application.Service.VisitTaskService.GetReReadingOrBackInfluenceTaskList(System.Guid,System.Boolean,System.Nullable{System.Guid})">
<summary> <summary>
影响提示列表 重阅仅仅针对已完成的任务申请 退回针对的是未完成的(退回仅仅针对是访视类型的) 影响提示列表 重阅仅仅针对已完成的任务申请 退回针对的是未完成的(退回仅仅针对是访视类型的)
</summary> </summary>

View File

@ -1422,17 +1422,12 @@ namespace IRaCIS.Core.Application.Service
var task = (await _visitTaskRepository.Where(t => t.Id == taskId).FirstOrDefaultAsync()).IfNullThrowException(); var task = (await _visitTaskRepository.Where(t => t.Id == taskId).FirstOrDefaultAsync()).IfNullThrowException();
if (task.TaskState != TaskState.Effect) if (task.TaskState != TaskState.Effect || task.ReadingCategory != ReadingCategory.Visit || task.ReadingTaskState == ReadingTaskState.HaveSigned)
{ {
return ResponseOutput.NotOk("仅仅允许针对生效的任务进行退回操作,请刷新页面数据"); return ResponseOutput.NotOk("仅仅允许针对生效的未完成的访视任务进行退回操作,请刷新页面数据");
} }
//申请的任务 肯定是未完成阅片的 并且是访视类型的
if (task.ReadingCategory != ReadingCategory.Visit || task.ReadingTaskState == ReadingTaskState.HaveSigned)
{
return ResponseOutput.NotOk("仅仅未完成的访视类型的任务支持PM退回");
}
if (task.IsAnalysisCreate) if (task.IsAnalysisCreate)
{ {
@ -1718,7 +1713,7 @@ namespace IRaCIS.Core.Application.Service
/// <param name="isReReading"></param> /// <param name="isReReading"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("{taskId:guid}/{isReReading:bool}")] [HttpGet("{taskId:guid}/{isReReading:bool}")]
public async Task<List<VisitTaskSimpleView>> GetReReadingOrBackInfluenceTaskList(Guid taskId, bool isReReading) public async Task<List<VisitTaskSimpleView>> GetReReadingOrBackInfluenceTaskList(Guid taskId, bool isReReading, Guid? applyId)
{ {
var filterObj = (await _visitTaskRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == taskId)).IfNullThrowException(); var filterObj = (await _visitTaskRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == taskId)).IfNullThrowException();
var trialId = filterObj.TrialId; var trialId = filterObj.TrialId;
@ -1735,13 +1730,16 @@ namespace IRaCIS.Core.Application.Service
//重阅影响 //重阅影响
if (isReReading) if (isReReading)
{ {
//有序
if (trialConfig.IsReadingTaskViewInOrder)
//IR 申请 PM 同意 仅仅影响自己
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务
if (await _visitTaskReReadingRepository.AnyAsync(t => t.Id == applyId && t.CreateUser.UserTypeEnum == UserTypeEnum.IndependentReviewer) && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
{ {
//IR 仅仅影响自己 //有序
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务 if (trialConfig.IsReadingTaskViewInOrder)
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
{ {
switch (filterObj.ReadingCategory) switch (filterObj.ReadingCategory)
{ {
case ReadingCategory.Visit: case ReadingCategory.Visit:
@ -1794,11 +1792,26 @@ namespace IRaCIS.Core.Application.Service
default: default:
throw new BusinessValidationFailedException("不支持重阅的任务类型"); throw new BusinessValidationFailedException("不支持重阅的任务类型");
} }
}
//无序
else
{
//1.当前任务及裁判任务
//2.影响当前阅片人的任务
filterExpression = filterExpression.And(t => t.Id == filterObj.Id || t.Id == filterObj.JudgeVisitTaskId);
} }
//PM 影响所有阅片人 仅仅针对访视 }
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && filterObj.IsAnalysisCreate == false) else
{
throw new BusinessValidationFailedException("仅允许PM 同意 IR 申请的任务");
}
//PM 影响所有阅片人 仅仅针对访视 SPM CPM 掉用
if (await _visitTaskReReadingRepository.AnyAsync(t => t.Id == applyId && t.CreateUser.UserTypeEnum == UserTypeEnum.ProjectManager) && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM) && filterObj.IsAnalysisCreate == false && filterObj.ReadingCategory == ReadingCategory.Visit)
{
//有序
if (trialConfig.IsReadingTaskViewInOrder)
{ {
switch (filterObj.ReadingCategory) switch (filterObj.ReadingCategory)
{ {
@ -1813,39 +1826,26 @@ namespace IRaCIS.Core.Application.Service
throw new BusinessValidationFailedException("不支持重阅的任务类型"); throw new BusinessValidationFailedException("不支持重阅的任务类型");
} }
} }
//无序
else else
{ {
throw new BusinessValidationFailedException("一致性分析的任务只允许IR申请重阅"); // 1.当前任务及裁判任务
} // 2.影响所有阅片人的任务
}
//无序
else
{
//1.当前任务及裁判任务
//2.影响当前阅片人的任务
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
{
filterExpression = filterExpression.And(t => t.Id == filterObj.Id || t.Id == filterObj.JudgeVisitTaskId);
}
// 1.当前任务及裁判任务
// 2.影响所有阅片人的任务
if (filterObj.ReadingCategory == ReadingCategory.Visit && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && filterObj.IsAnalysisCreate == false)
{
var judegTaskNum = filterObj.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge]; var judegTaskNum = filterObj.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge];
filterExpression = filterExpression.And(t => t.VisitTaskNum == filterObj.VisitTaskNum || t.VisitTaskNum == judegTaskNum); filterExpression = filterExpression.And(t => t.VisitTaskNum == filterObj.VisitTaskNum || t.VisitTaskNum == judegTaskNum);
} }
else
{ }
throw new BusinessValidationFailedException("PM 仅允许申请非一致性分析访视类型的任务进行重阅"); else
} {
throw new BusinessValidationFailedException("仅允许SPM CPM 同意 PM 申请的非 一致性分析的访视任务");
} }
} }
//退回影响 仅仅针对是访视类型的 //退回影响 仅仅针对是访视类型的
else else
{ {

View File

@ -69,6 +69,8 @@ namespace IRaCIS.Core.Domain.Models
public DateTime UpdateTime { get; set; } public DateTime UpdateTime { get; set; }
public Guid UpdateUserId { get; set; } public Guid UpdateUserId { get; set; }
public User CreateUser { get; set; }
} }
} }