fix 支持搜索name,idno,no
This commit is contained in:
@@ -87,15 +87,16 @@ public class AppointmentsController : ControllerBase
|
|||||||
/// 门禁预约
|
/// 门禁预约
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="factory"></param>
|
/// <param name="factory"></param>
|
||||||
|
/// <param name="search"></param>
|
||||||
/// <param name="status"></param>
|
/// <param name="status"></param>
|
||||||
/// <param name="start"></param>
|
/// <param name="start"></param>
|
||||||
/// <param name="end"></param>
|
/// <param name="end"></param>
|
||||||
/// <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, string search, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end)
|
||||||
{
|
{
|
||||||
return await _appointmentService.GetRecordListAsync(factory, status, start, end);
|
return await _appointmentService.GetRecordListAsync(factory, search, status, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -42,11 +42,12 @@ public interface IAppointmentService : IScopeDependency
|
|||||||
/// 获取记录列表
|
/// 获取记录列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="factory"></param>
|
/// <param name="factory"></param>
|
||||||
|
/// <param name="search"></param>
|
||||||
/// <param name="status"></param>
|
/// <param name="status"></param>
|
||||||
/// <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, string search, VisitorAppointmentDetailStatusEnumType? status, DateTime start, DateTime end);
|
||||||
|
|
||||||
Task<Pagination<AppointmentDetailResponse>> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request);
|
Task<Pagination<AppointmentDetailResponse>> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request);
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ 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, string search, 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)
|
||||||
@@ -214,6 +214,7 @@ public class AppointmentService : IAppointmentService
|
|||||||
.Where(x => x.IsEnterDoorArea)
|
.Where(x => x.IsEnterDoorArea)
|
||||||
.WhereIF(status.HasValue, x => x.DoorStatus == status)
|
.WhereIF(status.HasValue, x => x.DoorStatus == status)
|
||||||
.Where(x => x.DoorStart >= start && x.DoorEnd <= end)
|
.Where(x => x.DoorStart >= start && x.DoorEnd <= end)
|
||||||
|
.WhereIF(search.IsPresent(), x => x.Name.Contains(search) || x.No == search || x.IdNo == search)
|
||||||
.Select(x => new AppointmentDetailResponse
|
.Select(x => new AppointmentDetailResponse
|
||||||
{
|
{
|
||||||
No = x.No,
|
No = x.No,
|
||||||
|
|||||||
Reference in New Issue
Block a user