เพิ่มapiโหลดใบชำระเงิน
This commit is contained in:
parent
a5c538874d
commit
2f01961dc5
3 changed files with 328 additions and 259 deletions
|
|
@ -608,7 +608,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// สร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร
|
||||
|
|
@ -1152,7 +1152,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// list เอกสารหลักฐาน
|
||||
/// </summary>
|
||||
|
|
@ -1161,7 +1161,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
/// <response code="200">เมื่อ list เอกสารหลักฐานสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("upload/{candidateId:length(36)}")]
|
||||
[HttpGet("upload/{candidateId:length(36)}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
|
|
@ -1320,6 +1320,33 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// โหลดใบชำระเงิน
|
||||
/// </summary>
|
||||
/// <param name="examId">รหัสรอบสมัคร</param>
|
||||
/// <param name="positionId">Id ตำแหน่งสมัครสอบ</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อทำการโหลดใบชำระเงิน สำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("bill/{examId:length(36)}/{positionId:length(36)}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetsAsyncBillCandidate(string examId, string positionId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var items = await _candidateService.GetsAsyncBillCandidate(examId, positionId);
|
||||
|
||||
return Success(GlobalMessages.Success, items);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1714,13 +1714,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
{
|
||||
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + exam.Name;
|
||||
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่ตรวจสอบข้อมูล";
|
||||
_mailService.SendMailToUser(subject, body, "kittapath@frappet.com");
|
||||
_mailService.SendMailToUser(subject, body, "ananda@frappet.com");
|
||||
}
|
||||
if (status == "checkPayment")
|
||||
{
|
||||
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + exam.Name;
|
||||
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่ตรวจสอบหลักฐานชำระเงิน";
|
||||
_mailService.SendMailToUser(subject, body, "kittapath@frappet.com");
|
||||
_mailService.SendMailToUser(subject, body, "ananda@frappet.com");
|
||||
}
|
||||
candidate.Status = status;
|
||||
|
||||
|
|
@ -1753,14 +1753,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
if (status == "rejectRegister")
|
||||
{
|
||||
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + candidate.PeriodExam.Name;
|
||||
var body = candidate.FirstName + " " + candidate.LastName + " มีคุณสมบัติสมัครสอบไม่ผ่านกรุณาตรวจสอบข้อมูล";
|
||||
var body = candidate.FirstName + " " + candidate.LastName + " มีคุณสมบัติสมัครสอบไม่ผ่านกรุณาตรวจสอบข้อมูล เนื่องจาก: " + item.Reason;
|
||||
if (candidate.Email != null) _mailService.SendMailToUser(subject, body, candidate.Email);
|
||||
candidate.RejectDetail = item.Reason;
|
||||
}
|
||||
if (status == "rejectPayment")
|
||||
{
|
||||
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + candidate.PeriodExam.Name;
|
||||
var body = candidate.FirstName + " " + candidate.LastName + " มีหลักฐานชำระเงินไม่ถูกต้องกรุณาตรวจสอบข้อมูล";
|
||||
var body = candidate.FirstName + " " + candidate.LastName + " มีหลักฐานชำระเงินไม่ถูกต้องกรุณาตรวจสอบข้อมูล เนื่องจาก: " + item.Reason;
|
||||
if (candidate.Email != null) _mailService.SendMailToUser(subject, body, candidate.Email);
|
||||
candidate.RejectDetail = item.Reason;
|
||||
}
|
||||
|
|
@ -1931,6 +1931,48 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
};
|
||||
}
|
||||
|
||||
public async Task<string> GetsAsyncBillCandidate(string examId, string positionId)
|
||||
{
|
||||
// var exam = await _context.PeriodExams.AsQueryable()
|
||||
// .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId));
|
||||
|
||||
// if (exam == null)
|
||||
// throw new Exception(GlobalMessages.ExamNotFound);
|
||||
|
||||
// var candidate = await _context.Candidates.AsQueryable()
|
||||
// .FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId);
|
||||
|
||||
// if (positionId != "00000000-0000-0000-0000-000000000000")
|
||||
// {
|
||||
// var position = await _context.PositionExams.AsQueryable()
|
||||
// .FirstOrDefaultAsync(x => x.Id == Guid.Parse(positionId) && x.PeriodExam == exam);
|
||||
|
||||
// if (position == null)
|
||||
// throw new Exception(GlobalMessages.PositionExamNotFound);
|
||||
|
||||
// candidate = await _context.Candidates.AsQueryable()
|
||||
// .FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position);
|
||||
// }
|
||||
|
||||
// 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();
|
||||
|
||||
return _minioService.ImagesPath(Guid.Parse("08db463c-9bf7-494f-8b35-e9b777256dae")).Result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue