แก้ defect
This commit is contained in:
parent
bd1a77c1a2
commit
89a88c92dc
4 changed files with 53 additions and 5 deletions
|
|
@ -891,6 +891,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetLeaveRequestForAdminByIdAsync(Guid id)
|
||||
{
|
||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||
|
||||
var rawData = await _leaveRequestRepository.GetByIdAsync(id);
|
||||
|
||||
var thisYear = DateTime.Now.Year;
|
||||
|
|
@ -923,6 +925,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
approver = list.First().Name;
|
||||
}
|
||||
|
||||
var leaveSummary = await _leaveRequestRepository.GetSumApproveLeaveByTypeForUserAsync(userId, rawData.Type.Id, thisYear);
|
||||
|
||||
var result = new GetLeaveRequestForAdminByIdDto
|
||||
{
|
||||
Id = rawData.Id,
|
||||
|
|
@ -993,6 +997,10 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
Dear = approver,
|
||||
ApproveStep = rawData.ApproveStep ?? "-",
|
||||
|
||||
LeaveLimit = rawData.Type.Limit,
|
||||
LeaveSummary = leaveSummary,
|
||||
LeaveRemain = rawData.Type.Limit - leaveSummary
|
||||
};
|
||||
|
||||
return Success(result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue