From 931f51583d279687c5246aa0794e5b2776a79576 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 13 Jun 2022 12:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/ReadModuleService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs index 944ae2eed..76d075abc 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs @@ -154,7 +154,7 @@ namespace IRaCIS.Application.Services .WhereIf(dto.SubjectCode != null && dto.SubjectCode != String.Empty, x => x.SubjectCode == dto.SubjectCode) .WhereIf(dto.ModuleType != null, x => x.ModuleType == dto.ModuleType) .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(); List 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); - visitQuery = visitQuery.WhereIf(dto.ExpirationDate != null, x => x.LatestScanDate <= dto.ExpirationDate.Value) - .WhereIf(dto.ExpirationVisitNum != null, x => x.VisitNum <= dto.ExpirationVisitNum.Value); + visitQuery = visitQuery + //.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(); if (visit != null)