admin แก้ไขสมัครสอบคัดเลือก
This commit is contained in:
parent
0273a37503
commit
ae60457a3e
6 changed files with 986 additions and 289 deletions
|
|
@ -306,6 +306,33 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// อัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <param name="candidateInformation">ข้อมูลส่วนตัว</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำการอัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร สำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("{candidateId:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> UpdateAdminAsync(string candidateId, CandidateResponseItem candidateInformation)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _candidateService.UpdateAdminAsync(candidateId, candidateInformation);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// อัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร
|
/// อัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -446,34 +473,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// สร้างข้อมูล ประวัติการศีกษา ผู้สมัคร
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="examId">รหัสรอบสมัคร</param>
|
|
||||||
/// <param name="positionId">Id ตำแหน่งสมัครสอบ</param>
|
|
||||||
/// <param name="candidateEducation">ข้อมูลประวัติการศีกษา</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200">เมื่อทำการสร้างข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpPost("education/{examId:length(36)}/{positionId:length(36)}")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
|
||||||
public async Task<ActionResult<ResponseObject>> CreateAsyncEducation(string examId, string positionId, CandidateEducationResponseItem candidateEducation)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _candidateService.CreateAsyncEducation(examId, positionId, candidateEducation);
|
|
||||||
|
|
||||||
return Success();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
return Error(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// อัพเดทข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร
|
/// อัพเดทข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -528,6 +527,34 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// สร้างข้อมูล ประวัติการศีกษา ผู้สมัคร
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="examId">รหัสรอบสมัคร</param>
|
||||||
|
/// <param name="positionId">Id ตำแหน่งสมัครสอบ</param>
|
||||||
|
/// <param name="candidateEducation">ข้อมูลประวัติการศีกษา</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำการสร้างข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("education/{examId:length(36)}/{positionId:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> CreateAsyncEducation(string examId, string positionId, CandidateEducationResponseItem candidateEducation)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _candidateService.CreateAsyncEducation(examId, positionId, candidateEducation);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// อัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร
|
/// อัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -582,6 +609,61 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// สร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <param name="candidateCareer">ข้อมูลประวัติการทำงาน/ฝึกงาน</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำการสร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("career/{candidateId:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> CreateAsyncAdminCareer(string candidateId, CandidateCareerResponseItem candidateCareer)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _candidateService.CreateAsyncAdminCareer(candidateId, candidateCareer);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// สร้างข้อมูล ประวัติการศีกษา ผู้สมัคร
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <param name="candidateEducation">ข้อมูลประวัติการศีกษา</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำการสร้างข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("education/{candidateId:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> CreateAsyncAdminEducation(string candidateId, CandidateEducationResponseItem candidateEducation)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _candidateService.CreateAsyncAdminEducation(candidateId, candidateEducation);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ผู้สมัครทำการสมัครสอบ
|
/// ผู้สมัครทำการสมัครสอบ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -766,6 +848,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// get id รูปถ่าย
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อ get id รูปถ่ายสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("profile-image/{candidateId:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetsAsyncAdminProfileImage(string candidateId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var path = await _candidateService.GetsAsyncAdminProfileImage(candidateId);
|
||||||
|
|
||||||
|
return Success(GlobalMessages.Success, path);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// อัปโหลดรูปถ่ายผู้สมัคร
|
/// อัปโหลดรูปถ่ายผู้สมัคร
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -802,6 +910,41 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// อัปโหลดรูปถ่ายผู้สมัคร
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่ออัปโหลดรูปถ่ายผู้สมัครสำเร็จ</response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPut("profile-image/{candidateId:length(36)}"), DisableRequestSizeLimit]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<ActionResult<ResponseObject>> UpdateAsyncAdminProfileImage(string candidateId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Request.Form.Files == null || Request.Form.Files.Count == 0)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.NoFileToUpload);
|
||||||
|
}
|
||||||
|
|
||||||
|
var file = Request.Form.Files[0];
|
||||||
|
await _candidateService.UpdateAsyncAdminProfileImage(candidateId, file);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// get id หลักฐานชำระ
|
/// get id หลักฐานชำระ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -986,6 +1129,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ลบเอกสารหลักฐาน
|
/// ลบเอกสารหลักฐาน
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="examId">รหัสรอบสมัคร</param>
|
||||||
|
/// <param name="positionId">Id ตำแหน่งสมัครสอบ</param>
|
||||||
/// <param name="documentId">รหัสไฟล์เอกสาร</param>
|
/// <param name="documentId">รหัสไฟล์เอกสาร</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <response code="200">เมื่อลบเอกสารหลักฐานสำเร็จ</response>
|
/// <response code="200">เมื่อลบเอกสารหลักฐานสำเร็จ</response>
|
||||||
|
|
@ -1008,6 +1153,90 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// list เอกสารหลักฐาน
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อ list เอกสารหลักฐานสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("upload/{candidateId:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetsAsyncAdminFileUpload(string candidateId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var doc = await _candidateService.GetsAsyncAdminFileUpload(candidateId);
|
||||||
|
|
||||||
|
return Success(doc);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// อัปโหลดเอกสารหลักฐาน
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่ออัปโหลดเอกสารหลักฐานสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPut("upload/{candidateId:length(36)}"), DisableRequestSizeLimit]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> UpdateAsyncAdminDocument(string candidateId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Request.Form.Files == null || Request.Form.Files.Count == 0)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.NoFileToUpload);
|
||||||
|
}
|
||||||
|
|
||||||
|
var file = Request.Form.Files[0];
|
||||||
|
await _candidateService.UpdateAsyncAdminDocument(candidateId, file);
|
||||||
|
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ลบเอกสารหลักฐาน
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <param name="documentId">รหัสไฟล์เอกสาร</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อลบเอกสารหลักฐานสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpDelete("upload/{candidateId:length(36)}"), DisableRequestSizeLimit]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> DeleteAsyncAdminDocument(string candidateId, string documentId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _candidateService.DeleteAsyncAdminDocument(candidateId, documentId);
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// โหลดไฟล์
|
/// โหลดไฟล์
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1065,6 +1294,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
return Error(ex);
|
return Error(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ใบสมัครสอบ
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidateId">รหัสผู้สมัคร</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำการใบสมัครสอบ สำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("card/{candidateId:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetsAsyncAdminCardCandidate(string candidateId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var items = await _candidateService.GetsAsyncAdminCardCandidate(candidateId);
|
||||||
|
|
||||||
|
return Success(items);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -518,6 +518,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// get id รูปถ่าย
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="candidate">รหัสรอบสมัคร</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อ get id รูปถ่ายสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("profile-image/{candidate:length(36)}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> GetsAsyncProfileImage(string candidate)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var path = await _periodExamService.GetsAsyncProfileImage(candidate);
|
||||||
|
|
||||||
|
return Success(GlobalMessages.Success, path);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ข้อมูล เอกสาร ผู้สมัคร
|
/// ข้อมูล เอกสาร ผู้สมัคร
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -427,6 +427,38 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
return document;
|
return document;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<IEnumerable<FileListResponse?>> GetsAsyncAdminFileUpload(string candidateId)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||||
|
|
||||||
|
var document = await _context.CandidateDocuments.AsQueryable()
|
||||||
|
.Where(x => x.Candidate == candidate)
|
||||||
|
.OrderBy(x => x.CreatedAt)
|
||||||
|
.Select(x => new FileListResponse
|
||||||
|
{
|
||||||
|
Id = x.Document == null ? "" : x.Document.Id.ToString(),
|
||||||
|
FileName = x.Document == null ? "" : x.Document.FileName,
|
||||||
|
FileType = x.Document == null ? "" : x.Document.FileType,
|
||||||
|
FileSize = x.Document == null ? 0 : x.Document.FileSize,
|
||||||
|
Detail = x.Document == null ? "" : x.Document.Id.ToString(),
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
foreach (var item in document)
|
||||||
|
{
|
||||||
|
if (document[i].Detail != null && document[i].Detail != "")
|
||||||
|
document[i].Detail = _minioService.ImagesPath(Guid.Parse(document[i].Detail)).Result;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return document;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<string> GetsAsyncProfileImage(string examId, string positionId)
|
public async Task<string> GetsAsyncProfileImage(string examId, string positionId)
|
||||||
{
|
{
|
||||||
var exam = await _context.PeriodExams.AsQueryable()
|
var exam = await _context.PeriodExams.AsQueryable()
|
||||||
|
|
@ -463,6 +495,21 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
return candidate.ProfileImg == null ? "" : candidate.ProfileImg.Detail;
|
return candidate.ProfileImg == null ? "" : candidate.ProfileImg.Detail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<string> GetsAsyncAdminProfileImage(string candidateId)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.Include(x => x.ProfileImg)
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||||
|
|
||||||
|
if (candidate.ProfileImg != null)
|
||||||
|
candidate.ProfileImg.Detail = _minioService.ImagesPath(candidate.ProfileImg.Id).Result;
|
||||||
|
|
||||||
|
return candidate.ProfileImg == null ? "" : candidate.ProfileImg.Detail;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<PaymentImgResponse> GetsAsyncPaymentImg(string examId, string positionId)
|
public async Task<PaymentImgResponse> GetsAsyncPaymentImg(string examId, string positionId)
|
||||||
{
|
{
|
||||||
var exam = await _context.PeriodExams.AsQueryable()
|
var exam = await _context.PeriodExams.AsQueryable()
|
||||||
|
|
@ -815,6 +862,211 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAdminAsync(string candidateId, CandidateResponseItem updated)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.ExamNotFound);
|
||||||
|
|
||||||
|
if (updated.PrefixId != null)
|
||||||
|
{
|
||||||
|
var prefix = await _contextMetadata.Prefixes.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.PrefixId));
|
||||||
|
|
||||||
|
if (prefix == null)
|
||||||
|
throw new Exception(GlobalMessages.PrefixNotFound);
|
||||||
|
|
||||||
|
candidate.PrefixId = prefix.Id;
|
||||||
|
candidate.PrefixName = prefix.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.RelationshipId != null)
|
||||||
|
{
|
||||||
|
var relationship = await _contextMetadata.Relationships.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RelationshipId));
|
||||||
|
|
||||||
|
if (relationship == null)
|
||||||
|
throw new Exception(GlobalMessages.RelationshipNotFound);
|
||||||
|
|
||||||
|
candidate.RelationshipId = relationship.Id;
|
||||||
|
candidate.RelationshipName = relationship.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.CitizenProvinceId != null)
|
||||||
|
{
|
||||||
|
var citizenProvince = await _contextMetadata.Provinces.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenProvinceId));
|
||||||
|
|
||||||
|
if (citizenProvince == null)
|
||||||
|
throw new Exception(GlobalMessages.ProvinceNotFound);
|
||||||
|
|
||||||
|
candidate.CitizenProvinceId = citizenProvince.Id;
|
||||||
|
candidate.CitizenProvinceName = citizenProvince.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.CitizenDistrictId != null)
|
||||||
|
{
|
||||||
|
var citizenDistrict = await _contextMetadata.Districts.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenDistrictId));
|
||||||
|
|
||||||
|
if (citizenDistrict == null)
|
||||||
|
throw new Exception(GlobalMessages.DistrictNotFound);
|
||||||
|
|
||||||
|
candidate.CitizenDistrictId = citizenDistrict.Id;
|
||||||
|
candidate.CitizenDistrictName = citizenDistrict.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.RegistProvinceId != null)
|
||||||
|
{
|
||||||
|
var registProvince = await _contextMetadata.Provinces.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistProvinceId));
|
||||||
|
|
||||||
|
if (registProvince == null)
|
||||||
|
throw new Exception(GlobalMessages.ProvinceNotFound);
|
||||||
|
|
||||||
|
candidate.RegistProvinceId = registProvince.Id;
|
||||||
|
candidate.RegistProvinceName = registProvince.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.RegistDistrictId != null)
|
||||||
|
{
|
||||||
|
var registDistrict = await _contextMetadata.Districts.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistDistrictId));
|
||||||
|
|
||||||
|
if (registDistrict == null)
|
||||||
|
throw new Exception(GlobalMessages.DistrictNotFound);
|
||||||
|
|
||||||
|
candidate.RegistDistrictId = registDistrict.Id;
|
||||||
|
candidate.RegistDistrictName = registDistrict.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.RegistSubDistrictId != null)
|
||||||
|
{
|
||||||
|
var registSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistSubDistrictId));
|
||||||
|
|
||||||
|
if (registSubDistrict == null)
|
||||||
|
throw new Exception(GlobalMessages.SubDistrictNotFound);
|
||||||
|
|
||||||
|
candidate.RegistSubDistrictId = registSubDistrict.Id;
|
||||||
|
candidate.RegistSubDistrictName = registSubDistrict.Name;
|
||||||
|
candidate.RegistZipCode = registSubDistrict.ZipCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.CurrentProvinceId != null)
|
||||||
|
{
|
||||||
|
var currentProvince = await _contextMetadata.Provinces.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentProvinceId));
|
||||||
|
|
||||||
|
if (currentProvince == null)
|
||||||
|
throw new Exception(GlobalMessages.ProvinceNotFound);
|
||||||
|
|
||||||
|
candidate.CurrentProvinceId = currentProvince.Id;
|
||||||
|
candidate.CurrentProvinceName = currentProvince.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.CurrentDistrictId != null)
|
||||||
|
{
|
||||||
|
var currentDistrict = await _contextMetadata.Districts.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentDistrictId));
|
||||||
|
|
||||||
|
if (currentDistrict == null)
|
||||||
|
throw new Exception(GlobalMessages.DistrictNotFound);
|
||||||
|
|
||||||
|
candidate.CurrentDistrictId = currentDistrict.Id;
|
||||||
|
candidate.CurrentDistrictName = currentDistrict.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.CurrentSubDistrictId != null)
|
||||||
|
{
|
||||||
|
var currentSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentSubDistrictId));
|
||||||
|
|
||||||
|
if (currentSubDistrict == null)
|
||||||
|
throw new Exception(GlobalMessages.SubDistrictNotFound);
|
||||||
|
|
||||||
|
candidate.CurrentSubDistrictId = currentSubDistrict.Id;
|
||||||
|
candidate.CurrentSubDistrictName = currentSubDistrict.Name;
|
||||||
|
candidate.CurrentZipCode = currentSubDistrict.ZipCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.MarryPrefixId != null)
|
||||||
|
{
|
||||||
|
var prefix = await _contextMetadata.Prefixes.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MarryPrefixId));
|
||||||
|
|
||||||
|
if (prefix == null)
|
||||||
|
throw new Exception(GlobalMessages.PrefixNotFound);
|
||||||
|
|
||||||
|
candidate.MarryPrefixId = prefix.Id;
|
||||||
|
candidate.MarryPrefixName = prefix.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.FatherPrefixId != null)
|
||||||
|
{
|
||||||
|
var prefix = await _contextMetadata.Prefixes.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.FatherPrefixId));
|
||||||
|
|
||||||
|
if (prefix == null)
|
||||||
|
throw new Exception(GlobalMessages.PrefixNotFound);
|
||||||
|
|
||||||
|
candidate.FatherPrefixId = prefix.Id;
|
||||||
|
candidate.FatherPrefixName = prefix.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated.MotherPrefixId != null)
|
||||||
|
{
|
||||||
|
var prefix = await _contextMetadata.Prefixes.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MotherPrefixId));
|
||||||
|
|
||||||
|
if (prefix == null)
|
||||||
|
throw new Exception(GlobalMessages.PrefixNotFound);
|
||||||
|
|
||||||
|
candidate.MotherPrefixId = prefix.Id;
|
||||||
|
candidate.MotherPrefixName = prefix.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
candidate.FirstName = updated.FirstName;
|
||||||
|
candidate.LastName = updated.LastName;
|
||||||
|
candidate.Nationality = updated.Nationality;
|
||||||
|
candidate.DateOfBirth = updated.DateOfBirth;
|
||||||
|
candidate.Email = updated.Email;
|
||||||
|
candidate.CitizenId = updated.CitizenId;
|
||||||
|
candidate.CitizenDate = updated.CitizenDate;
|
||||||
|
candidate.Telephone = updated.Telephone;
|
||||||
|
candidate.MobilePhone = updated.MobilePhone;
|
||||||
|
candidate.Knowledge = updated.Knowledge;
|
||||||
|
|
||||||
|
candidate.RegistAddress = updated.RegistAddress;
|
||||||
|
candidate.RegistSame = updated.RegistSame == null ? null : updated.RegistSame;
|
||||||
|
candidate.CurrentAddress = updated.CurrentAddress;
|
||||||
|
|
||||||
|
candidate.Marry = updated.Marry == null ? null : updated.Marry;
|
||||||
|
candidate.MarryFirstName = updated.MarryFirstName;
|
||||||
|
candidate.MarryLastName = updated.MarryLastName;
|
||||||
|
candidate.MarryOccupation = updated.MarryOccupation;
|
||||||
|
candidate.MarryNationality = updated.MarryNationality;
|
||||||
|
candidate.FatherFirstName = updated.FatherFirstName;
|
||||||
|
candidate.FatherLastName = updated.FatherLastName;
|
||||||
|
candidate.FatherOccupation = updated.FatherOccupation;
|
||||||
|
candidate.FatherNationality = updated.FatherNationality;
|
||||||
|
candidate.MotherFirstName = updated.MotherFirstName;
|
||||||
|
candidate.MotherLastName = updated.MotherLastName;
|
||||||
|
candidate.MotherOccupation = updated.MotherOccupation;
|
||||||
|
candidate.MotherNationality = updated.MotherNationality;
|
||||||
|
|
||||||
|
candidate.OccupationType = updated.OccupationType;
|
||||||
|
candidate.OccupationCompany = updated.OccupationCompany;
|
||||||
|
candidate.OccupationDepartment = updated.OccupationDepartment;
|
||||||
|
candidate.OccupationEmail = updated.OccupationEmail;
|
||||||
|
candidate.OccupationTelephone = updated.OccupationTelephone;
|
||||||
|
candidate.OccupationPosition = updated.OccupationPosition;
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task UpdateAsyncInformation(string examId, string positionId, CandidateInformationResponseItem updated)
|
public async Task UpdateAsyncInformation(string examId, string positionId, CandidateInformationResponseItem updated)
|
||||||
{
|
{
|
||||||
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
||||||
|
|
@ -912,6 +1164,29 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsyncAdminProfileImage(string candidateId, IFormFile file)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.Include(x => x.ProfileImg)
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.ExamNotFound);
|
||||||
|
|
||||||
|
if (candidate.ProfileImg != null)
|
||||||
|
{
|
||||||
|
await DeleteDocument(candidate.ProfileImg.Id.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
var doc = await _minioService.UploadFileAsync(file);
|
||||||
|
|
||||||
|
var document = await _context.Documents.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == doc.Id);
|
||||||
|
|
||||||
|
candidate.ProfileImg = document;
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task UpdateAsyncAddress(string examId, string positionId, CandidateAddressResponseItem updated)
|
public async Task UpdateAsyncAddress(string examId, string positionId, CandidateAddressResponseItem updated)
|
||||||
{
|
{
|
||||||
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
||||||
|
|
@ -1114,6 +1389,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task UpdateAsyncAdminDocument(string candidateId, IFormFile file)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.ExamNotFound);
|
||||||
|
|
||||||
|
var doc = await _minioService.UploadFileAsync(file);
|
||||||
|
|
||||||
|
var document = await _context.Documents.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == doc.Id);
|
||||||
|
|
||||||
|
if (document == null)
|
||||||
|
throw new Exception(GlobalMessages.NoFileToUpload);
|
||||||
|
|
||||||
|
var candidateDocument = new CandidateDocument
|
||||||
|
{
|
||||||
|
Candidate = candidate,
|
||||||
|
Document = document,
|
||||||
|
};
|
||||||
|
|
||||||
|
await _context.CandidateDocuments.AddAsync(candidateDocument);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task DeleteDocument(string documentId)
|
public async Task DeleteDocument(string documentId)
|
||||||
{
|
{
|
||||||
await _minioService.DeleteFileAsync(Guid.Parse(documentId));
|
await _minioService.DeleteFileAsync(Guid.Parse(documentId));
|
||||||
|
|
@ -1136,6 +1437,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _minioService.DeleteFileAsync(Guid.Parse(documentId));
|
await _minioService.DeleteFileAsync(Guid.Parse(documentId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task DeleteAsyncAdminDocument(string candidateId, string documentId)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.ExamNotFound);
|
||||||
|
|
||||||
|
await _minioService.DeleteFileAsync(Guid.Parse(documentId));
|
||||||
|
}
|
||||||
|
|
||||||
public async Task CreateAsyncCareer(string examId, string positionId, CandidateCareerResponseItem updated)
|
public async Task CreateAsyncCareer(string examId, string positionId, CandidateCareerResponseItem updated)
|
||||||
{
|
{
|
||||||
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
||||||
|
|
@ -1164,6 +1476,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsyncAdminCareer(string candidateId, CandidateCareerResponseItem updated)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
var career = new Career
|
||||||
|
{
|
||||||
|
Candidate = candidate,
|
||||||
|
Name = updated.Name,
|
||||||
|
Position = updated.Position,
|
||||||
|
Salary = updated.Salary,
|
||||||
|
DurationStart = updated.DurationStart,
|
||||||
|
DurationEnd = updated.DurationEnd,
|
||||||
|
Reason = updated.Reason,
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
CreatedFullName = FullName ?? "",
|
||||||
|
LastUpdateFullName = FullName ?? "",
|
||||||
|
};
|
||||||
|
|
||||||
|
await _context.Careers.AddAsync(career);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task CreateAsyncEducation(string examId, string positionId, CandidateEducationResponseItem updated)
|
public async Task CreateAsyncEducation(string examId, string positionId, CandidateEducationResponseItem updated)
|
||||||
{
|
{
|
||||||
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
var candidateId = await CreateAsyncCandidate(examId, positionId);
|
||||||
|
|
@ -1199,6 +1537,39 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task CreateAsyncAdminEducation(string candidateId, CandidateEducationResponseItem updated)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
var educationLevel = await _contextMetadata.EducationLevels.AsQueryable()
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.EducationLevelId));
|
||||||
|
|
||||||
|
if (educationLevel == null)
|
||||||
|
throw new Exception(GlobalMessages.EducationLevelNotFound);
|
||||||
|
|
||||||
|
var education = new Education
|
||||||
|
{
|
||||||
|
Candidate = candidate,
|
||||||
|
EducationLevelId = educationLevel.Id,
|
||||||
|
EducationLevelName = educationLevel.Name,
|
||||||
|
Major = updated.Major,
|
||||||
|
Scores = updated.Scores,
|
||||||
|
Name = updated.Name,
|
||||||
|
DurationStart = updated.DurationStart,
|
||||||
|
DurationEnd = updated.DurationEnd,
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
CreatedFullName = FullName ?? "",
|
||||||
|
LastUpdateFullName = FullName ?? "",
|
||||||
|
};
|
||||||
|
|
||||||
|
await _context.Educations.AddAsync(education);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task UpdateAsyncCareer(string careerId, CandidateCareerResponseItem updated)
|
public async Task UpdateAsyncCareer(string careerId, CandidateCareerResponseItem updated)
|
||||||
{
|
{
|
||||||
var career = await _context.Careers.AsQueryable()
|
var career = await _context.Careers.AsQueryable()
|
||||||
|
|
@ -1475,6 +1846,35 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<RequestCardCandidate> GetsAsyncAdminCardCandidate(string candidateId)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.Include(x => x.ProfileImg)
|
||||||
|
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||||
|
|
||||||
|
return new RequestCardCandidate
|
||||||
|
{
|
||||||
|
Avatar = candidate.ProfileImg == null ? "" : _minioService.ImagesPath(candidate.ProfileImg.Id).Result,
|
||||||
|
FirstName = candidate.FirstName,
|
||||||
|
LastName = candidate.LastName,
|
||||||
|
Prefix = candidate.PrefixName,
|
||||||
|
CitizenId = candidate.CitizenId,
|
||||||
|
ExamIdenNumber = candidate.ExamIdenNumber,
|
||||||
|
SeatNumber = candidate.SeatNumber,
|
||||||
|
PointTotalB = candidate.PointTotalB,
|
||||||
|
PointB = candidate.PointB,
|
||||||
|
ResultB = candidate.ResultB,
|
||||||
|
PointTotalC = candidate.PointTotalC,
|
||||||
|
PointC = candidate.PointC,
|
||||||
|
ResultC = candidate.ResultC,
|
||||||
|
Pass = candidate.Pass,
|
||||||
|
Id = candidate.Id,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -614,6 +614,22 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
return candidate;
|
return candidate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<string> GetsAsyncProfileImage(string candidateId)
|
||||||
|
{
|
||||||
|
var candidate = await _context.Candidates.AsQueryable()
|
||||||
|
.Include(x => x.ProfileImg)
|
||||||
|
.Where(x => x.Id == Guid.Parse(candidateId))
|
||||||
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (candidate == null)
|
||||||
|
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||||
|
|
||||||
|
if (candidate.ProfileImg != null)
|
||||||
|
candidate.ProfileImg.Detail = _minioService.ImagesPath(candidate.ProfileImg.Id).Result;
|
||||||
|
|
||||||
|
return candidate.ProfileImg == null ? "" : candidate.ProfileImg.Detail;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<CandidateOccupationResponseItem?> GetsAsyncOccupation(string candidateId)
|
public async Task<CandidateOccupationResponseItem?> GetsAsyncOccupation(string candidateId)
|
||||||
{
|
{
|
||||||
return await _context.Candidates.AsQueryable()
|
return await _context.Candidates.AsQueryable()
|
||||||
|
|
@ -789,7 +805,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
|
|
||||||
foreach (var candidate in candidates)
|
foreach (var candidate in candidates)
|
||||||
{
|
{
|
||||||
var item = items.FirstOrDefault(x => x.CitizenId == candidate.CitizenId && x.ExamIdenNumber == candidate.ExamIdenNumber);
|
var item = items.FirstOrDefault(x => x.CitizenId == candidate.CitizenId && x.ExamIdenNumber.Trim().ToUpper() == candidate.ExamIdenNumber.Trim().ToUpper());
|
||||||
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
|
|
@ -896,10 +912,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
summarySheet.Cells[1, 2].Value = "เลขประจำตัวสอบ";
|
summarySheet.Cells[1, 2].Value = "เลขประจำตัวสอบ";
|
||||||
summarySheet.Cells[1, 3].Value = "เลขที่นั่งสอบ";
|
summarySheet.Cells[1, 3].Value = "เลขที่นั่งสอบ";
|
||||||
summarySheet.Cells[1, 4].Value = "คะแนนเต็มภาค ข";
|
summarySheet.Cells[1, 4].Value = "คะแนนเต็มภาค ข";
|
||||||
summarySheet.Cells[1, 5].Value = "คะแนนเต็มภาค ข";
|
summarySheet.Cells[1, 5].Value = "คะแนนภาค ข";
|
||||||
summarySheet.Cells[1, 6].Value = "ผลสอบภาค ข";
|
summarySheet.Cells[1, 6].Value = "ผลสอบภาค ข";
|
||||||
summarySheet.Cells[1, 7].Value = "คะแนนเต็มภาค ค";
|
summarySheet.Cells[1, 7].Value = "คะแนนเต็มภาค ค";
|
||||||
summarySheet.Cells[1, 8].Value = "คะแนนเต็มภาค ค";
|
summarySheet.Cells[1, 8].Value = "คะแนนภาค ค";
|
||||||
summarySheet.Cells[1, 9].Value = "ผลสอบภาค ค";
|
summarySheet.Cells[1, 9].Value = "ผลสอบภาค ค";
|
||||||
summarySheet.Cells[1, 10].Value = "ผลการสอบ";
|
summarySheet.Cells[1, 10].Value = "ผลการสอบ";
|
||||||
int row = 2;
|
int row = 2;
|
||||||
|
|
@ -979,25 +995,25 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
{
|
{
|
||||||
Id = 4,
|
Id = 4,
|
||||||
Name = "ผ่านการสอบ",
|
Name = "ผ่านการสอบ",
|
||||||
Count = periodExam.Candidate.Where(x=>x.Pass.Contains("ผ่าน")).Count()
|
Count = periodExam.Candidate.Where(x=>x.Pass=="ผ่าน").Count()
|
||||||
},
|
},
|
||||||
new DashboardResponseItem
|
new DashboardResponseItem
|
||||||
{
|
{
|
||||||
Id = 5,
|
Id = 5,
|
||||||
Name = "ไม่ผ่านการสอบ",
|
Name = "ไม่ผ่านการสอบ",
|
||||||
Count = periodExam.Candidate.Where(x=>!x.Pass.Contains("ผ่าน")).Count()
|
Count = periodExam.Candidate.Where(x=>x.Pass!=null && x.Pass!="ผ่าน").Count()
|
||||||
},
|
},
|
||||||
new DashboardResponseItem
|
new DashboardResponseItem
|
||||||
{
|
{
|
||||||
Id = 6,
|
Id = 6,
|
||||||
Name = "เพศชาย",
|
Name = "เพศชาย",
|
||||||
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName.Contains("ชาย")).Count()
|
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName=="นาย").Count()
|
||||||
},
|
},
|
||||||
new DashboardResponseItem
|
new DashboardResponseItem
|
||||||
{
|
{
|
||||||
Id = 7,
|
Id = 7,
|
||||||
Name = "เพศหญิง",
|
Name = "เพศหญิง",
|
||||||
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName.Contains("หญิง")).Count()
|
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && (x.PrefixName=="นาง" || x.PrefixName=="นางสาว")).Count()
|
||||||
},
|
},
|
||||||
// new DashboardResponseItem
|
// new DashboardResponseItem
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"MongoConnection": "mongodb://127.0.0.1:27017",
|
"MongoConnection": "mongodb://127.0.0.1:27017",
|
||||||
"DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
"MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
"MetadataConnection": "server=192.168.1.9;user=root;password=adminVM123;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
// "MetadataConnection": "server=192.168.1.9;user=root;password=adminVM123;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue