This commit is contained in:
parent
9e513d3f1a
commit
8c530d9769
1 changed files with 12 additions and 8 deletions
|
|
@ -16,6 +16,7 @@ using Swashbuckle.AspNetCore.Annotations;
|
|||
using System.Globalization;
|
||||
using System.Security.Claims;
|
||||
using BMA.EHR.Application.Responses.Profiles;
|
||||
using Microsoft.OpenApi.Any;
|
||||
|
||||
namespace BMA.EHR.Leave.Service.Controllers
|
||||
{
|
||||
|
|
@ -807,16 +808,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
var therapyDay = leaveDays.FirstOrDefault(x => x.KeycloakUserId == keycloakUserId && x.LeaveTypeCode == "LV-011");
|
||||
var therapyDayCount = therapyDay != null ? therapyDay.SumLeaveDay : 0;
|
||||
|
||||
var timeStamps = await _processUserTimeStampRepository.GetTimeStampHistoryByRangeForUserAsync(p.Keycloak ?? Guid.Empty,
|
||||
req.StartDate,
|
||||
req.EndDate);
|
||||
var timeStamps = await _processUserTimeStampRepository.GetTimeStampHistoryByRangeForUserAsync(p.Keycloak ?? Guid.Empty,req.StartDate,req.EndDate);
|
||||
|
||||
var defaultRound = await _dutyTimeRepository.GetDefaultAsync();
|
||||
if (defaultRound == null)
|
||||
{
|
||||
return Error("ไม่พบรอบการลงเวลา Default", StatusCodes.Status404NotFound);
|
||||
}
|
||||
|
||||
//var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
|
||||
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(p.Id);
|
||||
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
|
||||
|
|
@ -824,7 +822,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var duty = userRound ?? defaultRound;
|
||||
|
||||
var processTimeStamps = timeStamps
|
||||
/* var processTimeStamps = timeStamps
|
||||
.Select(d => new
|
||||
{
|
||||
d.Id,
|
||||
|
|
@ -840,10 +838,16 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
|
||||
"ABSENT" :
|
||||
"NORMAL",
|
||||
});
|
||||
});*/
|
||||
|
||||
/*var absentCount = processTimeStamps.Count(x => x.CheckOutStatus == "ABSENT");
|
||||
var lateCount = processTimeStamps.Count(x => x.CheckInStatus == "LATE");*/
|
||||
|
||||
var absentCount = timeStamps.Count(d =>
|
||||
d.CheckOutStatus == "ABSENT"); // นับจำนวนที่มี CheckOutStatus == "ABSENT"
|
||||
var lateCount = timeStamps.Count(d =>
|
||||
d.CheckInStatus == "LATE"); // นับจำนวนที่มี CheckInStatus == "LATE"
|
||||
|
||||
var absentCount = processTimeStamps.Count(x => x.CheckOutStatus == "ABSENT");
|
||||
var lateCount = processTimeStamps.Count(x => x.CheckInStatus == "LATE");
|
||||
|
||||
var emp = new
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue