This commit is contained in:
parent
28f8971e7f
commit
4b43104400
11 changed files with 22046 additions and 8 deletions
|
|
@ -256,6 +256,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.CancelReason,
|
||||
p.IsActive,
|
||||
p.CreatedAt,
|
||||
p.ApproveStep,
|
||||
p.Group,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
|
|
@ -537,6 +539,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
p.IsNoDebt,
|
||||
p.IsNoBurden,
|
||||
p.IsDiscipline,
|
||||
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,
|
||||
|
|
@ -622,6 +626,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
data.CancelReason,
|
||||
data.idMain,
|
||||
data.statusMain,
|
||||
data.ApproveStep,
|
||||
data.Group,
|
||||
data.KeycloakUserId,
|
||||
data.Approvers,
|
||||
data.Commanders,
|
||||
|
|
@ -719,6 +725,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.RetirementResignEmployee.Id,
|
||||
statusMain = p.RetirementResignEmployee.Status,
|
||||
RetirementResignEmployeeDocs = p.RetirementResignEmployee.RetirementResignEmployeeDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
|
|
@ -801,6 +812,11 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
data.CancelReason,
|
||||
data.idMain,
|
||||
data.statusMain,
|
||||
data.KeycloakUserId,
|
||||
data.ApproveStep,
|
||||
data.Group,
|
||||
data.Approvers,
|
||||
data.Commanders,
|
||||
Docs = retirementResignEmployeeDocs,
|
||||
};
|
||||
return Success(_data);
|
||||
|
|
@ -1101,6 +1117,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
{
|
||||
var retirementResignEmployeeCancel = new RetirementResignEmployeeCancel
|
||||
{
|
||||
ApproveStep = "st1",
|
||||
Group = updated.Group,
|
||||
Location = updated.Location,
|
||||
SendDate = updated.SendDate,
|
||||
ActiveDate = updated.ActiveDate,
|
||||
|
|
@ -2080,7 +2098,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.CommanderApproveRetirementResignEmployee(id, req.Reason ?? "", req.Date ?? DateTime.Now);
|
||||
await _repository.CommanderApproveRetirementResignEmployee(id, req.Reason ?? "", null);
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2114,7 +2132,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.CommanderRejectRetirementResignEmployee(id, req.Reason ?? "", req.Date ?? DateTime.Now);
|
||||
await _repository.CommanderRejectRetirementResignEmployee(id, req.Reason ?? "", req.Date);
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2148,7 +2166,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.ApproveRetirementResignEmployee(id, req.Reason ?? "", req.Date ?? DateTime.Now);
|
||||
await _repository.ApproveRetirementResignEmployee(id, req.Reason ?? "", null);
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2182,7 +2200,170 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
// {
|
||||
// return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
// }
|
||||
await _repository.RejectRetirementResignEmployee(id, req.Reason ?? "", req.Date ?? DateTime.Now);
|
||||
await _repository.RejectRetirementResignEmployee(id, req.Reason ?? "", req.Date);
|
||||
|
||||
return Success();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <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>> OfficerApproveRetirementResignEmployeeCancelAsync(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.OfficerApproveRetirementResignEmployeeCancel(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>> CommanderApproveRetirementResignEmployeeCancelAsync(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.CommanderApproveRetirementResignEmployeeCancel(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>> CommanderRejectRetirementResignEmployeeCancelAsync(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.CommanderRejectRetirementResignEmployeeCancel(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>> ApproveRetirementResignEmployeeCancelAsync(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.ApproveRetirementResignEmployeeCancel(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>> RejectRetirementResignEmployeeCancelAsync(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.RejectRetirementResignEmployeeCancel(id, req.Reason ?? "", req.Date);
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue