แก้ defet
ลงเวลาเข้า-ออกปฏิบัติงาน (เช็คเอ้าท์ออกงานไม่ได้)#220 การลา >> ประเภทลา ลาพักผ่อน (ลาซ้ำ)#361
This commit is contained in:
parent
01309ceceb
commit
305d2d9dc5
3 changed files with 31 additions and 3 deletions
|
|
@ -114,6 +114,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
public async Task<ActionResult<ResponseObject>> CreateLeaveRequestAsync([FromForm] CreateLeaveRequestDto req)
|
||||
{
|
||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||
|
||||
var isDuplicate = await _leaveRequestRepository.CheckDuplicateLeave(userId, req.LeaveStartDate.Date, req.LeaveEndDate.Date);
|
||||
if (isDuplicate)
|
||||
{
|
||||
return Error("ไม่สามารถขอลาในช่วงเวลาเดียวกันได้");
|
||||
}
|
||||
|
||||
var thisYear = DateTime.Now.Year;
|
||||
|
||||
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId);
|
||||
|
|
@ -327,11 +334,15 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
return Error(GlobalMessages.DataNotFound);
|
||||
}
|
||||
|
||||
|
||||
|
||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||
var thisYear = DateTime.Now.Year;
|
||||
|
||||
var isDuplicate = await _leaveRequestRepository.CheckDuplicateLeave(userId, req.LeaveStartDate.Date, req.LeaveEndDate.Date);
|
||||
if (isDuplicate)
|
||||
{
|
||||
return Error("ไม่สามารถขอลาในช่วงเวลาเดียวกันได้");
|
||||
}
|
||||
|
||||
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId);
|
||||
|
||||
if (profile == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue