revert code
This commit is contained in:
parent
9f326f24fb
commit
c91d9d72c5
1 changed files with 1 additions and 33 deletions
|
|
@ -2644,44 +2644,12 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"Starting UpdateAsyncRecruitToPlacement for examId: {examId}, AccountStartDate: {req?.AccountStartDate}");
|
|
||||||
|
|
||||||
if (req == null)
|
|
||||||
{
|
|
||||||
_logger.LogError("RecruitDateRequest is null");
|
|
||||||
return Error("ข้อมูลคำขอไม่ถูกต้อง", StatusCodes.Status400BadRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (examId == Guid.Empty)
|
|
||||||
{
|
|
||||||
_logger.LogError("ExamId is empty");
|
|
||||||
return Error("รหัสการสอบไม่ถูกต้อง", StatusCodes.Status400BadRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
await _recruitService.UpdateAsyncRecruitToPlacement(examId, req.AccountStartDate);
|
await _recruitService.UpdateAsyncRecruitToPlacement(examId, req.AccountStartDate);
|
||||||
|
|
||||||
_logger.LogInformation($"Successfully completed UpdateAsyncRecruitToPlacement for examId: {examId}");
|
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
catch (ArgumentException argEx)
|
|
||||||
{
|
|
||||||
_logger.LogError(argEx, $"Argument error in UpdateAsyncRecruitToPlacement for examId: {examId}");
|
|
||||||
return Error($"ข้อมูลไม่ถูกต้อง: {argEx.Message}", StatusCodes.Status400BadRequest);
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException opEx)
|
|
||||||
{
|
|
||||||
_logger.LogError(opEx, $"Invalid operation in UpdateAsyncRecruitToPlacement for examId: {examId}");
|
|
||||||
return Error($"การดำเนินการไม่ถูกต้อง: {opEx.Message}", StatusCodes.Status422UnprocessableEntity);
|
|
||||||
}
|
|
||||||
catch (TimeoutException timeEx)
|
|
||||||
{
|
|
||||||
_logger.LogError(timeEx, $"Timeout in UpdateAsyncRecruitToPlacement for examId: {examId}");
|
|
||||||
return Error("การดำเนินการใช้เวลานานเกินไป กรุณาลองใหม่อีกครั้ง", StatusCodes.Status408RequestTimeout);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, $"Unexpected error in UpdateAsyncRecruitToPlacement for examId: {examId}, Message: {ex.Message}, StackTrace: {ex.StackTrace}");
|
return Error(ex);
|
||||||
return Error($"เกิดข้อผิดพลาดในการโอนคนแข่งขันไปบรรจุ: {ex.Message}", StatusCodes.Status500InternalServerError);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue