Add Get Pending Job
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m17s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 2m17s
This commit is contained in:
parent
a2fe424b87
commit
019a0a1be1
2 changed files with 29 additions and 0 deletions
|
|
@ -64,6 +64,17 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<CheckInJobStatus>> GetPendingOrProcessingJobsByDateAsync(DateTime date)
|
||||||
|
{
|
||||||
|
var data = await _dbContext.Set<CheckInJobStatus>()
|
||||||
|
.Where(x => x.CreatedDate.Date == date.Date &&
|
||||||
|
(x.Status == "PENDING" || x.Status == "PROCESSING"))
|
||||||
|
.OrderByDescending(x => x.CreatedDate)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// อัปเดตสถานะเป็น Processing
|
/// อัปเดตสถานะเป็น Processing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,24 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
|
|
||||||
#region " Check-In Check-Out ลงเวลา "
|
#region " Check-In Check-Out ลงเวลา "
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ดึงข้อมูลงานที่ยังไม่ได้ process หรือ ไม่เสร็จ ย้อนหลังจากเวลาปัจจุบันไปกี่นาที
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="timeoutMinutes">เวลาที่ต้องการย้อนหลังไปที่นาที default = 30</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("pending-jobs/{timeoutMinutes:int}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetPendingJobByDateAsync(int timeoutMinutes = 30)
|
||||||
|
{
|
||||||
|
var data = await _checkInJobStatusRepository.GetStalePendingOrProcessingJobsAsync(timeoutMinutes);
|
||||||
|
return Success(data);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// LV1_006 - เช็คเวลาต้องลงเวลาเข้าหรือออกงาน (USER)
|
/// LV1_006 - เช็คเวลาต้องลงเวลาเข้าหรือออกงาน (USER)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue