修改验证
parent
53115e63ea
commit
c7236ebc95
|
@ -15,6 +15,7 @@ using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||||
using Nito.AsyncEx;
|
using Nito.AsyncEx;
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
using IRaCIS.Core.Domain.Common;
|
using IRaCIS.Core.Domain.Common;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
|
@ -30,8 +31,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
private readonly IInspectionService _inspectionService;
|
private readonly IInspectionService _inspectionService;
|
||||||
private readonly IRepository<StudyMonitor> _studyMonitorRepository;
|
private readonly IRepository<StudyMonitor> _studyMonitorRepository;
|
||||||
private readonly IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository;
|
private readonly IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository;
|
||||||
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
|
|
||||||
private readonly AsyncLock _mutex = new AsyncLock();
|
private readonly AsyncLock _mutex = new AsyncLock();
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
IDictionaryService dictionaryService,
|
IDictionaryService dictionaryService,
|
||||||
IInspectionService inspectionService,
|
IInspectionService inspectionService,
|
||||||
IRepository<StudyMonitor> studyMonitorRepository,
|
IRepository<StudyMonitor> studyMonitorRepository,
|
||||||
IRepository<NoneDicomStudyFile> noneDicomStudyFileRepository)
|
IRepository<NoneDicomStudyFile> noneDicomStudyFileRepository,IRepository<SubjectVisit> subjectVisitRepository)
|
||||||
{
|
{
|
||||||
_noneDicomStudyRepository = noneDicomStudyRepository;
|
_noneDicomStudyRepository = noneDicomStudyRepository;
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
this._inspectionService = inspectionService;
|
this._inspectionService = inspectionService;
|
||||||
this._studyMonitorRepository = studyMonitorRepository;
|
this._studyMonitorRepository = studyMonitorRepository;
|
||||||
_noneDicomStudyFileRepository = noneDicomStudyFileRepository;
|
_noneDicomStudyFileRepository = noneDicomStudyFileRepository;
|
||||||
|
this._subjectVisitRepository = subjectVisitRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,6 +63,24 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
return await noneDicomStudyQueryable.ToListAsync();
|
return await noneDicomStudyQueryable.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void VerifyIsCanQC(SubjectVisit? subjectVisit, Guid? sujectVisitId = null)
|
||||||
|
{
|
||||||
|
if (sujectVisitId != null)
|
||||||
|
{
|
||||||
|
subjectVisit = _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == sujectVisitId).Result.IfNullThrowException();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subjectVisit.PreliminaryAuditUserId != null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("当前访视已审核通过,不允许操作");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subjectVisit.CurrentActionUserId != _userInfo.Id)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TypeFilter(typeof(TrialResourceFilter))]
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
public async Task<IResponseOutput<NoneDicomStudyAddReturnDto>> AddOrUpdateNoneDicomStudy(NoneDicomStudyAddOrEdit addOrEditNoneDicomStudy)
|
public async Task<IResponseOutput<NoneDicomStudyAddReturnDto>> AddOrUpdateNoneDicomStudy(NoneDicomStudyAddOrEdit addOrEditNoneDicomStudy)
|
||||||
|
@ -83,6 +102,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
|
||||||
|
{
|
||||||
|
VerifyIsCanQC(null, addOrEditNoneDicomStudy.SubjectVisitId);
|
||||||
|
}
|
||||||
|
|
||||||
optEntity = await _noneDicomStudyRepository.UpdateFromDTOAsync(addOrEditNoneDicomStudy);
|
optEntity = await _noneDicomStudyRepository.UpdateFromDTOAsync(addOrEditNoneDicomStudy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Application.Contracts.DTO;
|
using IRaCIS.Core.Application.Contracts.DTO;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Image.QA
|
namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
|
@ -609,21 +610,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||||
|
|
||||||
if (currentQCType == CurrentQC.First)
|
|
||||||
{
|
|
||||||
if (_userInfo.Id != sv.CurrentActionUserId)
|
if (_userInfo.Id != sv.CurrentActionUserId)
|
||||||
{
|
{
|
||||||
throw new Exception("当前用户不是初审用户,不允许操作!");
|
throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!");
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_userInfo.Id != sv.CurrentActionUserId)
|
|
||||||
{
|
|
||||||
throw new Exception("当前用户不是复审用户,不允许操作!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var temp = await GetVisitQCStudyAndSeriesList(subjectVisitId);
|
var temp = await GetVisitQCStudyAndSeriesList(subjectVisitId);
|
||||||
|
|
||||||
var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType);
|
var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType);
|
||||||
|
|
|
@ -151,6 +151,11 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
public async Task<IResponseOutput> CloseQCChallenge(Guid qcChallengeId, Guid subjectVisitId, [FromRoute] QCChallengeCloseEnum closeEnum, [FromRoute] string closeReason)
|
public async Task<IResponseOutput> CloseQCChallenge(Guid qcChallengeId, Guid subjectVisitId, [FromRoute] QCChallengeCloseEnum closeEnum, [FromRoute] string closeReason)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
|
||||||
|
{
|
||||||
|
VerifyIsCanQC(null, subjectVisitId);
|
||||||
|
}
|
||||||
|
|
||||||
var dbQCChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException();
|
var dbQCChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,6 +165,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 之前
|
#region 之前
|
||||||
|
|
||||||
dbQCChallenge.CloseResonEnum = closeEnum;
|
dbQCChallenge.CloseResonEnum = closeEnum;
|
||||||
|
@ -489,9 +496,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
/// 一致性核查 excel上传 支持三种格式
|
/// 一致性核查 excel上传 支持三种格式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="file"></param>
|
/// <param name="file"></param>
|
||||||
/// <param name="_mediator"></param>
|
|
||||||
/// <param name="trialId"></param>
|
|
||||||
/// <param name="_hostEnvironment"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("{trialId:guid}")]
|
[HttpPost("{trialId:guid}")]
|
||||||
[TypeFilter(typeof(TrialResourceFilter))]
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
|
@ -1091,7 +1095,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
|
|
||||||
if (subjectVisit.CurrentActionUserId != _userInfo.Id)
|
if (subjectVisit.CurrentActionUserId != _userInfo.Id)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("当前领取人已不是自己,不允许操作");
|
throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1415,7 +1419,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
[TypeFilter(typeof(TrialResourceFilter))]
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
|
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
|
||||||
{
|
{
|
||||||
var aa = _userInfo.RequestUrl;
|
|
||||||
|
|
||||||
if (!await _repository.AnyAsync<TrialUser>(t => t.TrialId == trialId && t.UserId == _userInfo.Id))
|
if (!await _repository.AnyAsync<TrialUser>(t => t.TrialId == trialId && t.UserId == _userInfo.Id))
|
||||||
{
|
{
|
||||||
|
@ -1429,6 +1432,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var trialConfig = await _trialRepository
|
var trialConfig = await _trialRepository
|
||||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
|
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
|
||||||
.FirstOrDefaultAsync(t => t.TrialId == trialId)
|
.FirstOrDefaultAsync(t => t.TrialId == trialId)
|
||||||
|
@ -1436,7 +1440,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
|
|
||||||
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||||
|
|
||||||
|
VerifyIsCanQC(dbSubjectVisit);
|
||||||
|
|
||||||
//有人QC Passed
|
//有人QC Passed
|
||||||
if (auditState == AuditStateEnum.QCPassed)
|
if (auditState == AuditStateEnum.QCPassed)
|
||||||
|
|
Loading…
Reference in New Issue