This commit is contained in:
parent
3882e11454
commit
e028dc5cf5
1 changed files with 24 additions and 24 deletions
|
|
@ -808,7 +808,7 @@ 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)
|
||||
|
|
@ -822,27 +822,27 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
var duty = userRound ?? defaultRound;
|
||||
|
||||
/* var processTimeStamps = timeStamps
|
||||
.Select(d => new
|
||||
{
|
||||
d.Id,
|
||||
CheckInStatus = DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||
"LATE" :
|
||||
"NORMAL",
|
||||
CheckOutStatus = d.CheckOut == null ? "" :
|
||||
DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||
"LATE" :
|
||||
DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
|
||||
"ABSENT" :
|
||||
"NORMAL",
|
||||
});*/
|
||||
/* var processTimeStamps = timeStamps
|
||||
.Select(d => new
|
||||
{
|
||||
d.Id,
|
||||
CheckInStatus = DateTime.Parse(d.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
|
||||
"LATE" :
|
||||
"NORMAL",
|
||||
CheckOutStatus = d.CheckOut == null ? "" :
|
||||
DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||
DateTime.Parse($"{d.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
|
||||
"LATE" :
|
||||
DateTime.Parse(d.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
|
||||
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 =>
|
||||
|
|
@ -949,8 +949,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var profile = new List<GetProfileByKeycloakIdRootDto>();
|
||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficerRetireFilter(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.isRetirement??true);
|
||||
|
||||
profile = await _userProfileRepository.GetProfileWithKeycloakAllOfficerRetireFilter(AccessToken, req.node, req.nodeId, jsonData["result"] == "OWNER" || jsonData["result"] == "CHILD", req.isRetirement ?? true);
|
||||
|
||||
// get leave day
|
||||
var leaveDays = await _leaveRequestRepository.GetSumApproveLeaveByTypeAndRange(req.StartDate, req.EndDate);
|
||||
var leaveTypes = await _leaveTypeRepository.GetAllAsync();
|
||||
|
|
@ -1154,8 +1154,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
for (DateTime i = req.StartDate.Date; i <= req.EndDate.Date; i = i.AddDays(1))
|
||||
{
|
||||
if (!excludeDates.Contains(i))
|
||||
dateList.Add(i);
|
||||
// if (!excludeDates.Contains(i))
|
||||
dateList.Add(i);
|
||||
}
|
||||
|
||||
var employees = new List<dynamic>();
|
||||
|
|
@ -1227,7 +1227,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
if (timeStamps.CheckOut != null)
|
||||
{
|
||||
if (timeStamps.CheckOutStatus == "ABSENT")
|
||||
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckOut ? $" (นอกสถานที่:{ timeStamps.CheckOutLocationName })".Trim() : "") ;
|
||||
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckOut ? $" (นอกสถานที่:{timeStamps.CheckOutLocationName})".Trim() : "");
|
||||
else if (timeStamps.CheckInStatus == "ABSENT")
|
||||
remarkStr = "ขาดราชการ" + (!timeStamps.IsLocationCheckIn ? $" (นอกสถานที่:{timeStamps.CheckInLocationName})".Trim() : "");
|
||||
else if (timeStamps.CheckInStatus == "LATE")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue