fix 增加可查询所有door记录

This commit is contained in:
2024-11-21 17:22:13 +08:00
parent 471df07386
commit 3dd6e27128
3 changed files with 5 additions and 4 deletions

View File

@@ -93,7 +93,7 @@ public class AppointmentsController : ControllerBase
/// <returns></returns>
[AllowAnonymous]
[HttpGet("door/list")]
public async Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType status, DateTime start, DateTime end)
public async Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end)
{
return await _appointmentService.GetRecordListAsync(factory, status, start, end);
}

View File

@@ -46,7 +46,7 @@ public interface IAppointmentService : IScopeDependency
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType status, DateTime start, DateTime end);
Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end);
Task<Pagination<AppointmentDetailResponse>> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request);

View File

@@ -206,12 +206,13 @@ public class AppointmentService : IAppointmentService
}
public async Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType status, DateTime start, DateTime end)
public async Task<List<AppointmentDetailResponse>> GetRecordListAsync(string factory, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end)
{
return await _dbContext.Queryable<VisitorAppointmentDetailEntity>()
.LeftJoin<GainfoEntity>((x, ga) => ga.IdNo == x.IdNo)
.Where(x => SqlFunc.Subqueryable<VisitorAppointmentEntity>().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
{