修改稽查和界面统计 需要迁移02

Uat_Study
hang 2023-11-23 15:08:53 +08:00
parent a234e0746d
commit 53ae0527ff
2 changed files with 174 additions and 38 deletions

View File

@ -207,8 +207,9 @@ namespace IRaCIS.Core.Application
}).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))
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
@ -250,7 +251,9 @@ namespace IRaCIS.Core.Application
}).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
@ -262,6 +265,38 @@ namespace IRaCIS.Core.Application
}
/// <summary>
///PM 阅片人筛选 -- PM APM 待办
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_enrollRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns> vvv
[HttpPost]
public async Task<IResponseOutput<PageOutput<ReviewerSelectToBeDoneDto>>> GetPM_ReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery
, [FromServices] IRepository<Enroll> _enrollRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ReviewerSelectToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count()
}).Where(x => x.ToBeApprovalCount > 0);
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))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
/// <summary>
/// 获取PM核对临床数据
@ -282,13 +317,17 @@ namespace IRaCIS.Core.Application
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);
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))
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
{
@ -297,7 +336,7 @@ namespace IRaCIS.Core.Application
ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm && !u.IsPMConfirm).Count()
}).ToListAsync();
return ResponseOutput.Ok(result, new { ToBeApprovalCount = all.Sum(x=>x.ToBeApprovalCount) }); ;
return ResponseOutput.Ok(result, new { ToBeApprovalCount = all.Sum(x => x.ToBeApprovalCount) }); ;
}
#endregion
@ -305,6 +344,43 @@ namespace IRaCIS.Core.Application
#region SPM CPM 待办
/// <summary>
///SPM 阅片人筛选
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_enrollRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns> vvv
[HttpPost]
public async Task<IResponseOutput<PageOutput<ReviewerSelectToBeDoneDto>>> GetSPM_ReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery
, [FromServices] IRepository<Enroll> _enrollRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ReviewerSelectToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count()
}).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 toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount }); ;
}
/// <summary>
/// SPM 重阅审批
@ -335,7 +411,10 @@ namespace IRaCIS.Core.Application
}).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
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -373,13 +452,15 @@ namespace IRaCIS.Core.Application
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
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(),
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(),
ReadModuleCount =t.ReadModuleList.Where(x=>!x.IsPMConfirm).Count(),
}).Where(x=>x.ToBeDealedCount > 0);
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(),
ToAllCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count(),
ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
}).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
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
@ -418,7 +499,10 @@ namespace IRaCIS.Core.Application
ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
}).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
//.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
@ -461,11 +545,14 @@ namespace IRaCIS.Core.Application
ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
.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); ;
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
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -507,9 +594,10 @@ namespace IRaCIS.Core.Application
}).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
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -544,15 +632,18 @@ namespace IRaCIS.Core.Application
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList
.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
.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);
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
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -587,7 +678,7 @@ namespace IRaCIS.Core.Application
TrialCode = t.TrialCode,
UrgentCount = t.SubjectVisitList
.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
@ -596,7 +687,12 @@ namespace IRaCIS.Core.Application
}).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
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -647,9 +743,13 @@ namespace IRaCIS.Core.Application
//待审核通过统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
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
@ -694,7 +794,10 @@ namespace IRaCIS.Core.Application
}).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
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -835,8 +938,9 @@ namespace IRaCIS.Core.Application
#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
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -888,7 +992,7 @@ namespace IRaCIS.Core.Application
#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(),
@ -899,9 +1003,14 @@ namespace IRaCIS.Core.Application
//ToBeReplyedCount = g.Where(u =>
// 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
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
@ -965,20 +1074,23 @@ namespace IRaCIS.Core.Application
ToBeReviewedCount = g.Where(u => !u.IsInvalid && u.AuditState != MedicalReviewAuditState.HaveSigned).Count()
});
}).Where(t => t.ToBeReplyedCount > 0);
#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
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(t => t.IsClosedDialog == false)
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer);
//.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer);
//.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer);
var toBeReplyedCount = toBeReplyedQuery.Count();

View File

@ -1411,6 +1411,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