diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 7ec04337f..b2e87fb4b 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -358,7 +358,10 @@ namespace IRaCIS.Core.Application.ViewModel { public Guid TrialId { get; set; } - public Guid TrialReadingCriterionId { get; set; } + + public Guid? SubjectId { get; set; } + + public Guid TrialReadingCriterionId { get; set; } public string? SubjectCode { get; set; } = null; diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 812048590..3dcc4a3e1 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -661,9 +661,9 @@ namespace IRaCIS.Core.Application.Service.Allocation var visitQuery = _visitTaskRepository .Where(x => x.TrialId == inDto.TrialId && x.TaskState == TaskState.Effect) - - //PI 读基线的时候,subject 如果PI基线没阅片完,SR就不能看 - .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline && readingDivisionEnum == ReadingDivisionEnum.PIandSR, + .WhereIf(inDto.SubjectId!=null,t=>t.SubjectId==inDto.SubjectId) + //PI 读基线的时候,subject 如果PI基线没阅片完,SR就不能看 + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SR && piReadingScopenEnum == PIReadingScopenEnum.AllBaseline && readingDivisionEnum == ReadingDivisionEnum.PIandSR, t => t.Subject.SubjectVisitTaskList.Any(c => c.SourceSubjectVisit.IsBaseLine == true && c.ReadingTaskState == ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterionId == trialReadingCriterionId)) //PI 读随访的时候, subject 如果SR基线没阅片完,PI就不能看 diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 8cb2864ef..39adb7875 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -2329,6 +2329,7 @@ namespace IRaCIS.Application.Services var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto() { TrialId = inDto.TrialId, + SubjectId=inDto.SubjectId, TrialReadingCriterionId = trialReadingCriterionId!.Value, Page = new PageInput() { @@ -2350,7 +2351,7 @@ namespace IRaCIS.Application.Services if (currentSubject == null) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]); + throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows); } task = currentSubject.UnReadCanReadTaskList.Select(x => new GetReadingTaskDto() @@ -2423,7 +2424,7 @@ namespace IRaCIS.Application.Services if (task == null) { - throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"]); + throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows); } if (task.SubjectCode.IsNullOrEmpty()) diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs index ccda66221..bda936380 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Exception/BusinessValidationFailedException.cs @@ -1,17 +1,22 @@ -using System; +using IRaCIS.Core.Infrastructure.Extention; +using System; namespace IRaCIS.Core.Infrastructure { public class BusinessValidationFailedException : Exception { + public ApiResponseCodeEnum Code { get; set; } - public BusinessValidationFailedException() + public BusinessValidationFailedException() { } - public BusinessValidationFailedException( string message) : base(message) - { - } + public BusinessValidationFailedException(string message, ApiResponseCodeEnum code = ApiResponseCodeEnum.BusinessValidationFailed) : base(message) + { + Code = code; + + } + } } diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs index 73b9597ae..91e809fdb 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs @@ -24,11 +24,15 @@ namespace IRaCIS.Core.Infrastructure.Extention ProgramException = 4, //需要提示 ,需要提示 从Result 取数据 ( 0 可以继续处理提交 ,1 不能进行继续处理提交 ,2 刷新列表 ) - NeedTips = 5, + NeedTips = 5, + /// + /// 关闭当前页面 + /// + CloseCurrentWindows=6, - //在其他地方登陆,被迫下线 - LoginInOtherPlace = -1, + //在其他地方登陆,被迫下线 + LoginInOtherPlace = -1, //没有带token访问(未登陆) NoToken=10,