From 8e7dab028e98ea182db0aab72675616044b186ba Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 30 May 2022 13:34:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E4=B8=80=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interface/ITrialDocumentService.cs | 4 +-- .../Service/Document/TrialDocumentService.cs | 10 +++--- .../Service/QC/Interface/IQCListService.cs | 16 ++++++---- .../Service/QC/QCListService.cs | 31 +++++++++---------- .../Extention/Output/PageOutput.cs | 6 ---- 5 files changed, 31 insertions(+), 36 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs index b712a7198..e9e90f7f2 100644 --- a/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs @@ -16,10 +16,10 @@ namespace IRaCIS.Core.Application.Contracts Task UserAbandonDoc(Guid documentId, bool isSystemDoc); Task AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument); Task DeleteTrialDocument(Guid trialDocumentId, Guid trialId); - Task> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument); + Task<(PageOutput, object)> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument); Task> GetTrialDocumentList(TrialDocumentQuery queryTrialDocument); - Task> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument); + Task<(PageOutput, object)> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument); Task SetFirstViewDocumentTime(Guid documentId, bool isSystemDoc); Task UserConfirm(UserConfirmCommand userConfirmCommand); Task> GetTrialUserSelect(Guid trialId); diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index bb0090408..7f8208870 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -61,7 +61,7 @@ namespace IRaCIS.Core.Application.Services /// /// [HttpPost] - public async Task> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument) + public async Task<(PageOutput,object)> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument) { #region https://github.com/dotnet/efcore/issues/16243 操作不行 ////系统文档查询 @@ -209,9 +209,8 @@ namespace IRaCIS.Core.Application.Services .Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .CountAsync(); - result.OtherData = new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount }; - return result; + return (result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount }); } @@ -223,7 +222,7 @@ namespace IRaCIS.Core.Application.Services /// /// [HttpPost] - public async Task> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument) + public async Task<(PageOutput,object)> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument) { @@ -345,9 +344,8 @@ namespace IRaCIS.Core.Application.Services .Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .CountAsync(); - result.OtherData = new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount }; - return result; + return (result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount }); } diff --git a/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs b/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs index 411abbe0e..21829357d 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs @@ -8,18 +8,22 @@ namespace IRaCIS.Core.Application.Image.QA public interface IQCListService { Task GetCheckChallengeDialogList(Guid subjectVisitId); - Task, TrialSubjectAndSVConfig>> GetConsistencyVerificationList(CheckQuery checkQuery); - Task, TrialSubjectAndSVConfig>> GetCRCChallengeList(ChallengeQuery challengeQuery); + //Task, TrialSubjectAndSVConfig>> GetConsistencyVerificationList(CheckQuery checkQuery); + //Task, TrialSubjectAndSVConfig>> GetCRCChallengeList(ChallengeQuery challengeQuery); + //Task, TrialSubjectAndSVConfig>> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO); + //Task, TrialSubjectAndSVConfig>> GetQCVisitList(QCVisitSearchDTO visitSearchDTO); + //Task, TrialSubjectAndSVConfig>> GetQCChallengeList(ChallengeQuery challengeQuery); + //Task>> GetForwardList(ForwardQuery forwardQuery); + Task> GetCRCVisitChallengeAndDialog(Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess); - Task, TrialSubjectAndSVConfig>> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO); - Task>> GetForwardList(ForwardQuery forwardQuery); + Task> GetHistoryChallengeList(Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType); Task> GetQCChallengeCreatorList(Guid trialId); Task> GetQCChallengeDialogList(Guid qaChallengeId); - Task, TrialSubjectAndSVConfig>> GetQCChallengeList(ChallengeQuery challengeQuery); + Task> GetQCParticipantList(Guid trialId); Task> GetQCQuestionAnswerList(Guid subjectVisitId, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType); - Task, TrialSubjectAndSVConfig>> GetQCVisitList(QCVisitSearchDTO visitSearchDTO); + Task> GetSubjectVisitSelectList(Guid subjectId); Task> GetSubjectVisitUploadedStudyList(Guid subjectVisitId); Task GetUploadInitInfo(Guid subjectVisitId); diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index a875b6281..2aa036270 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -95,7 +95,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task, TrialSubjectAndSVConfig>> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO) + public async Task<(PageOutput, TrialSubjectAndSVConfig)> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO) { var svExpression = GetSubjectVisitFilter(visitSearchDTO.VisitPlanArray); @@ -115,11 +115,11 @@ namespace IRaCIS.Core.Application.Image.QA var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent), nameof(SubjectVisit.SubjectId), nameof(SubjectVisit.VisitNum) }; - var pageList = await query.ToPagedListAsync(visitSearchDTO.PageIndex, visitSearchDTO.PageSize, visitSearchDTO.SortField, visitSearchDTO.Asc,string.IsNullOrWhiteSpace(visitSearchDTO.SortField), defalutSortArray); + var pageList = await query.ToPagedListAsync(visitSearchDTO.PageIndex, visitSearchDTO.PageSize, visitSearchDTO.SortField, visitSearchDTO.Asc, string.IsNullOrWhiteSpace(visitSearchDTO.SortField), defalutSortArray); var config = await _repository.Where(t => t.Id == visitSearchDTO.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - return ResponseOutput.Ok(pageList, config!); + return (pageList, config!); } @@ -131,7 +131,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task, TrialSubjectAndSVConfig>> GetCRCChallengeList(ChallengeQuery challengeQuery) + public async Task<(PageOutput, TrialSubjectAndSVConfig)> GetCRCChallengeList(ChallengeQuery challengeQuery) { #region CRC 质疑列表 join连表方式 @@ -188,7 +188,7 @@ namespace IRaCIS.Core.Application.Image.QA var pageList = await query2.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "IsClosed asc" }); var config = await _repository.Where(t => t.Id == challengeQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - return ResponseOutput.Ok(pageList, config); + return (pageList, config); } @@ -203,7 +203,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task, TrialSubjectAndSVConfig>> GetQCChallengeList(ChallengeQuery challengeQuery) + public async Task<(PageOutput, TrialSubjectAndSVConfig)> GetQCChallengeList(ChallengeQuery challengeQuery) { #region linq方式 + Expression 拼接 @@ -276,7 +276,7 @@ namespace IRaCIS.Core.Application.Image.QA var pageList = await query.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "IsClosed asc" }); var config = await _repository.Where(t => t.Id == challengeQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - return ResponseOutput.Ok(pageList, config); + return (pageList, config); } /// @@ -285,7 +285,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task, TrialSubjectAndSVConfig>> GetQCVisitList(QCVisitSearchDTO visitSearchDTO) + public async Task<(PageOutput, TrialSubjectAndSVConfig)> GetQCVisitList(QCVisitSearchDTO visitSearchDTO) { #region 经典 linq @@ -468,10 +468,10 @@ namespace IRaCIS.Core.Application.Image.QA .ProjectTo(_mapper.ConfigurationProvider); var defalutSortArray = new string[] { nameof(SubjectVisit.IsUrgent), nameof(SubjectVisit.SubjectId), nameof(SubjectVisit.VisitNum) }; - var pageList = await query.ToPagedListAsync(visitSearchDTO.PageIndex, visitSearchDTO.PageSize, visitSearchDTO.SortField, visitSearchDTO.Asc,string.IsNullOrWhiteSpace(visitSearchDTO.SortField), defalutSortArray); + var pageList = await query.ToPagedListAsync(visitSearchDTO.PageIndex, visitSearchDTO.PageSize, visitSearchDTO.SortField, visitSearchDTO.Asc, string.IsNullOrWhiteSpace(visitSearchDTO.SortField), defalutSortArray); var config = await _repository.Where(t => t.Id == visitSearchDTO.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - return ResponseOutput.Ok(pageList, config); + return (pageList, config); } @@ -485,7 +485,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task, TrialSubjectAndSVConfig>> GetConsistencyVerificationList(CheckQuery checkQuery) + public async Task<(PageOutput, TrialSubjectAndSVConfig)> GetConsistencyVerificationList(CheckQuery checkQuery) { #region linq 废弃 byzhouhang 2021 11 30 //Expression> subjectLambda = x => true; @@ -549,7 +549,7 @@ namespace IRaCIS.Core.Application.Image.QA var pageList = await query.ToPagedListAsync(checkQuery.PageIndex, checkQuery.PageSize, checkQuery.SortField, checkQuery.Asc); var config = await _repository.Where(t => t.Id == checkQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - return ResponseOutput.Ok(pageList, config); + return (pageList, config); } /// @@ -577,7 +577,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task>> GetForwardList(ForwardQuery forwardQuery) + public async Task> GetForwardList(ForwardQuery forwardQuery) { //var trialConfig = _trialReposioty.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification }).FirstOrDefault(t => t.TrialId == forwardQuery.TrialId); @@ -593,9 +593,8 @@ namespace IRaCIS.Core.Application.Image.QA //.WhereIf(_userInfo.UserTypeEnumInt == (int)UserType.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site .ProjectTo(_mapper.ConfigurationProvider); - var pageList = await query.ToPagedListAsync(forwardQuery.PageIndex, forwardQuery.PageSize, forwardQuery.SortField, forwardQuery.Asc); + return await query.ToPagedListAsync(forwardQuery.PageIndex, forwardQuery.PageSize, forwardQuery.SortField, forwardQuery.Asc); - return ResponseOutput.Ok(pageList); } #endregion @@ -812,7 +811,7 @@ namespace IRaCIS.Core.Application.Image.QA var query = _repository.Where(t => t.TrialId == indto.TrialId) .ProjectTo(_mapper.ConfigurationProvider); - return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false); + return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false); } diff --git a/IRaCIS.Core.Infrastructure/Extention/Output/PageOutput.cs b/IRaCIS.Core.Infrastructure/Extention/Output/PageOutput.cs index d023989e6..b37806158 100644 --- a/IRaCIS.Core.Infrastructure/Extention/Output/PageOutput.cs +++ b/IRaCIS.Core.Infrastructure/Extention/Output/PageOutput.cs @@ -28,12 +28,6 @@ namespace IRaCIS.Core.Infrastructure.Extention /// public IList CurrentPageData { get; set; } - - /// - /// 分页数据 可能额外返回其他类型的查询数据 必须一些配置 - /// - public object OtherData { get; set; } - public PageOutput() { }