fix 增加可查询所有door记录
This commit is contained in:
@@ -93,7 +93,7 @@ public class AppointmentsController : ControllerBase
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpGet("door/list")]
|
[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);
|
return await _appointmentService.GetRecordListAsync(factory, status, start, end);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public interface IAppointmentService : IScopeDependency
|
|||||||
/// <param name="start"></param>
|
/// <param name="start"></param>
|
||||||
/// <param name="end"></param>
|
/// <param name="end"></param>
|
||||||
/// <returns></returns>
|
/// <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);
|
Task<Pagination<AppointmentDetailResponse>> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request);
|
||||||
|
|
||||||
|
|||||||
@@ -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>()
|
return await _dbContext.Queryable<VisitorAppointmentDetailEntity>()
|
||||||
.LeftJoin<GainfoEntity>((x, ga) => ga.IdNo == x.IdNo)
|
.LeftJoin<GainfoEntity>((x, ga) => ga.IdNo == x.IdNo)
|
||||||
.Where(x => SqlFunc.Subqueryable<VisitorAppointmentEntity>().Where(p => p.Factory == factory).Any())
|
.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)
|
.Where(x => x.DoorStart >= start && x.DoorEnd <= end)
|
||||||
.Select(x => new AppointmentDetailResponse
|
.Select(x => new AppointmentDetailResponse
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user