维护历史分页列表传递参数
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-08-22 15:57:02 +08:00
parent 7db339d876
commit 15fe8db248
59 changed files with 949 additions and 1083 deletions
@@ -21,38 +21,38 @@ namespace IRaCIS.Application.Services
/// Reviewer列表分页查询
/// </summary>
[HttpPost]
public async Task<PageOutput<DoctorDTO>> GetDoctorSearchList(DoctorSearchDTO doctorSearch)
public async Task<PageOutput<DoctorDTO>> GetDoctorSearchList(DoctorSearchDTO inQuery)
{
// 项目经验 多选
var evaluationCriteriaCount = doctorSearch.EvaluationCriteriaIdList.Count();
var evaluationCriteriaCount = inQuery.EvaluationCriteriaIdList.Count();
// 搜索条件 ReadingType 、Subspeciality、Title 多选
var count = doctorSearch.ReadingTypeIdList.Count + doctorSearch.TitleIdList.Count + doctorSearch.SubspecialityIdList.Count;
var count = inQuery.ReadingTypeIdList.Count + inQuery.TitleIdList.Count + inQuery.SubspecialityIdList.Count;
var guidList = doctorSearch.ReadingTypeIdList.Concat(doctorSearch.SubspecialityIdList).Concat(doctorSearch.TitleIdList);
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
var query = _doctorRepository.AsQueryable()
.WhereIf(doctorSearch.DepartmentId != null, t => t.DepartmentId == doctorSearch.DepartmentId)
.WhereIf(doctorSearch.SpecialityId != null, t => t.SpecialityId == doctorSearch.SpecialityId)
.WhereIf(doctorSearch.HospitalId != null, t => t.HospitalId == doctorSearch.HospitalId)
.WhereIf(doctorSearch.PositionId != null, t => t.PositionId == doctorSearch.PositionId)
.WhereIf(doctorSearch.RankId != null, t => t.RankId == doctorSearch.RankId)
.WhereIf(doctorSearch.ContractorStatus != null, t => t.CooperateStatus == doctorSearch.ContractorStatus)
.WhereIf(doctorSearch.InformationConfirmed != null, t => t.ResumeStatus == doctorSearch.InformationConfirmed)
.WhereIf(doctorSearch.AcceptingNewTrial != null, t => t.AcceptingNewTrial == doctorSearch.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(doctorSearch.Name), t => t.ChineseName.Contains(doctorSearch.Name) || (t.LastName + t.FirstName).Contains(doctorSearch.Name))
.WhereIf(doctorSearch.Nation != null, t => t.Nation == doctorSearch.Nation)
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => doctorSearch.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
.WhereIf(inQuery.PositionId != null, t => t.PositionId == inQuery.PositionId)
.WhereIf(inQuery.RankId != null, t => t.RankId == inQuery.RankId)
.WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus)
.WhereIf(inQuery.InformationConfirmed != null, t => t.ResumeStatus == inQuery.InformationConfirmed)
.WhereIf(inQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == inQuery.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ChineseName.Contains(inQuery.Name) || (t.LastName + t.FirstName).Contains(inQuery.Name))
.WhereIf(inQuery.Nation != null, t => t.Nation == inQuery.Nation)
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => inQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
////用户类型 看到简历的范围这里需要确认
//.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ReviewerCoordinator, t => t.UserList.Any(u => u.UserId == _userInfo.Id))
.WhereIf(count > 0, t => t.DoctorDicRelationList.Count(u => guidList.Contains(u.DictionaryId)) == count)
.WhereIf(doctorSearch.EnrollStatus != null && doctorSearch.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.WhereIf(inQuery.EnrollStatus != null && inQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.ProjectTo<DoctorDTO>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(doctorSearch.PageIndex, doctorSearch.PageSize, doctorSearch.SortField == string.Empty ? "CreateTime" : doctorSearch.SortField, doctorSearch.Asc);
return await query.ToPagedListAsync(inQuery);
}
@@ -64,45 +64,45 @@ namespace IRaCIS.Application.Services
/// </summary>
[HttpPost]
public async Task<PageOutput<SelectionReviewerDTO>> GetSelectionReviewerList(
ReviewerSelectionQueryDTO selectionQuery)
ReviewerSelectionQueryDTO inQuery)
{
//项目配置需要的医生过滤 2表示混合
var trialConfig = await _repository.Where<Trial>(s => s.Id == selectionQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
var trialConfig = await _repository.Where<Trial>(s => s.Id == inQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException();
//var nation = trialConfig.AttendedReviewerType;
// 临床项目经验 多选
var evaluationCriteriaCount = selectionQuery.EvaluationCriteriaIdList.Count();
var evaluationCriteriaCount = inQuery.EvaluationCriteriaIdList.Count();
// 搜索条件 ReadingType 、Subspeciality、Title 多选
var count = selectionQuery.ReadingTypeIdList.Count + selectionQuery.TitleIdList.Count + selectionQuery.SubspecialityIdList.Count;
var count = inQuery.ReadingTypeIdList.Count + inQuery.TitleIdList.Count + inQuery.SubspecialityIdList.Count;
var guidList = selectionQuery.ReadingTypeIdList.Concat(selectionQuery.SubspecialityIdList).Concat(selectionQuery.TitleIdList);
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/
.WhereIf(selectionQuery.DepartmentId != null, t => t.DepartmentId == selectionQuery.DepartmentId)
.WhereIf(selectionQuery.SpecialityId != null, t => t.SpecialityId == selectionQuery.SpecialityId)
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
.WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual ==true)
.WhereIf(trialConfig.TrialType != TrialType.NoneOfficial, t => t.IsVirtual == false)
.WhereIf(selectionQuery.HospitalId != null, t => t.HospitalId == selectionQuery.HospitalId)
.WhereIf(selectionQuery.PositionId != null, t => t.PositionId == selectionQuery.PositionId)
.WhereIf(selectionQuery.RankId != null, t => t.RankId == selectionQuery.RankId)
.WhereIf(selectionQuery.ContractorStatus != null, t => t.CooperateStatus == selectionQuery.ContractorStatus )
.WhereIf(selectionQuery.InformationConfirmed != null, t => t.ResumeStatus == selectionQuery.InformationConfirmed)
.WhereIf(selectionQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == selectionQuery.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(selectionQuery.Name), t => t.ChineseName.Contains(selectionQuery.Name) || (t.LastName + t.FirstName).Contains(selectionQuery.Name))
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => selectionQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
.WhereIf(inQuery.PositionId != null, t => t.PositionId == inQuery.PositionId)
.WhereIf(inQuery.RankId != null, t => t.RankId == inQuery.RankId)
.WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus )
.WhereIf(inQuery.InformationConfirmed != null, t => t.ResumeStatus == inQuery.InformationConfirmed)
.WhereIf(inQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == inQuery.AcceptingNewTrial)
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ChineseName.Contains(inQuery.Name) || (t.LastName + t.FirstName).Contains(inQuery.Name))
.WhereIf(evaluationCriteriaCount > 0, t => t.TrialExperienceCriteriaList.Count(t => inQuery.EvaluationCriteriaIdList.Contains(t.EvaluationCriteriaId)) == evaluationCriteriaCount)
//用户类型 看到简历的范围这里需要确认
//.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ReviewerCoordinator, t => t.UserList.Any(u => u.UserId == _userInfo.Id))
.WhereIf(count > 0, t => t.DoctorDicRelationList.Count(u => guidList.Contains(u.DictionaryId)) == count)
.WhereIf(selectionQuery.EnrollStatus != null && selectionQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.WhereIf(inQuery.EnrollStatus != null && inQuery.EnrollStatus == (int)ReviewerEnrollStatus.Yes, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
.ProjectTo<SelectionReviewerDTO>(_mapper.ConfigurationProvider);
var result = await query.ToPagedListAsync(selectionQuery.PageIndex, selectionQuery.PageSize, selectionQuery.SortField == string.Empty ? "ReviewerCode" : selectionQuery.SortField, selectionQuery.Asc);
var result = await query.ToPagedListAsync(inQuery);
//是否已申请 申请时间 申请人
var doctorStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == selectionQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
var doctorStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
result.CurrentPageData.ToList().ForEach(doctor =>
@@ -130,24 +130,24 @@ namespace IRaCIS.Application.Services
/// </summary>
[HttpPost]
public async Task<PageOutput<ConfirmationReviewerDTO>> GetSubmissionOrApprovalReviewerList(
ReviewerSubmissionQueryDTO param)
ReviewerSubmissionQueryDTO inQuery)
{
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == param.TrialId)
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == inQuery.TrialId)
//提交CRO 以及下载简历列表
.WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus >= EnrollStatus.HasApplyDownloadResume)
.WhereIf(inQuery.IntoGroupSearchState == 1, t => t.EnrollStatus >= EnrollStatus.HasApplyDownloadResume)
//CRO确认列表 状态为 已提交CRO
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus >= EnrollStatus.HasCommittedToCRO)
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus >= EnrollStatus.HasCommittedToCRO)
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider);
var doctorPageList = await doctorQuery.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == "" ? "Code" : param.SortField, param.Asc);
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId)
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId)
//提交CRO 以及下载简历列表
.WhereIf(param.IntoGroupSearchState == 1, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
.WhereIf(inQuery.IntoGroupSearchState == 1, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
//CRO确认列表 状态为 已提交CRO
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.InviteIntoGroup)
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.InviteIntoGroup)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
@@ -158,22 +158,22 @@ namespace IRaCIS.Application.Services
var opt = enrollStateList.FirstOrDefault(t => t.DoctorId == u.Id);
if (opt != null)
{
u.DoctorTrialState = param.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasCommittedToCRO : (int)EnrollStatus.InviteIntoGroup;
u.DoctorTrialState = inQuery.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasCommittedToCRO : (int)EnrollStatus.InviteIntoGroup;
u.OptTime = opt.OptTime;
u.OptUserName = opt.OptUserName;
}
else
{
u.DoctorTrialState = param.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasDownloadResume : (int)EnrollStatus.HasCommittedToCRO;
u.DoctorTrialState = inQuery.IntoGroupSearchState == 1 ? (int)EnrollStatus.HasDownloadResume : (int)EnrollStatus.HasCommittedToCRO;
}
});
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM)
{
//SPM 要看到提交的时间 提交人
var enrollCommitList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId)
var enrollCommitList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId)
//提交CRO 以及下载简历列表
.WhereIf(param.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
.WhereIf(inQuery.IntoGroupSearchState == 4, t => t.EnrollStatus == EnrollStatus.HasCommittedToCRO)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
@@ -237,16 +237,16 @@ namespace IRaCIS.Application.Services
/// </summary>
[HttpPost]
public async Task<PageOutput<ConfirmationReviewerDTO>> GetConfirmationReviewerList(
ReviewerConfirmationQueryDTO param)
ReviewerConfirmationQueryDTO inQuery)
{
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == param.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
var doctorQuery = _repository.Where<Enroll>(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider);
var doctorPageList = await doctorQuery.ToPagedListAsync(param.PageIndex, param.PageSize, param.SortField == "" ? "Code" : param.SortField, param.Asc);
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == param.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
var enrollStateList = await _repository.Where<EnrollDetail>(x => x.TrialId == inQuery.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
@@ -72,7 +72,7 @@ namespace IRaCIS.Application.Services
var query = _vacationRepository.Where(u => u.DoctorId == doctorId)
.ProjectTo<VacationCommand>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(pageIndex, pageSize, "StartDate");
return await query.ToPagedListAsync(new PageInput() { PageIndex = pageIndex,PageSize=pageSize },nameof(VacationCommand.StartDate));
}