修改统一返回接口
This commit is contained in:
@@ -16,10 +16,10 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc);
|
||||
Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument);
|
||||
Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId);
|
||||
Task<PageOutput<UnionDocumentWithConfirmInfoView>> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument);
|
||||
Task<(PageOutput<UnionDocumentWithConfirmInfoView>, object)> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument);
|
||||
Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery queryTrialDocument);
|
||||
|
||||
Task<PageOutput<UnionDocumentWithConfirmInfoView>> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument);
|
||||
Task<(PageOutput<UnionDocumentWithConfirmInfoView>, object)> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument);
|
||||
Task<IResponseOutput> SetFirstViewDocumentTime(Guid documentId, bool isSystemDoc);
|
||||
Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand);
|
||||
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
/// <param name="querySystemDocument"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<UnionDocumentWithConfirmInfoView>> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument)
|
||||
public async Task<(PageOutput<UnionDocumentWithConfirmInfoView>,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
|
||||
/// <param name="querySystemDocument"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<UnionDocumentWithConfirmInfoView>> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument)
|
||||
public async Task<(PageOutput<UnionDocumentWithConfirmInfoView>,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 });
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,18 +8,22 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
public interface IQCListService
|
||||
{
|
||||
Task<CheckDialogDTO> GetCheckChallengeDialogList(Guid subjectVisitId);
|
||||
Task<IResponseOutput<PageOutput<QCCheckViewModel>, TrialSubjectAndSVConfig>> GetConsistencyVerificationList(CheckQuery checkQuery);
|
||||
Task<IResponseOutput<PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig>> GetCRCChallengeList(ChallengeQuery challengeQuery);
|
||||
//Task<IResponseOutput<PageOutput<QCCheckViewModel>, TrialSubjectAndSVConfig>> GetConsistencyVerificationList(CheckQuery checkQuery);
|
||||
//Task<IResponseOutput<PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig>> GetCRCChallengeList(ChallengeQuery challengeQuery);
|
||||
//Task<IResponseOutput<PageOutput<QCCRCVisitViewModel>, TrialSubjectAndSVConfig>> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO);
|
||||
//Task<IResponseOutput<PageOutput<QCVisitViewModel>, TrialSubjectAndSVConfig>> GetQCVisitList(QCVisitSearchDTO visitSearchDTO);
|
||||
//Task<IResponseOutput<PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig>> GetQCChallengeList(ChallengeQuery challengeQuery);
|
||||
//Task<IResponseOutput<PageOutput<ForWardViewModel>>> GetForwardList(ForwardQuery forwardQuery);
|
||||
|
||||
Task<List<ChallengeAndDialog>> GetCRCVisitChallengeAndDialog(Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess);
|
||||
Task<IResponseOutput<PageOutput<QCCRCVisitViewModel>, TrialSubjectAndSVConfig>> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO);
|
||||
Task<IResponseOutput<PageOutput<ForWardViewModel>>> GetForwardList(ForwardQuery forwardQuery);
|
||||
|
||||
Task<List<QCChallengeWithUser>> GetHistoryChallengeList(Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType);
|
||||
Task<List<QCChanllengeCreatorDto>> GetQCChallengeCreatorList(Guid trialId);
|
||||
Task<List<ChallengeAndDialog>> GetQCChallengeDialogList(Guid qaChallengeId);
|
||||
Task<IResponseOutput<PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig>> GetQCChallengeList(ChallengeQuery challengeQuery);
|
||||
|
||||
Task<List<ParticipantDTO>> GetQCParticipantList(Guid trialId);
|
||||
Task<List<QCQuestionAnswerItemDto>> GetQCQuestionAnswerList(Guid subjectVisitId, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType);
|
||||
Task<IResponseOutput<PageOutput<QCVisitViewModel>, TrialSubjectAndSVConfig>> GetQCVisitList(QCVisitSearchDTO visitSearchDTO);
|
||||
|
||||
Task<List<SubjectVisitSelectItem>> GetSubjectVisitSelectList(Guid subjectId);
|
||||
Task<List<QAStudyInfoDTO>> GetSubjectVisitUploadedStudyList(Guid subjectVisitId);
|
||||
Task<UploadViewInitDto> GetUploadInitInfo(Guid subjectVisitId);
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <param name="visitSearchDTO"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<QCCRCVisitViewModel>, TrialSubjectAndSVConfig>> GetCRCVisitList(CRCVisitSearchDTO visitSearchDTO)
|
||||
public async Task<(PageOutput<QCCRCVisitViewModel>, 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<Trial>(t => t.Id == visitSearchDTO.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
|
||||
return ResponseOutput.Ok(pageList, config!);
|
||||
return (pageList, config!);
|
||||
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <param name="challengeQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig>> GetCRCChallengeList(ChallengeQuery challengeQuery)
|
||||
public async Task<(PageOutput<QCCRCChallengeViewModel>, 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<Trial>(t => t.Id == challengeQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
return ResponseOutput.Ok(pageList, config);
|
||||
return (pageList, config);
|
||||
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <param name="challengeQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<QCCRCChallengeViewModel>, TrialSubjectAndSVConfig>> GetQCChallengeList(ChallengeQuery challengeQuery)
|
||||
public async Task<(PageOutput<QCCRCChallengeViewModel>, 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<Trial>(t => t.Id == challengeQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
return ResponseOutput.Ok(pageList, config);
|
||||
return (pageList, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -285,7 +285,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <param name="visitSearchDTO"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<QCVisitViewModel>, TrialSubjectAndSVConfig>> GetQCVisitList(QCVisitSearchDTO visitSearchDTO)
|
||||
public async Task<(PageOutput<QCVisitViewModel>, TrialSubjectAndSVConfig)> GetQCVisitList(QCVisitSearchDTO visitSearchDTO)
|
||||
{
|
||||
|
||||
#region 经典 linq
|
||||
@@ -468,10 +468,10 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
.ProjectTo<QCVisitViewModel>(_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<Trial>(t => t.Id == visitSearchDTO.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
return ResponseOutput.Ok(pageList, config);
|
||||
return (pageList, config);
|
||||
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <param name="checkQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<QCCheckViewModel>, TrialSubjectAndSVConfig>> GetConsistencyVerificationList(CheckQuery checkQuery)
|
||||
public async Task<(PageOutput<QCCheckViewModel>, TrialSubjectAndSVConfig)> GetConsistencyVerificationList(CheckQuery checkQuery)
|
||||
{
|
||||
#region linq 废弃 byzhouhang 2021 11 30
|
||||
//Expression<Func<Subject, bool>> 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<Trial>(t => t.Id == checkQuery.TrialId).ProjectTo<TrialSubjectAndSVConfig>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
return ResponseOutput.Ok(pageList, config);
|
||||
return (pageList, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -577,7 +577,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
/// <param name="forwardQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<ForWardViewModel>>> GetForwardList(ForwardQuery forwardQuery)
|
||||
public async Task<PageOutput<ForWardViewModel>> 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<ForWardViewModel>(_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<ConsistencyCheckFile>(t => t.TrialId == indto.TrialId)
|
||||
.ProjectTo<GetConsistencyCheckFileDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false);
|
||||
return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user