Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2025-05-15 06:40:41 +07:00
commit 9af97134f4
6 changed files with 31 additions and 23 deletions

View file

@ -137,7 +137,7 @@ namespace BMA.EHR.Application.Repositories
await _dbContext.SaveChangesAsync();
}
public async Task CommanderApproveRetirementResign(Guid id, string reason, DateTime date)
public async Task CommanderApproveRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
@ -220,7 +220,7 @@ namespace BMA.EHR.Application.Repositories
}
}
public async Task CommanderRejectRetirementResign(Guid id, string reason, DateTime date)
public async Task CommanderRejectRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
@ -307,7 +307,7 @@ namespace BMA.EHR.Application.Repositories
}
public async Task ApproveRetirementResign(Guid id, string reason, DateTime date)
public async Task ApproveRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
@ -387,7 +387,7 @@ namespace BMA.EHR.Application.Repositories
}
public async Task RejectRetirementResign(Guid id, string reason, DateTime date)
public async Task RejectRetirementResign(Guid id, string reason, DateTime? date)
{
// Get UserId from token
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);

View file

@ -289,8 +289,8 @@ namespace BMA.EHR.Insignia.Service.Controllers
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("{insigniaPeriodId:length(36)}/{ocId:length(36)}/{role}/{status}")]
public async Task<ActionResult<ResponseObject>> GetInsignaiRequestBkk(Guid insigniaPeriodId, Guid ocId, string role, string status)
[HttpGet("{insigniaPeriodId:length(36)}/{ocId:length(36)}/{role}/{status}/{isDeputy}")]
public async Task<ActionResult<ResponseObject>> GetInsignaiRequestBkk(Guid insigniaPeriodId, Guid ocId, string role, string status, bool isDeputy)
{
var result = await _repository.GetInsigniaRequest(insigniaPeriodId, ocId);
if (result != null)
@ -315,7 +315,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
Items = new List<InsigniaRequestItem>()
};
GetIsOfficerDto RoleInsignia = await _userProfileRepository.GetIsOfficerRootAsync(AccessToken, "SYS_INSIGNIA_MANAGE");
if (RoleInsignia.isOfficer == true && result.RequestStatus != "st6")
if (RoleInsignia.isOfficer == true && isDeputy == false && result.RequestStatus != "st6")
return Success(resend);
if (RoleInsignia.isDirector == true && (result.RequestStatus == "st1" || result.RequestStatus == "st2"))
return Success(resend);

View file

@ -355,8 +355,12 @@ namespace BMA.EHR.Leave.Service.Controllers
// if (list.Count > 0)
// approver = list.First().Name;
//}
if (data != null && data.LeaveSubTypeName == "ลาประกอบพิธีฮัจญ์" && isHajj == false)
{
isHajj = true;
}
if (data.HajjDayStatus == true)
if (isHajj == true)
{
return new
{

View file

@ -411,7 +411,7 @@ namespace BMA.EHR.Leave.Service.Controllers
// add dear and oc_data
//var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
var approver = profile.Commander ?? "";
// var approver = profile.Commander ?? "";
var userOc = profile.Root ?? "";
//if (rootOc != null)
//{
@ -422,8 +422,8 @@ namespace BMA.EHR.Leave.Service.Controllers
leaveRequest.LeaveTypeCode = leaveType.Code;
leaveRequest.Dear = approver;
leaveRequest.CommanderPosition = profile.CommanderPositionName ?? "";
leaveRequest.Dear = req.Commander ?? "";
leaveRequest.CommanderPosition = req.CommanderPositionName ?? "";
// เพิ่มตำแหน่ง
//leaveRequest.CommanderPosition = req.CommanderPosition ?? "";
@ -934,12 +934,12 @@ namespace BMA.EHR.Leave.Service.Controllers
SalaryText = lastSalary == null ? "" : lastSalary.Amount == null ? "" : ((int)lastSalary.Amount.Value).ToThaiBahtText(false),
LeaveLast = leaveLast == null ? null : leaveLast,
TelephoneNumber = profile.TelephoneNumber ?? "-",
CurrentAddress = profile.CurrentAddress ?? "-",
CurrentSubDistrict = profile.CurrentSubDistrict ?? "-",
CurrentDistrict = profile.CurrentDistrict ?? "-",
CurrentProvince = profile.CurrentProvince ?? "-",
CurrentZipCode = profile.CurrentZipCode ?? "-",
TelephoneNumber = profile.TelephoneNumber ?? "",
CurrentAddress = profile.CurrentAddress ?? "",
CurrentSubDistrict = profile.CurrentSubDistrict ?? "",
CurrentDistrict = profile.CurrentDistrict ?? "",
CurrentProvince = profile.CurrentProvince ?? "",
CurrentZipCode = profile.CurrentZipCode ?? "",
};
return Success(result);
@ -1772,7 +1772,7 @@ namespace BMA.EHR.Leave.Service.Controllers
else if (role == "ROOT")
{
nodeId = profileAdmin?.RootDnaId;
}
}
var rawData =
await _leaveRequestRepository.GetCancelLeaveRequestForAdminAsync(req.Year, req.Type, req.Status, role, nodeId, profileAdmin?.Node);

View file

@ -102,7 +102,11 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest
public DateTime? CoupleDayEndDateHistory { get; set; }
public string? CoupleDaySumTotalHistory { get; set; }
public string? Commander { get; set; }
public string? CommanderPositionName { get; set; }
}
}

View file

@ -2663,7 +2663,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
// {
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
// }
await _repository.CommanderApproveRetirementResign(id, req.Reason ?? "", req.Date ?? DateTime.Now);
await _repository.CommanderApproveRetirementResign(id, req.Reason ?? "", null);
return Success();
}
@ -2697,7 +2697,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
// {
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
// }
await _repository.CommanderRejectRetirementResign(id, req.Reason ?? "", req.Date ?? DateTime.Now);
await _repository.CommanderRejectRetirementResign(id, req.Reason ?? "", req.Date);
return Success();
}
@ -2731,7 +2731,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
// {
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
// }
await _repository.ApproveRetirementResign(id, req.Reason ?? "", req.Date ?? DateTime.Now);
await _repository.ApproveRetirementResign(id, req.Reason ?? "", null);
return Success();
}
@ -2765,7 +2765,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
// {
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
// }
await _repository.RejectRetirementResign(id, req.Reason ?? "", req.Date ?? DateTime.Now);
await _repository.RejectRetirementResign(id, req.Reason ?? "", req.Date);
return Success();
}