修改模块列表

Uat_Study
hang 2022-10-11 17:52:31 +08:00
parent 8a2d88d52d
commit 0610193b04
2 changed files with 5 additions and 6 deletions

View File

@ -40,8 +40,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public string? Name { get; set; } public string? Name { get; set; }
[NotDefault]
public Guid? TrialReadingCriterionId { get; set; } public Guid TrialReadingCriterionId { get; set; }
} }

View File

@ -76,15 +76,14 @@ namespace IRaCIS.Application.Services
#region MyRegion #region MyRegion
dto.SortField = dto.SortField.IsNullOrEmpty() ? nameof(ReadModuleView.TrialSiteCode) : dto.SortField; dto.SortField = dto.SortField.IsNullOrEmpty() ? nameof(ReadModuleView.TrialSiteCode) : dto.SortField;
dto.SortField = dto.Asc ? dto.SortField : dto.SortField + " desc"; dto.SortField = dto.Asc ? dto.SortField : dto.SortField + " desc";
var subjectQuery = _readModuleViewRepository.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId) var subjectQuery = _readModuleViewRepository.Where(x => x.TrialReadingCriterionId == dto.TrialReadingCriterionId)
.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
.WhereIf(dto.SubjectId != null, x => x.SubjectId == dto.SubjectId) .WhereIf(dto.SubjectId != null, x => x.SubjectId == dto.SubjectId)
.WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode != string.Empty, x => x.TrialSiteCode == dto.TrialSiteCode) .WhereIf(dto.TrialSiteCode != null && dto.TrialSiteCode != string.Empty, x => x.TrialSiteCode == dto.TrialSiteCode)
.WhereIf(dto.SubjectCode != null && dto.SubjectCode != string.Empty, x => x.SubjectCode == dto.SubjectCode) .WhereIf(dto.SubjectCode != null && dto.SubjectCode != string.Empty, x => x.SubjectCode == dto.SubjectCode)
.WhereIf(dto.ModuleType != null, x => x.ModuleType == dto.ModuleType) .WhereIf(dto.ModuleType != null, x => x.ModuleType == dto.ModuleType)
.WhereIf(dto.ReadingStatus != null, x => x.ReadingStatus == dto.ReadingStatus) .WhereIf(dto.ReadingStatus != null, x => x.ReadingStatus == dto.ReadingStatus)
.WhereIf(dto.Name != null, x => x.Name.Contains(dto.Name!)).OrderBy(x => x.SiteCode) .WhereIf(dto.Name != null, x => x.Name.Contains(dto.Name!)).OrderBy(x => x.SiteCode);
/*.WhereIf(dto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId== dto.TrialReadingCriterionId)*/;
var subjectIds = await subjectQuery.OrderBy(dto.SortField).Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync(); var subjectIds = await subjectQuery.OrderBy(dto.SortField).Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();