cronjob + ลงเวลากรณีพิเดศษ
This commit is contained in:
parent
72f64728bb
commit
e76d994098
16 changed files with 1518 additions and 9 deletions
|
|
@ -5,6 +5,7 @@ using BMA.EHR.Domain.Common;
|
|||
using BMA.EHR.Domain.Models.Leave.TimeAttendants;
|
||||
using BMA.EHR.Domain.Shared;
|
||||
using BMA.EHR.Infrastructure.Persistence;
|
||||
using BMA.EHR.Leave.Service.DTOs.AdditionalCheck;
|
||||
using BMA.EHR.Leave.Service.DTOs.ChangeRound;
|
||||
using BMA.EHR.Leave.Service.DTOs.CheckIn;
|
||||
using BMA.EHR.Leave.Service.DTOs.DutyTime;
|
||||
|
|
@ -38,6 +39,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
private readonly MinIOService _minIOService;
|
||||
private readonly ProcessUserTimeStampRepository _processUserTimeStampRepository;
|
||||
private readonly UserDutyTimeRepository _userDutyTimeRepository;
|
||||
private readonly AdditionalCheckRequestRepository _additionalCheckRequestRepository;
|
||||
|
||||
private readonly string _bucketName = "check-in";
|
||||
|
||||
|
|
@ -54,7 +56,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
UserTimeStampRepository userTimeStampRepository,
|
||||
MinIOService minIOService,
|
||||
ProcessUserTimeStampRepository processUserTimeStampRepository,
|
||||
UserDutyTimeRepository userDutyTimeRepository)
|
||||
UserDutyTimeRepository userDutyTimeRepository,
|
||||
AdditionalCheckRequestRepository additionalCheckRequestRepository)
|
||||
{
|
||||
_dutyTimeRepository = dutyTimeRepository;
|
||||
_context = context;
|
||||
|
|
@ -66,6 +69,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
_minIOService = minIOService;
|
||||
_processUserTimeStampRepository = processUserTimeStampRepository;
|
||||
_userDutyTimeRepository = userDutyTimeRepository;
|
||||
_additionalCheckRequestRepository = additionalCheckRequestRepository;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -714,7 +718,6 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<ResponseObject>> SearchProfileAsync([FromBody] SearchProfileDto req)
|
||||
{
|
||||
var profile = await _userProfileRepository.SearchProfile(req.CitizenId, req.FirstName, req.LastName);
|
||||
|
|
@ -798,7 +801,6 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<ResponseObject>> GetChangeRoundHistoryByProfileIdAsync(Guid id, int page = 1, int pageSize = 10, string keyword = "")
|
||||
{
|
||||
var data = await _userDutyTimeRepository.GetListByProfileIdAsync(id);
|
||||
|
|
@ -829,6 +831,41 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region " ขอลงเวลาเป็นกรณีพิเศษ "
|
||||
|
||||
/// <summary>
|
||||
/// LV1_017 - เพิ่มลงเวลากรณีพิเศษ (USER)
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("user/edit")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> CreateAdditionalCheckRequestAsync([FromBody] CreateAdditionalCheckRequestDto req)
|
||||
{
|
||||
if (req.CheckDate.Date > DateTime.Now.Date)
|
||||
{
|
||||
return Error("ไม่สามารถขอลงเวลากรณีพิเศษในวันที่มากกว่าวันที่ปัจจุบันได้", (int)StatusCodes.Status400BadRequest);
|
||||
}
|
||||
|
||||
var request = new AdditionalCheckRequest
|
||||
{
|
||||
KeycloakUserId = UserId != null ? Guid.Parse(UserId) : Guid.Empty,
|
||||
CheckDate = req.CheckDate,
|
||||
CheckInEdit = req.CheckInEdit,
|
||||
CheckOutEdit = req.CheckOutEdit,
|
||||
Description = req.Description,
|
||||
};
|
||||
await _additionalCheckRequestRepository.AddAsync(request);
|
||||
return Success();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue