fix again
Some checks failed
release-dev / release-dev (push) Failing after 11s

This commit is contained in:
Suphonchai Phoonsawat 2025-06-17 14:19:52 +07:00
parent 9070378060
commit 360580535a

View file

@ -2329,18 +2329,20 @@ namespace BMA.EHR.Leave.Service.Controllers
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
//var checkInData = await _userTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate);
var checkInData = await _processUserTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate);
var checkInData = await _userTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate);
//var checkInData = await _processUserTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate);
var duty = userRound ?? getDefaultRound;
DateTime? resultCheckInDate, resultCheckOutDate;
DateTime? resultCheckInDate, resultCheckOutDate, resultCheckInDateAndTime, resultCheckOutDateAndTime;
string resultCheckInTime, resultCheckOutTime;
string resultCheckInLocation = "", resultCheckOutLocation = "";
if (data.CheckInEdit)
{
resultCheckInDate = data.CheckDate.Date;
resultCheckInTime = duty.StartTimeMorning;
resultCheckInLocation = data.POI ?? "";
}
else
{
@ -2352,6 +2354,7 @@ namespace BMA.EHR.Leave.Service.Controllers
{
resultCheckOutDate = data.CheckDate.Date;
resultCheckOutTime = duty.EndTimeAfternoon;
resultCheckOutLocation = data.POI ?? "";
}
else
{
@ -2365,6 +2368,11 @@ namespace BMA.EHR.Leave.Service.Controllers
}
resultCheckInDateAndTime = DateTime.Parse($"{resultCheckInDate.Value.Date.ToString("yyyy-MM-dd")} {resultCheckInTime}");
resultCheckOutDateAndTime = DateTime.Parse($"{resultCheckOutDate.Value.Date.ToString("yyyy-MM-dd")} {resultCheckOutTime}");
// create result object to return
var resObj = new GetAdditionalCheckRequestHistoryDto
{
@ -2376,27 +2384,30 @@ namespace BMA.EHR.Leave.Service.Controllers
CheckInTime = resultCheckInTime,
CheckOutTime = resultCheckOutTime,
CheckInStatus = checkInData == null ? null :
DateTime.Parse(checkInData.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
DateTime.Parse($"{checkInData.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
DateTime.Parse(checkInData.CheckIn.ToString("yyyy-MM-dd HH:mm")) >
DateTime.Parse($"{checkInData.CheckIn.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
CheckInStatus = resultCheckInDateAndTime == null ? null :
DateTime.Parse(resultCheckInDateAndTime.Value.ToString("yyyy-MM-dd HH:mm")) >
DateTime.Parse($"{resultCheckInDate.Value.Date.ToString("yyyy-MM-dd")} {duty.StartTimeMorning}") ?
DateTime.Parse(resultCheckInDateAndTime.Value.ToString("yyyy-MM-dd HH:mm")) >
DateTime.Parse($"{resultCheckInDate.Value.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
"ABSENT" :
"LATE" :
"NORMAL",
CheckOutStatus = checkInData == null ? null :
checkInData.CheckOut == null ? null :
DateTime.Parse(checkInData.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
DateTime.Parse($"{checkInData.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
CheckOutStatus = resultCheckInDate == null ? null :
resultCheckOutDate == null ? null :
DateTime.Parse(resultCheckOutDateAndTime.Value.ToString("yyyy-MM-dd HH:mm")) <
DateTime.Parse($"{resultCheckInDate.Value.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ?
"ABSENT" :
DateTime.Parse(checkInData.CheckOut.Value.ToString("yyyy-MM-dd HH:mm")) <
DateTime.Parse($"{checkInData.CheckIn.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
DateTime.Parse(resultCheckOutDateAndTime.Value.ToString("yyyy-MM-dd HH:mm")) <
DateTime.Parse($"{resultCheckInDate.Value.Date.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ?
"ABSENT" :
"NORMAL",
CheckInLocation = checkInData == null ? "" : checkInData.CheckInPOI,
CheckOutLocation = checkInData == null ? "" : checkInData.CheckOutPOI ?? "",
//CheckInLocation = checkInData == null ? "" : checkInData.CheckInPOI,
//CheckOutLocation = checkInData == null ? "" : checkInData.CheckOutPOI ?? "",
CheckInLocation = resultCheckInLocation,
CheckOutLocation = resultCheckOutLocation,
EditReason = data.Comment ?? "",
EditStatus = data.Status,