This commit is contained in:
parent
28f8971e7f
commit
4b43104400
11 changed files with 22046 additions and 8 deletions
|
|
@ -318,6 +318,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.CancelReason,
|
||||
p.IsActive,
|
||||
p.CreatedAt,
|
||||
p.ApproveStep,
|
||||
p.Group,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
|
|
@ -599,6 +601,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.IsNoBurden,
|
||||
p.IsDiscipline,
|
||||
p.CancelReason,
|
||||
p.ApproveStep,
|
||||
p.Group,
|
||||
Approvers = p.Approvers.Where(x => x.ApproveType.ToUpper() == "APPROVER"),
|
||||
Commanders = p.Approvers.Where(x => x.ApproveType.ToUpper() == "COMMANDER"),
|
||||
KeycloakUserId = p.CreatedUserId,
|
||||
|
|
@ -685,6 +689,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
data.idMain,
|
||||
data.statusMain,
|
||||
data.KeycloakUserId,
|
||||
data.ApproveStep,
|
||||
data.Group,
|
||||
data.Approvers,
|
||||
data.Commanders,
|
||||
statusCancel = data.Status,
|
||||
|
|
@ -781,6 +787,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.IsNoBurden,
|
||||
p.IsDiscipline,
|
||||
p.CancelReason,
|
||||
p.ApproveStep,
|
||||
p.Group,
|
||||
Approvers = p.Approvers.Where(x => x.ApproveType.ToUpper() == "APPROVER"),
|
||||
Commanders = p.Approvers.Where(x => x.ApproveType.ToUpper() == "COMMANDER"),
|
||||
KeycloakUserId = p.CreatedUserId,
|
||||
idMain = p.RetirementResign.Id,
|
||||
statusMain = p.RetirementResign.Status,
|
||||
RetirementResignDocs = p.RetirementResign.RetirementResignDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
|
|
@ -863,6 +874,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
data.CancelReason,
|
||||
data.idMain,
|
||||
data.statusMain,
|
||||
data.KeycloakUserId,
|
||||
data.ApproveStep,
|
||||
data.Group,
|
||||
data.Approvers,
|
||||
data.Commanders,
|
||||
Docs = retirementResignDocs,
|
||||
};
|
||||
return Success(_data);
|
||||
|
|
@ -1195,6 +1211,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
{
|
||||
var retirementResignCancel = new RetirementResignCancel
|
||||
{
|
||||
ApproveStep = "st1",
|
||||
Group = updated.Group,
|
||||
Location = updated.Location,
|
||||
SendDate = updated.SendDate,
|
||||
ActiveDate = updated.ActiveDate,
|
||||
|
|
@ -2797,6 +2815,169 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// LV2_013 - เจ้าหน้าที่อนุมัติการลา (ADMIN)
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("admin-cancel/approve/officer/{id:guid}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> OfficerApproveRetirementResignCancelAsync(Guid id)
|
||||
{
|
||||
// var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_LIST");
|
||||
// var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
// if (jsonData["status"]?.ToString() != "200")
|
||||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.OfficerApproveRetirementResignCancel(id);
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LV2_015 - ผู้บังคับบัญชาอนุมัติการลา(ADMIN)
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("admin-cancel/approve/comander/{id:guid}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> CommanderApproveRetirementResignCancelAsync(Guid id,
|
||||
[FromBody] RetirementRequestApproveDto req)
|
||||
{
|
||||
try
|
||||
{
|
||||
// var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_LIST");
|
||||
// var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
// if (jsonData["status"]?.ToString() != "200")
|
||||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.CommanderApproveRetirementResignCancel(id, req.Reason ?? "", null);
|
||||
|
||||
return Success();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ผู้บังคับบัญชาไม่อนุมัติการลา(ADMIN)
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("admin-cancel/reject/comander/{id:guid}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> CommanderRejectRetirementResignCancelAsync(Guid id,
|
||||
[FromBody] RetirementRequestApproveDto req)
|
||||
{
|
||||
try
|
||||
{
|
||||
// var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_LIST");
|
||||
// var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
// if (jsonData["status"]?.ToString() != "200")
|
||||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.CommanderRejectRetirementResignCancel(id, req.Reason ?? "", req.Date);
|
||||
|
||||
return Success();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LV2_016 - ผู้มีอำนาจอนุมัติการลา (ADMIN)
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("admin-cancel/approve/{id:guid}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> ApproveRetirementResignCancelAsync(Guid id,
|
||||
[FromBody] RetirementRequestApproveDto req)
|
||||
{
|
||||
try
|
||||
{
|
||||
// var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_LIST");
|
||||
// var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
// if (jsonData["status"]?.ToString() != "200")
|
||||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.ApproveRetirementResignCancel(id, req.Reason ?? "", null);
|
||||
|
||||
return Success();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LV2_017 - ผู้มีอำนาจไม่อนุมัติการลา (ADMIN)
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// </returns>
|
||||
/// <response code="200">เมื่อทำรายการสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("admin-cancel/reject/{id:guid}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> RejectRetirementResignCancelAsync(Guid id,
|
||||
[FromBody] RetirementRequestApproveDto req)
|
||||
{
|
||||
try
|
||||
{
|
||||
// var getPermission = await _permission.GetPermissionAPIAsync("UPDATE", "SYS_LEAVE_LIST");
|
||||
// var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
// if (jsonData["status"]?.ToString() != "200")
|
||||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.RejectRetirementResignCancel(id, req.Reason ?? "", req.Date);
|
||||
|
||||
return Success();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue