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 {