Merge branch 'develop-Bright' into develop

This commit is contained in:
Bright 2024-09-02 15:20:26 +07:00
commit 0151704cd5
2 changed files with 7 additions and 2 deletions

View file

@ -40,6 +40,7 @@ namespace BMA.EHR.Application.Responses.Profiles
public string? Gender { get; set; } public string? Gender { get; set; }
public string? ProfileType { get; set; } public string? ProfileType { get; set; }
public bool? IsLeave { get; set; }
} }

View file

@ -1062,6 +1062,10 @@ namespace BMA.EHR.Leave.Service.Controllers
{ {
//var profile = await _userProfileRepository.SearchProfile(null, null, null); //var profile = await _userProfileRepository.SearchProfile(null, null, null);
var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken); var profile = await _userProfileRepository.GetProfileWithKeycloak(AccessToken);
if(profile.Count > 0)
{
profile = profile.Where(p => p.IsLeave == false).ToList();
}
var date = req.StartDate.Date; var date = req.StartDate.Date;
var holidays = await _holidayRepository.GetHolidayAsync(req.StartDate.Date, req.EndDate.Date); var holidays = await _holidayRepository.GetHolidayAsync(req.StartDate.Date, req.EndDate.Date);
@ -1206,9 +1210,9 @@ namespace BMA.EHR.Leave.Service.Controllers
workTotal += 1; workTotal += 1;
if (!timeStamps.IsLocationCheckIn) if (!timeStamps.IsLocationCheckIn)
{ {
if(timeStamps.CheckInLocationName!.Contains("ปฏิบัติงานที่บ้าน")) if(timeStamps.CheckInLocationName == "ปฏิบัติงานที่บ้าน")
wfhTotal += 1; wfhTotal += 1;
else if (timeStamps.CheckInLocationName!.Contains("ประชุม")) else if (timeStamps.CheckInLocationName == "ไปประชุม/อบรม/สัมมนา/ปฏิบัติงานที่บ้านนอกสถานที่")
seminarTotal += 1; seminarTotal += 1;
} }