Uat_Study
he 2022-06-13 12:02:08 +08:00
parent 36542adb19
commit 931f51583d
1 changed files with 4 additions and 3 deletions

View File

@ -154,7 +154,7 @@ namespace IRaCIS.Application.Services
.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.Status != null, x => x.Status == dto.Status) .WhereIf(dto.Status != null, x => x.Status == dto.Status)
.WhereIf(dto.Name != null, x => x.Name.Contains(x.Name)).OrderBy(x => x.SiteCode); .WhereIf(dto.Name != null, x => x.Name.Contains(dto.Name)).OrderBy(x => x.SiteCode);
var subjectIds = await subjectQuery.Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync(); var subjectIds = await subjectQuery.Select(x => x.SubjectId).Distinct().Skip((dto.PageIndex - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
List<ReadModuleView> ReadModuleViewList = await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).ToListAsync(); List<ReadModuleView> ReadModuleViewList = await subjectQuery.Where(x => subjectIds.Contains(x.SubjectId)).ToListAsync();
@ -407,8 +407,9 @@ namespace IRaCIS.Application.Services
{ {
var visitQuery = _subjectVisitRepository.Where(x => x.SubjectId == dto.SubjectId); var visitQuery = _subjectVisitRepository.Where(x => x.SubjectId == dto.SubjectId);
visitQuery = visitQuery.WhereIf(dto.ExpirationDate != null, x => x.LatestScanDate <= dto.ExpirationDate.Value) visitQuery = visitQuery
.WhereIf(dto.ExpirationVisitNum != null, x => x.VisitNum <= dto.ExpirationVisitNum.Value); //.WhereIf(dto.ExpirationDate != null, x => x.LatestScanDate <= dto.ExpirationDate.Value)
.WhereIf(dto.ExpirationVisitNum != null, x => x.VisitNum == dto.ExpirationVisitNum.Value);
var visit = visitQuery.OrderByDescending(x => x.VisitNum).FirstOrDefault(); var visit = visitQuery.OrderByDescending(x => x.VisitNum).FirstOrDefault();
if (visit != null) if (visit != null)