From 61df8db4610bd29f30d5ff76afe68f61cdde4c79 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 29 Apr 2022 10:03:50 +0800 Subject: [PATCH] xxx --- .../Management/DTO/SystemNoticeViewModel.cs | 16 ++++++++++++++++ .../Service/QC/QCOperationService.cs | 6 +++--- IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs | 17 ++++++++++++++++- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs index 0c3fb3d00..9a64a0549 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs @@ -32,6 +32,22 @@ namespace IRaCIS.Core.Application.ViewModel public string FullFilePath { get; set; } + public SystemNotice_NoticeStateEnum ActualNoticeStateEnum + + { + get + { + if (NoticeStateEnum == SystemNotice_NoticeStateEnum.HavePublished && EndDate != null && EndDate < DateTime.Now) + { + return SystemNotice_NoticeStateEnum.HaveExpired; + } + else + { + return NoticeStateEnum; + } + } + } + public List NoticeUserTypeList { get; set; } } diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 4e44616d9..2a36872c2 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -1415,7 +1415,7 @@ namespace IRaCIS.Core.Application.Image.QA [TypeFilter(typeof(TrialResourceFilter))] public async Task QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState) { - + var aa = _userInfo.RequestUrl; if (!await _repository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.Id)) { @@ -1434,9 +1434,9 @@ namespace IRaCIS.Core.Application.Image.QA .FirstOrDefaultAsync(t => t.TrialId == trialId) .IfNullThrowException(); - var dbSubjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId); + var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException(); - if (dbSubjectVisit == null) return Null404NotFound(dbSubjectVisit); + //有人QC Passed if (auditState == AuditStateEnum.QCPassed) diff --git a/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs b/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs index 68f0f6fee..ac82b9012 100644 --- a/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs +++ b/IRaCIS.Core.Domain.Share/AuthUser/UserInfo.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Http; @@ -204,7 +205,21 @@ namespace IRaCIS.Core.Domain.Share get { - return _accessor?.HttpContext?.Request?.Path; + var url = _accessor?.HttpContext?.Request?.Path.ToString(); + + var list = url.Split('/').Where(t=>!string.IsNullOrWhiteSpace(t)). ToList(); + + if (url.Contains("Inspection", StringComparison.OrdinalIgnoreCase)) + { + list.RemoveAt(0); + + return string.Join('/', list.Take(2)); + } + else + { + return string.Join('/', list.Take(2)); + } + } }