维护历史分页列表传递参数
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
@@ -26,11 +26,11 @@ namespace IRaCIS.Core.Application.Service.Inspection
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto dto)
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto inQuery)
{
//_repository.GetQueryable.GetQueryable < DataInspection >
var trialData = await _repository.GetQueryable<Trial>().Where(x => x.Id == dto.TrialId).AsNoTracking().FirstNotNullAsync();
var trialData = await _repository.GetQueryable<Trial>().Where(x => x.Id == inQuery.TrialId).AsNoTracking().FirstNotNullAsync();
trialData.TrialFinishTime = trialData.TrialFinishTime == null ? DateTime.Now : trialData.TrialFinishTime;
@@ -164,9 +164,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
TrialReadingCriterionName = data.TrialReadingCriterion.CriterionName
};
query = query.WhereIf(dto.TrialSiteId != null, x => x.TrialSiteId == dto.TrialSiteId)
query = query.WhereIf(inQuery.TrialSiteId != null, x => x.TrialSiteId == inQuery.TrialSiteId)
//.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime))
.Where(x => x.TrialId == dto.TrialId )
.Where(x => x.TrialId == inQuery.TrialId )
#region
// .WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId)
@@ -183,36 +183,36 @@ namespace IRaCIS.Core.Application.Service.Inspection
// x.ObjectRelationParentId == dto.GeneralId //父稽查 查询子记录
// ) && x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)))
#endregion
.WhereIf(dto.BatchId != null, x => x.BatchId == dto.BatchId)
.WhereIf(dto.BatchId == null && dto.GeneralId != null, x => x.GeneralId == dto.GeneralId)
.WhereIf(dto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == dto.TrialReadingCriterionId)
.WhereIf(inQuery.BatchId != null, x => x.BatchId == inQuery.BatchId)
.WhereIf(inQuery.BatchId == null && inQuery.GeneralId != null, x => x.GeneralId == inQuery.GeneralId)
.WhereIf(inQuery.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
.WhereIf(!dto.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(dto.TaskName) || x.BlindName.Contains(dto.TaskName))
.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
.WhereIf(!dto.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(dto.RoleName))
.WhereIf(!inQuery.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(inQuery.TaskName) || x.BlindName.Contains(inQuery.TaskName))
.WhereIf(!inQuery.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(inQuery.SubjectInfo))
.WhereIf(!inQuery.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(inQuery.RoleName))
//.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo)
//.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false)
.WhereIf(dto.StartTime != null, x => x.CreateTime >= dto.StartTime)
.WhereIf(dto.EndTime != null, x => x.CreateTime <= dto.EndTime)
.WhereIf(dto.ModuleType != null, x => x.ModuleTypeId == dto.ModuleType)
.WhereIf(!dto.Description.IsNullOrEmpty(), x => x.Description.Contains(dto.Description)|| x.DescriptionCN.Contains(dto.Description))
.WhereIf(!dto.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.OpByUserName))
.WhereIf(!dto.CreateUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.CreateUserName) || x.CreateUserRealName.Contains(dto.CreateUserName))
.WhereIf(inQuery.StartTime != null, x => x.CreateTime >= inQuery.StartTime)
.WhereIf(inQuery.EndTime != null, x => x.CreateTime <= inQuery.EndTime)
.WhereIf(inQuery.ModuleType != null, x => x.ModuleTypeId == inQuery.ModuleType)
.WhereIf(!inQuery.Description.IsNullOrEmpty(), x => x.Description.Contains(inQuery.Description)|| x.DescriptionCN.Contains(inQuery.Description))
.WhereIf(!inQuery.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.OpByUserName))
.WhereIf(!inQuery.CreateUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.CreateUserName) || x.CreateUserRealName.Contains(inQuery.CreateUserName))
//.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
.WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign);
.WhereIf(inQuery.IsSign != null, x => x.IsSign == inQuery.IsSign);
#endregion
if (dto.VisitPlanInfo != null && dto.VisitPlanInfo.Value != (decimal)1.11)
if (inQuery.VisitPlanInfo != null && inQuery.VisitPlanInfo.Value != (decimal)1.11)
{
query = query.Where(x => x.VisitNum == dto.VisitPlanInfo.Value);
query = query.Where(x => x.VisitNum == inQuery.VisitPlanInfo.Value);
}
else if (dto.VisitPlanInfo != null)
else if (inQuery.VisitPlanInfo != null)
{
query = query.Where(x => x.InPlan == false);
}
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, dto.SortField.IsNullOrEmpty() ? nameof(GetDataInspectionOutDto.CreateTime) : dto.SortField, dto.Asc);
return await query.ToPagedListAsync(inQuery, nameof(GetDataInspectionOutDto.CreateTime) );
}