diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 84d4d4756..a64c4ae77 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -12739,7 +12739,7 @@ - + IR影像阅片 diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs index 0809ef1ba..1b6afb306 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs @@ -119,6 +119,15 @@ namespace IRaCIS.Core.Application.Contracts public bool IsSigned { get; set; } + public Guid? UserTypeId { get; set; } + + public DocUserSignType? DocUserSignType { get; set; } + + public DateTime? BeginCreateTime { get; set; } + + public DateTime? EndCreateTime { get; set; } + + } public class GetNextUnSignDocumentInDto @@ -171,7 +180,7 @@ namespace IRaCIS.Core.Application.Contracts } - public class SystemDocQuery:PageInput + public class SystemDocQuery : PageInput { public Guid? FileTypeId { get; set; } @@ -204,6 +213,11 @@ namespace IRaCIS.Core.Application.Contracts /// 结束时间 /// public DateTime? EndConfirmTime { get; set; } + + + public DateTime? BeginCreateTime { get; set; } + + public DateTime? EndCreateTime { get; set; } } public class DocumentTrialUnionQuery : TrialUserDocUnionQuery @@ -233,6 +247,10 @@ namespace IRaCIS.Core.Application.Contracts /// 结束时间 /// public DateTime? EndConfirmTime { get; set; } + + public DateTime? BeginCreateTime { get; set; } + + public DateTime? EndCreateTime { get; set; } } /// SystemDocumentAddOrEdit 列表查询参数模型 diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index 34ec5ffd7..86c53ba0e 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -35,7 +35,11 @@ namespace IRaCIS.Core.Application.Services var systemDocumentQueryable = _systemDocumentRepository.AsQueryable(true) .WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name)) .WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId) - .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted) + .WhereIf(inQuery.DocUserSignType != null, t => t.DocUserSignType == inQuery.DocUserSignType) + .WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime) + .WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime) + .WhereIf(inQuery.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId)) + .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted) .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us, userId = _userInfo.UserRoleId }); return await systemDocumentQueryable.ToPagedListAsync(inQuery); @@ -178,18 +182,18 @@ namespace IRaCIS.Core.Application.Services RealName = user.FullName, UserName = user.UserName, - DocTypeCode=sysDoc.FileType.Code + DocTypeCode = sysDoc.FileType.Code //UserTypeId = user.UserTypeId, //UserTypeShortName = user.UserTypeRole.UserTypeShortName }; - var list = await query - //过滤掉删除的,并且没有签名的 + var list = await query + //过滤掉删除的,并且没有签名的 .Where(t => !(t.IsDeleted == true && t.ConfirmTime == null)) .WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null) .WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null) - .ToPagedListAsync(inQuery,nameof(UnionDocumentWithConfirmInfoView.DocTypeCode)); + .ToPagedListAsync(inQuery, nameof(UnionDocumentWithConfirmInfoView.DocTypeCode)); return list; diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 933e5895e..3a244fccc 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -559,8 +559,10 @@ namespace IRaCIS.Core.Application.Services .WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId) .WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null) .WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null) - .WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value) - .WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value) + .WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value) + .WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value) + .WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime) + .WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime) .WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName)) .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted); @@ -751,6 +753,17 @@ namespace IRaCIS.Core.Application.Services } + /// + /// 获取系统签署文档签署人下拉框 + /// + /// + public async Task GetSysDocSignUserList() + { + var list = _systemDocConfirmedUserRepository.Where(t => t.ConfirmTime !=null).Select(t => new { t.ConfirmUserId, t.ConfirmUser.UserName, t.ConfirmUser.FullName }).Distinct().ToList(); + + return ResponseOutput.Ok(list); + } + [HttpPost] public async Task>> GetSysDocumentConfirmList(SystemDocQuery inQuery) { @@ -796,6 +809,8 @@ namespace IRaCIS.Core.Application.Services .WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null) .WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value) .WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value) + .WhereIf(inQuery.BeginCreateTime != null, t => t.CreateTime >= inQuery.BeginCreateTime) + .WhereIf(inQuery.EndCreateTime != null, t => t.CreateTime <= inQuery.EndCreateTime) .WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName)) .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted); diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 6412072fe..d56326c42 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -267,9 +267,16 @@ namespace IRaCIS.Core.Application.Image.QA //已经有在申请的影像回退记录 throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); } + var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException(); - var newRecord = new SubjectVisitImageBackRecord() { SubjectVisitId = subjectVisitId,SubmitTime=sv.SubmitTime,EarliestScanDate=sv.EarliestScanDate,LatestScanDate=sv.LatestScanDate }; + if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack) + { + // 该访视已在其他途径申请影像回退中,不允许申请 + throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]); + } + + var newRecord = new SubjectVisitImageBackRecord() { SubjectVisitId = subjectVisitId, SubmitTime = sv.SubmitTime, EarliestScanDate = sv.EarliestScanDate, LatestScanDate = sv.LatestScanDate }; if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator) { @@ -536,6 +543,20 @@ namespace IRaCIS.Core.Application.Image.QA return ResponseOutput.NotOk(_localizer["QCOperation_Cannotback"]); } + + if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).AnyAsync(t => t.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None))) + { + // 该访视已在其他途径申请影像回退中,不允许申请 + throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + } + + if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack) + { + // 该访视已在其他途径申请影像回退中,不允许申请 + throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + } + + var QCChallengeId = await _qcChallengeRepository.Where(x => x.SubjectVisitId == subjectVisitId).Select(x => x.Id).FirstOrDefaultAsync(); await _checkChallengeDialogRepository.AddAsync(new CheckChallengeDialog() @@ -2298,6 +2319,19 @@ namespace IRaCIS.Core.Application.Image.QA { var qcChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException(); + var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == qcChallenge.SubjectVisitId)).IfNullThrowException(); + + if (await _subjectVisitRepository.Where(t => t.Id == sv.Id).AnyAsync(t => t.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None))) + { + // 该访视已在其他途径申请影像回退中,不允许申请 + throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + } + + if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack) + { + // 该访视已在其他途径申请影像回退中,不允许申请 + throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + } if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.None && qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.CRCReuploaded) {