This commit is contained in:
parent
0cb17540b0
commit
71a1c48392
2 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue