fix: api ลงเวลากรณีพิเศษ

This commit is contained in:
Suphonchai Phoonsawat 2024-07-12 14:01:49 +07:00
parent 1a6fe487aa
commit 1960f243d0

View file

@ -1213,20 +1213,22 @@ namespace BMA.EHR.Leave.Service.Controllers
foreach (var data in rawData) foreach (var data in rawData)
{ {
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(data.KeycloakUserId, AccessToken); // var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(data.KeycloakUserId, AccessToken);
if (profile == null) // if (profile == null)
{ // {
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); // return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
} // }
//var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty); //var userRound = await _dutyTimeRepository.GetByIdAsync(profile.DutyTimeId ?? Guid.Empty);
var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(profile.Id); //var effectiveDate = await _userDutyTimeRepository.GetLastEffectRound(profile.Id);
var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty; //var roundId = effectiveDate != null ? effectiveDate.DutyTimeId : Guid.Empty;
var userRound = await _dutyTimeRepository.GetByIdAsync(roundId); //var userRound = await _dutyTimeRepository.GetByIdAsync(roundId);
var checkInData = await _userTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate); var checkInData = await _userTimeStampRepository.GetTimestampByDateAsync(data.KeycloakUserId, data.CheckDate);
var duty = userRound ?? getDefaultRound; //var duty = userRound ?? getDefaultRound;
var duty = getDefaultRound;
// create result object to return // create result object to return
var resObj = new GetAdditionalCheckRequestDto var resObj = new GetAdditionalCheckRequestDto