refix issue #1265
Some checks failed
release-dev / release-dev (push) Failing after 12s

This commit is contained in:
Suphonchai Phoonsawat 2025-03-21 13:01:17 +07:00
parent 0cb17540b0
commit 71a1c48392
2 changed files with 10 additions and 3 deletions

View file

@ -16,6 +16,7 @@ using BMA.EHR.Leave.Service.DTOs.DutyTime;
using BMA.EHR.Leave.Service.DTOs.LeaveRequest;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.ObjectPool;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@ -1767,9 +1768,17 @@ namespace BMA.EHR.Leave.Service.Controllers
var duty = userRound ?? getDefaultRound;
var lastCheckIn = await _context.Set<UserTimeStamp>()
.Where(u => u.KeycloakUserId == userId)
.Where(d => d.CheckOut == null)
.OrderByDescending(u => u.CheckIn)
.FirstOrDefaultAsync();
var endTime = DateTime.Parse($"{DateTime.Now.Date.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}");
var status = time < endTime ? "ABSENT" : "NORMAL";
var status = lastCheckIn == null ? "ABSENT" : lastCheckIn.CheckIn.Date < DateTime.Now.Date ? "NORMAL" : time < endTime ? "ABSENT" : "NORMAL";
return Success(new
{

View file

@ -1,9 +1,7 @@
{
"realm": "hrms",
"auth-server-url": "https://id.frappet.synology.me",
//"auth-server-url": "https://hrms-id.bangkok.go.th",
"ssl-required": "external",
"resource": "bma-ehr",
//"resource": "hrms",
"public-client": true
}