From 3dd6e271288b180e1f4758b126a8e80f2299abfd Mon Sep 17 00:00:00 2001 From: liguoyang Date: Thu, 21 Nov 2024 17:22:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A2=9E=E5=8A=A0=E5=8F=AF=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=89=80=E6=9C=89door=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Appointment/Controllers/AppointmentsController.cs | 2 +- Src/Dlhis.Basic/Appointment/Services/IAppointmentService.cs | 2 +- .../Appointment/Services/Implements/AppointmentService.cs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Src/Dlhis.Basic/Appointment/Controllers/AppointmentsController.cs b/Src/Dlhis.Basic/Appointment/Controllers/AppointmentsController.cs index a5780b10..6ec5f3fa 100644 --- a/Src/Dlhis.Basic/Appointment/Controllers/AppointmentsController.cs +++ b/Src/Dlhis.Basic/Appointment/Controllers/AppointmentsController.cs @@ -93,7 +93,7 @@ public class AppointmentsController : ControllerBase /// [AllowAnonymous] [HttpGet("door/list")] - public async Task> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType status, DateTime start, DateTime end) + public async Task> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end) { return await _appointmentService.GetRecordListAsync(factory, status, start, end); } diff --git a/Src/Dlhis.Basic/Appointment/Services/IAppointmentService.cs b/Src/Dlhis.Basic/Appointment/Services/IAppointmentService.cs index bb3c49e8..a4858b75 100644 --- a/Src/Dlhis.Basic/Appointment/Services/IAppointmentService.cs +++ b/Src/Dlhis.Basic/Appointment/Services/IAppointmentService.cs @@ -46,7 +46,7 @@ public interface IAppointmentService : IScopeDependency /// /// /// - Task> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType status, DateTime start, DateTime end); + Task> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end); Task> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request); diff --git a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs index a3052191..6ae7d27d 100644 --- a/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs +++ b/Src/Dlhis.Basic/Appointment/Services/Implements/AppointmentService.cs @@ -206,12 +206,13 @@ public class AppointmentService : IAppointmentService } - public async Task> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType status, DateTime start, DateTime end) + public async Task> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end) { return await _dbContext.Queryable() .LeftJoin((x, ga) => ga.IdNo == x.IdNo) .Where(x => SqlFunc.Subqueryable().Where(p => p.Factory == factory).Any()) - .Where(x => x.IsEnterDoorArea && x.DoorStatus == status) + .Where(x => x.IsEnterDoorArea) + .WhereIF(status.HasValue, x => x.DoorStatus == status) .Where(x => x.DoorStart >= start && x.DoorEnd <= end) .Select(x => new AppointmentDetailResponse {