Add GetTimeStampHistoryAsync2 method for fiscal year timestamp retrieval
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
This commit is contained in:
parent
4562029e6e
commit
6902236f48
2 changed files with 14 additions and 1 deletions
|
|
@ -227,6 +227,19 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<ProcessUserTimeStamp>> GetTimeStampHistoryAsync2(Guid keycloakId, int year)
|
||||||
|
{
|
||||||
|
var fiscalDateStart = new DateTime(year - 1, 10, 1);
|
||||||
|
var fiscalDateEnd = new DateTime(year, 9, 30);
|
||||||
|
|
||||||
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
.Where(u => u.KeycloakUserId == keycloakId)
|
||||||
|
.Where(u => u.CheckIn.Date >= fiscalDateStart && u.CheckIn.Date <= fiscalDateEnd)
|
||||||
|
.OrderByDescending(u => u.CheckIn.Date)
|
||||||
|
.ToListAsync();
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<int> GetTimeStampHistoryForAdminCountAsync(DateTime startDate, DateTime endDate)
|
public async Task<int> GetTimeStampHistoryForAdminCountAsync(DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
var data = await _dbContext.Set<ProcessUserTimeStamp>()
|
||||||
|
|
|
||||||
|
|
@ -1762,7 +1762,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
// var test = await _processUserTimeStampRepository.GetTimeStampHistoryAsync(userId, year);
|
// var test = await _processUserTimeStampRepository.GetTimeStampHistoryAsync(userId, year);
|
||||||
// return Success(test);
|
// return Success(test);
|
||||||
|
|
||||||
var data = (await _processUserTimeStampRepository.GetTimeStampHistoryAsync(userId, year, page, pageSize, keyword))
|
var data = (await _processUserTimeStampRepository.GetTimeStampHistoryAsync2(userId, year))
|
||||||
.Select(d => new CheckInHistoryDto
|
.Select(d => new CheckInHistoryDto
|
||||||
{
|
{
|
||||||
CheckInId = d.Id,
|
CheckInId = d.Id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue