fix defect
This commit is contained in:
parent
21b8c0450c
commit
fadb544566
6 changed files with 494 additions and 19 deletions
|
|
@ -33,7 +33,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
private readonly UserProfileRepository _userProfileRepository;
|
||||
private readonly LeaveTypeRepository _leaveTypeRepository;
|
||||
private readonly LeaveRequestRepository _leaveRequestRepository;
|
||||
private readonly MinIOService _minIOService;
|
||||
private readonly MinIOLeaveService _minIOService;
|
||||
private readonly HolidayRepository _holidayRepository;
|
||||
|
||||
#endregion
|
||||
|
|
@ -47,7 +47,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
UserProfileRepository userProfileRepository,
|
||||
LeaveTypeRepository leaveTypeRepository,
|
||||
LeaveRequestRepository leaveRequestRepository,
|
||||
MinIOService minIOService,
|
||||
MinIOLeaveService minIOService,
|
||||
HolidayRepository holidayRepository)
|
||||
{
|
||||
_context = context;
|
||||
|
|
@ -362,8 +362,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetLeaveRequestCalendarAsync([FromBody] GetLeaveRequestCalendarDto req)
|
||||
{
|
||||
var thisYear = DateTime.Now.Year;
|
||||
var data = await _leaveRequestRepository.GetLeaveRequestByYearAsync(thisYear);
|
||||
//var thisYear = DateTime.Now.Year;
|
||||
var data = await _leaveRequestRepository.GetLeaveRequestByYearAsync(req.Year);
|
||||
|
||||
var result = new List<GetLeaveRequestCalendarResultDto>();
|
||||
|
||||
|
|
@ -627,6 +627,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
// save to database
|
||||
await _leaveRequestRepository.UpdateAsync(data);
|
||||
|
||||
// await _leaveRequestRepository.AddAsync(data);
|
||||
|
||||
return Success();
|
||||
|
||||
}
|
||||
|
|
@ -708,14 +710,14 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
Id = rawData.Id,
|
||||
LeaveTypeName = rawData.Type.Name,
|
||||
FullName = $"{profile.Prefix.Name}{profile.FirstName} {profile.LastName}",
|
||||
Status = rawData.LeaveCancelStatus,
|
||||
Status = rawData.LeaveCancelStatus ?? "",
|
||||
LeaveStartDate = rawData.LeaveStartDate,
|
||||
LeaveEndDate = rawData.LeaveEndDate,
|
||||
LeaveWrote = rawData.LeaveWrote,
|
||||
LeaveWrote = rawData.CancelLeaveWrote ?? rawData.LeaveWrote,
|
||||
LeaveAddress = rawData.LeaveAddress,
|
||||
LeaveNumber = rawData.LeaveNumber,
|
||||
LeaveDetail = rawData.LeaveDetail,
|
||||
LeaveDocDelete = await _minIOService.ImagesPath(rawData.LeaveCancelDocument.Id),
|
||||
LeaveDocDelete = rawData.LeaveCancelDocument == null ? "" : await _minIOService.ImagesPath(rawData.LeaveCancelDocument.Id),
|
||||
LeaveReasonDelete = rawData.LeaveCancelComment ?? "",
|
||||
LeaveTotal = rawData.LeaveTotal,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue