修改稽查和界面统计 需要迁移02
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2023-11-23 15:08:53 +08:00
parent 767c24dd56
commit 14826ee44b
2 changed files with 116 additions and 42 deletions

View File

@ -208,8 +208,9 @@ namespace IRaCIS.Core.Application
}).Where(x => x.ToBeRepliedCount > 0); }).Where(x => x.ToBeRepliedCount > 0);
var defalutSortArray = new string[] { nameof(CheckToBeDoneDto.UrgentCount) + " desc", nameof(CheckToBeDoneDto.ToBeCheckedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(CheckToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync(); .Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
@ -251,7 +252,9 @@ namespace IRaCIS.Core.Application
}).Where(x => x.ToBeApprovalCount > 0); }).Where(x => x.ToBeApprovalCount > 0);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApplyToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var defalutSortArray = new string[] { nameof(ReReadingApplyToBeDoneDto.UrgentCount) + " desc", nameof(ReReadingApplyToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeApprovalCount = _visitTaskReReadingRepository var toBeApprovalCount = _visitTaskReReadingRepository
@ -288,7 +291,10 @@ namespace IRaCIS.Core.Application
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count() ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count()
}).Where(x => x.ToBeApprovalCount > 0); }).Where(x => x.ToBeApprovalCount > 0);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var defalutSortArray = new string[] { nameof(ReviewerSelectToBeDoneDto.IsUrgent) + " desc", nameof(ReReadingApplyToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync(); .Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
@ -317,13 +323,17 @@ namespace IRaCIS.Core.Application
TrialCode = t.TrialCode, TrialCode = t.TrialCode,
ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm&&!u.IsPMConfirm).Count() ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm && !u.IsPMConfirm).Count()
}).Where(x => x.ToBeApprovalCount > 0); }).Where(x => x.ToBeApprovalCount > 0);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var defalutSortArray = new string[] { nameof(GetPMClinicalDataToBeDoneListOutDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var all =await _trialRepository
var all = await _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new GetPMClinicalDataToBeDoneListOutDto() .Select(t => new GetPMClinicalDataToBeDoneListOutDto()
{ {
@ -332,7 +342,7 @@ namespace IRaCIS.Core.Application
ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm && !u.IsPMConfirm).Count() ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm && !u.IsPMConfirm).Count()
}).ToListAsync(); }).ToListAsync();
return ResponseOutput.Ok(result, new { ToBeApprovalCount = all.Sum(x=>x.ToBeApprovalCount) }); ; return ResponseOutput.Ok(result, new { ToBeApprovalCount = all.Sum(x => x.ToBeApprovalCount) }); ;
} }
#endregion #endregion
@ -363,9 +373,13 @@ namespace IRaCIS.Core.Application
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView, IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count()
}).Where(x => x.ToBeApprovalCount > 0) ; }).Where(x => x.ToBeApprovalCount > 0);
var defalutSortArray = new string[] { nameof(ReviewerSelectToBeDoneDto.IsUrgent) + " desc", nameof(ReviewerSelectToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync(); .Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
@ -403,7 +417,10 @@ namespace IRaCIS.Core.Application
}).Where(x => x.ToBeApprovalCount > 0); }).Where(x => x.ToBeApprovalCount > 0);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApprovalToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var defalutSortArray = new string[] { nameof(ReReadingApprovalToBeDoneDto.UrgentCount) + " desc", nameof(ReReadingApprovalToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeApprovalCount = _visitTaskReReadingRepository var toBeApprovalCount = _visitTaskReReadingRepository
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -441,13 +458,15 @@ namespace IRaCIS.Core.Application
ExperimentName = t.ExperimentName, ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode, TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(), UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(),
ToBeDealedCount = t.ReadingClinicalDataList.Where(x=>!x.IsSign&& x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit&& x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject).Count(), ToBeDealedCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject).Count(),
ToBeVisitCount= t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(), ToBeVisitCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(),
ToAllCount= t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC ).Count(), ToAllCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count(),
ReadModuleCount =t.ReadModuleList.Where(x=>!x.IsPMConfirm).Count(), ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
}).Where(x=>x.ToBeDealedCount > 0); }).Where(x => x.ToBeDealedCount > 0);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageClinicalDataToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var defalutSortArray = new string[] { nameof(ImageClinicalDataToBeDoneDto.UrgentCount) + " desc", nameof(ImageClinicalDataToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeDealedCount = _subjectVisitRepository var toBeDealedCount = _subjectVisitRepository
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm)) //.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
@ -486,7 +505,10 @@ namespace IRaCIS.Core.Application
ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(), ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
}).Where(x => x.ReadModuleCount > 0); }).Where(x => x.ReadModuleCount > 0);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageClinicalDataToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var defalutSortArray = new string[] { nameof(ImageClinicalDataToBeDoneDto.UrgentCount) + " desc", nameof(ImageClinicalDataToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeDealedCount = _subjectVisitRepository var toBeDealedCount = _subjectVisitRepository
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm)) //.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
@ -529,11 +551,14 @@ namespace IRaCIS.Core.Application
ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
.SelectMany(c => c.QCChallengeList) .SelectMany(c => c.QCChallengeList)
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId==null)).Count(), .Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count(),
}).Where(x => x.ToBeDealedCount > 0); ; }).Where(x => x.ToBeDealedCount > 0); ;
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var defalutSortArray = new string[] { nameof(ImageQuestionToBeDoneDto.UrgentCount) + " desc", nameof(ImageQuestionToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeDealedCount = _subjectVisitRepository var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -575,9 +600,10 @@ namespace IRaCIS.Core.Application
}).Where(x => x.ToBeReplyedCount > 0); }).Where(x => x.ToBeReplyedCount > 0);
var defalutSortArray = new string[] { nameof(ImageCheckQuestionToBeDoneDto.UrgentCount) + " desc", nameof(ImageCheckQuestionToBeDoneDto.ToBeReplyedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageCheckQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var toBeDealedCount = _subjectVisitRepository var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -612,15 +638,18 @@ namespace IRaCIS.Core.Application
TrialCode = t.TrialCode, TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList UrgentCount = t.SubjectVisitList
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
.Where(u => u.IsUrgent && ((u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading)||u.IsQCConfirmedReupload)).Count(), .Where(u => u.IsUrgent && ((u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || u.IsQCConfirmedReupload)).Count(),
ToBeReUploadCount = t.SubjectVisitList ToBeReUploadCount = t.SubjectVisitList
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) ||(u.IsQCConfirmedReupload)).Count(), .Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count(),
}).Where(x => x.ToBeReUploadCount > 0); }).Where(x => x.ToBeReUploadCount > 0);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageReUploadToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var defalutSortArray = new string[] { nameof(ImageReUploadToBeDoneDto.UrgentCount) + " desc", nameof(ImageReUploadToBeDoneDto.ToBeReUploadCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeDealedCount = _subjectVisitRepository var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -655,7 +684,7 @@ namespace IRaCIS.Core.Application
TrialCode = t.TrialCode, TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList UrgentCount = t.SubjectVisitList
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && (u.IsEnrollmentConfirm ||u.PDState==PDStateEnum.PDProgress || u.Trial.IsUrgent ||u.Subject.IsUrgent)/*u.IsUrgent*/).Count(), .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && (u.IsEnrollmentConfirm || u.PDState == PDStateEnum.PDProgress || u.Trial.IsUrgent || u.Subject.IsUrgent)/*u.IsUrgent*/).Count(),
ToBeDealedCount = t.SubjectVisitList ToBeDealedCount = t.SubjectVisitList
@ -664,7 +693,12 @@ namespace IRaCIS.Core.Application
}).Where(x => x.ToBeDealedCount > 0); ; }).Where(x => x.ToBeDealedCount > 0); ;
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageSubmittedToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var defalutSortArray = new string[] { nameof(ImageSubmittedToBeDoneDto.UrgentCount) + " desc", nameof(ImageSubmittedToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeDealedCount = _subjectVisitRepository var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -715,9 +749,13 @@ namespace IRaCIS.Core.Application
//待审核通过统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了) //待审核通过统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count() ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
}).Where(x => x.ToBeClaimedCount+x.ToBeReviewedCount > 0); }).Where(x => x.ToBeClaimedCount + x.ToBeReviewedCount > 0);
var defalutSortArray = new string[] { nameof(ImageQualityToBeDoneDto.UrgentCount) + " desc", nameof(ImageQualityToBeDoneDto.ToBeClaimedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQualityToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var toBeClaimedCount = _subjectVisitRepository var toBeClaimedCount = _subjectVisitRepository
@ -762,7 +800,10 @@ namespace IRaCIS.Core.Application
}).Where(x => x.ToBeDealedCount > 0); ; }).Where(x => x.ToBeDealedCount > 0); ;
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var defalutSortArray = new string[] { nameof(ImageQuestionToBeDoneDto.UrgentCount) + " desc", nameof(ImageQuestionToBeDoneDto.ToBeDealedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeDealedCount = _subjectVisitRepository var toBeDealedCount = _subjectVisitRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -903,8 +944,9 @@ namespace IRaCIS.Core.Application
#endregion #endregion
var defalutSortArray = new string[] { nameof(IRImageReadingToBeDoneDto.UrgentCount) + " desc", nameof(IRImageReadingToBeDoneDto.UnReadCount) + " desc" };
var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(IRImageReadingToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc); var result = await newQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeDealedCount = _trialRepository var toBeDealedCount = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -958,7 +1000,7 @@ namespace IRaCIS.Core.Application
#region 不能对包含聚合或子查询的表达式执行聚合函数 #region 不能对包含聚合或子查询的表达式执行聚合函数
UrgentCount = g.Where(u => u.VisitTask.IsUrgent && u.LatestReplyUser.UserTypeEnum== UserTypeEnum.MIM).Count(), UrgentCount = g.Where(u => u.VisitTask.IsUrgent && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM).Count(),
ToBeReplyedCount = g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM).Count(), ToBeReplyedCount = g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM).Count(),
@ -969,9 +1011,14 @@ namespace IRaCIS.Core.Application
//ToBeReplyedCount = g.Where(u => //ToBeReplyedCount = g.Where(u =>
// u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(), // u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM).Count(),
}); }).Where(t => t.ToBeReplyedCount > 0);
var defalutSortArray = new string[] { nameof(MedicalCommentsToBeDoneDto.UrgentCount) + " desc", nameof(MedicalCommentsToBeDoneDto.ToBeReplyedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(MedicalCommentsToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var toBeDealedCount = _taskMedicalReviewRepository var toBeDealedCount = _taskMedicalReviewRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -1036,13 +1083,16 @@ namespace IRaCIS.Core.Application
ToBeReviewedCount = g.Where(u => !u.IsInvalid && u.AuditState != MedicalReviewAuditState.HaveSigned).Count() ToBeReviewedCount = g.Where(u => !u.IsInvalid && u.AuditState != MedicalReviewAuditState.HaveSigned).Count()
}); }).Where(t => t.ToBeReplyedCount > 0);
#endregion #endregion
var defalutSortArray = new string[] { nameof(MedicalCommentsToBeDoneDto.UrgentCount) + " desc", nameof(MedicalCommentsToBeDoneDto.ToBeReplyedCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(MedicalCommentsToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
var toBeReplyedQuery = _taskMedicalReviewRepository var toBeReplyedQuery = _taskMedicalReviewRepository
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))

View File

@ -1534,6 +1534,30 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}); });
} }
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteUserSurvey)))
{
var type = GetEntityAuditOpt(item);
var entity = item.Entity as TrialSiteUserSurvey;
await InsertInspection<TrialSiteUserSurvey>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false
});
}
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteEquipmentSurvey)))
{
var type = GetEntityAuditOpt(item);
var entity = item.Entity as TrialSiteEquipmentSurvey;
await InsertInspection<TrialSiteEquipmentSurvey>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false
});
}
#endregion #endregion