修改验证
							parent
							
								
									53115e63ea
								
							
						
					
					
						commit
						c7236ebc95
					
				| 
						 | 
				
			
			@ -15,6 +15,7 @@ using IRaCIS.Core.Application.Service.Inspection.DTO;
 | 
			
		|||
using Nito.AsyncEx;
 | 
			
		||||
using IRaCIS.Application.Interfaces;
 | 
			
		||||
using IRaCIS.Core.Domain.Common;
 | 
			
		||||
using IRaCIS.Core.Infrastructure;
 | 
			
		||||
 | 
			
		||||
namespace IRaCIS.Core.Application.Contracts
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -30,8 +31,7 @@ namespace IRaCIS.Core.Application.Contracts
 | 
			
		|||
        private readonly IInspectionService _inspectionService;
 | 
			
		||||
        private readonly IRepository<StudyMonitor> _studyMonitorRepository;
 | 
			
		||||
        private readonly IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        private readonly IRepository<SubjectVisit> _subjectVisitRepository;
 | 
			
		||||
        private readonly AsyncLock _mutex = new AsyncLock();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Contracts
 | 
			
		|||
            IDictionaryService dictionaryService,
 | 
			
		||||
            IInspectionService inspectionService,
 | 
			
		||||
            IRepository<StudyMonitor> studyMonitorRepository,
 | 
			
		||||
            IRepository<NoneDicomStudyFile> noneDicomStudyFileRepository)
 | 
			
		||||
            IRepository<NoneDicomStudyFile> noneDicomStudyFileRepository,IRepository<SubjectVisit> subjectVisitRepository)
 | 
			
		||||
        {
 | 
			
		||||
            _noneDicomStudyRepository = noneDicomStudyRepository;
 | 
			
		||||
           
 | 
			
		||||
| 
						 | 
				
			
			@ -49,6 +49,7 @@ namespace IRaCIS.Core.Application.Contracts
 | 
			
		|||
            this._inspectionService = inspectionService;
 | 
			
		||||
            this._studyMonitorRepository = studyMonitorRepository;
 | 
			
		||||
            _noneDicomStudyFileRepository = noneDicomStudyFileRepository;
 | 
			
		||||
            this._subjectVisitRepository = subjectVisitRepository;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -62,6 +63,24 @@ namespace IRaCIS.Core.Application.Contracts
 | 
			
		|||
            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]
 | 
			
		||||
        [TypeFilter(typeof(TrialResourceFilter))]
 | 
			
		||||
        public async Task<IResponseOutput<NoneDicomStudyAddReturnDto>> AddOrUpdateNoneDicomStudy(NoneDicomStudyAddOrEdit addOrEditNoneDicomStudy)
 | 
			
		||||
| 
						 | 
				
			
			@ -83,6 +102,12 @@ namespace IRaCIS.Core.Application.Contracts
 | 
			
		|||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
 | 
			
		||||
                    if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
 | 
			
		||||
                    {
 | 
			
		||||
                        VerifyIsCanQC(null, addOrEditNoneDicomStudy.SubjectVisitId);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    optEntity = await _noneDicomStudyRepository.UpdateFromDTOAsync(addOrEditNoneDicomStudy);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc;
 | 
			
		|||
using IRaCIS.Core.Domain.Share;
 | 
			
		||||
using IRaCIS.Core.Application.Contracts.DTO;
 | 
			
		||||
using System.Linq.Expressions;
 | 
			
		||||
using IRaCIS.Core.Infrastructure;
 | 
			
		||||
 | 
			
		||||
namespace IRaCIS.Core.Application.Image.QA
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -609,20 +610,12 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
        {
 | 
			
		||||
            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("当前用户不是初审用户,不允许操作!");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                if (_userInfo.Id != sv.CurrentActionUserId)
 | 
			
		||||
                {
 | 
			
		||||
                    throw new Exception("当前用户不是复审用户,不允许操作!");
 | 
			
		||||
                }
 | 
			
		||||
                throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!");
 | 
			
		||||
            }
 | 
			
		||||
          
 | 
			
		||||
 | 
			
		||||
            var temp = await GetVisitQCStudyAndSeriesList(subjectVisitId);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC)
 | 
			
		||||
            {
 | 
			
		||||
                VerifyIsCanQC(null, subjectVisitId);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var dbQCChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -159,6 +164,8 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
                throw new BusinessValidationFailedException("CRC申请重传的/QC同意重传的质疑,在CRC设置重传完成前不允许关闭质疑");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
           
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            #region 之前
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -489,9 +496,6 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
        /// 一致性核查 excel上传 支持三种格式
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="file"></param>
 | 
			
		||||
        /// <param name="_mediator"></param>
 | 
			
		||||
        /// <param name="trialId"></param>
 | 
			
		||||
        /// <param name="_hostEnvironment"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost("{trialId:guid}")]
 | 
			
		||||
        [TypeFilter(typeof(TrialResourceFilter))]
 | 
			
		||||
| 
						 | 
				
			
			@ -1091,7 +1095,7 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
 | 
			
		||||
            if (subjectVisit.CurrentActionUserId != _userInfo.Id)
 | 
			
		||||
            {
 | 
			
		||||
                throw new BusinessValidationFailedException("当前领取人已不是自己,不允许操作");
 | 
			
		||||
                throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!");
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1415,7 +1419,6 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
        [TypeFilter(typeof(TrialResourceFilter))]
 | 
			
		||||
        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))
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -1428,6 +1431,7 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
                return ResponseOutput.NotOk("有质疑未关闭,不允许该操作");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          
 | 
			
		||||
 | 
			
		||||
            var trialConfig = await _trialRepository
 | 
			
		||||
                  .Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
 | 
			
		||||
| 
						 | 
				
			
			@ -1436,7 +1440,7 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
 | 
			
		||||
            var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            VerifyIsCanQC(dbSubjectVisit);
 | 
			
		||||
 | 
			
		||||
            //有人QC Passed
 | 
			
		||||
            if (auditState == AuditStateEnum.QCPassed)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue