Compare commits
No commits in common. "dev" and "v1.0.6" have entirely different histories.
4 changed files with 1 additions and 161 deletions
|
|
@ -749,56 +749,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="examId">รหัสรอบสมัคร</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200">เมื่อทำการอ่านโหลดผู้สมัครสอบสำเร็จ</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpGet("download/candidate-exam/{examId:length(36)}")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
|
||||||
public async Task<ActionResult<ResponseObject>> DownloadCandidateExamAsync(string examId)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var data = await _periodExamService.DownloadCandidateExamAsync(examId);
|
|
||||||
return Success(data);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
return Error(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ดาวน์โหลดรายชื่อผู้สอบคัดเลือกได้
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="examId">รหัสรอบสมัคร</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200">เมื่อทำการอ่านโหลดผู้สมัครสอบสำเร็จ</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpGet("download/pass-exam/{examId:length(36)}")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
|
||||||
public async Task<ActionResult<ResponseObject>> DownloadPassExamAsync(string examId)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var data = await _periodExamService.DownloadPassExamAsync(examId);
|
|
||||||
return Success(data);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
return Error(ex, "เกิดข้อผิดพลาดในการแสดงรายงาน");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// โหลดผู้สมัครสอบ
|
/// โหลดผู้สมัครสอบ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,5 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
|
||||||
public string? RejectDetail { get; set; }
|
public string? RejectDetail { get; set; }
|
||||||
|
|
||||||
public bool? IsShowExamInfo { get; set; }
|
public bool? IsShowExamInfo { get; set; }
|
||||||
|
|
||||||
public bool? IsShowResult { get; set; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1978,19 +1978,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
if (candidate == null)
|
if (candidate == null)
|
||||||
throw new Exception(GlobalMessages.CandidateNotFound);
|
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||||
|
|
||||||
bool IsShowResult = true;
|
return new CandidateStatusResponse { Status = candidate.Status, RejectDetail = candidate.RejectDetail, IsShowExamInfo = candidate.IsShowExamInfo };
|
||||||
if (exam.AnnouncementDate != null)
|
|
||||||
{
|
|
||||||
var showResultEndDate = exam.AnnouncementDate.Value.Date.AddDays(15);
|
|
||||||
IsShowResult = DateTime.Now.Date <= showResultEndDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new CandidateStatusResponse {
|
|
||||||
Status = candidate.Status,
|
|
||||||
RejectDetail = candidate.RejectDetail,
|
|
||||||
IsShowExamInfo = candidate.IsShowExamInfo,
|
|
||||||
IsShowResult = IsShowResult,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UserCheckCandidateService(string examId, string positionId, string status)
|
public async Task UserCheckCandidateService(string examId, string positionId, string status)
|
||||||
|
|
|
||||||
|
|
@ -1625,101 +1625,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<dynamic> DownloadCandidateExamAsync(string examId)
|
|
||||||
{
|
|
||||||
var periodExam = await _context.PeriodExams.AsQueryable()
|
|
||||||
.Where(x => x.CheckDisability == false)
|
|
||||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId));
|
|
||||||
|
|
||||||
if (periodExam == null)
|
|
||||||
throw new Exception(GlobalMessages.ExamNotFound);
|
|
||||||
|
|
||||||
var data = await _context.Candidates.AsQueryable()
|
|
||||||
.Include(x => x.PeriodExam)
|
|
||||||
.Where(x => x.PeriodExam == periodExam)
|
|
||||||
.Where(x => x.Status != "register")
|
|
||||||
.Where(x => x.ExamIdenNumber != null && x.ExamIdenNumber != "")
|
|
||||||
.OrderBy(x => x.ExamIdenNumber)
|
|
||||||
.Select(p => new
|
|
||||||
{
|
|
||||||
ExamId = p.ExamIdenNumber == null ? null : (p.ExamIdenNumber.ToThaiNumber()),
|
|
||||||
FullName = $"{p.PrefixName}{p.FirstName} {p.LastName}",
|
|
||||||
PositionName = "",
|
|
||||||
ExamName =
|
|
||||||
($"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}").ToThaiNumber(),
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
if (data.Count == 0)
|
|
||||||
throw new Exception("ไม่พบข้อมูลในระบบ");
|
|
||||||
|
|
||||||
var examName = data[0].ExamName;
|
|
||||||
return new
|
|
||||||
{
|
|
||||||
template = "rptCandidateList",
|
|
||||||
reportName = $"รายชื่อผู้มีสิทธิ์สอบ_{data.First().ExamName}",
|
|
||||||
data = new
|
|
||||||
{
|
|
||||||
examName = examName,
|
|
||||||
data = data
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<dynamic> DownloadPassExamAsync(string examId)
|
|
||||||
{
|
|
||||||
var periodExam = await _context.PeriodExams.AsQueryable()
|
|
||||||
.Where(x => x.CheckDisability == false)
|
|
||||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId));
|
|
||||||
|
|
||||||
if (periodExam == null)
|
|
||||||
throw new Exception(GlobalMessages.ExamNotFound);
|
|
||||||
|
|
||||||
var candidates = await _context.Candidates.AsQueryable()
|
|
||||||
.Include(x => x.PeriodExam)
|
|
||||||
.ThenInclude(x => x.ScoreImport)
|
|
||||||
.Where(x => x.PeriodExam == periodExam)
|
|
||||||
.Where(x => x.Status != "register")
|
|
||||||
.ToListAsync();
|
|
||||||
|
|
||||||
var data = candidates.Select((p, idx) => new
|
|
||||||
{
|
|
||||||
SeatNumber = p.SeatNumber == null ? "-" : (p.SeatNumber.ToThaiNumber()),
|
|
||||||
CitizenId = p.CitizenId == null ? "-" : (p.CitizenId.ToThaiNumber()),
|
|
||||||
FullName = $"{p.PrefixName}{p.FirstName} {p.LastName}",
|
|
||||||
DateOfBirth = p.DateOfBirth == null ? "-" : (p.DateOfBirth.Value.ToThaiShortDate()),
|
|
||||||
ExamName = ($"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}").ToThaiNumber(),
|
|
||||||
Number = p.Number == null ? (idx + 1).ToString().ToThaiNumber() : p.Number.ToThaiNumber(),
|
|
||||||
FullA = "๐",
|
|
||||||
SumA = "๐",
|
|
||||||
FullB = p.PointTotalB == null ? "-" : p.PointTotalB.ToString(),
|
|
||||||
SumB = p.PointB == null ? "-" : p.PointB.ToString(),
|
|
||||||
FullC = p.PointTotalC == null ? "-" : p.PointTotalC.ToString(),
|
|
||||||
SumC = p.PointC == null ? "-" : p.PointC.ToString(),
|
|
||||||
SumScore = ((Convert.ToInt32(p.PointB ?? "0") + Convert.ToInt32(p.PointC ?? "0")).ToString()).ToThaiNumber(),
|
|
||||||
ExamResult = p.Pass,
|
|
||||||
ExamThaiId = p.ExamIdenNumber == null ? "-" : p.ExamIdenNumber.ToThaiNumber(),
|
|
||||||
ExamId = p.ExamIdenNumber,
|
|
||||||
})
|
|
||||||
.OrderBy(x => x.ExamId)
|
|
||||||
.Where(x => x.ExamResult?.Trim() == "ได้")
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
if (data.Count == 0)
|
|
||||||
throw new Exception("ไม่พบข้อมูลในระบบ");
|
|
||||||
|
|
||||||
var examName = data[0].ExamName;
|
|
||||||
return new
|
|
||||||
{
|
|
||||||
template = "rptPassExamList",
|
|
||||||
reportName = $"รายชื่อผู้สอบแข่งขันได้_{periodExam.Name} ครั้งที่ {periodExam.Round}/{periodExam.Year.Value.ToThaiYear()}",
|
|
||||||
data = new
|
|
||||||
{
|
|
||||||
examName = examName,
|
|
||||||
data = data
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<PeriodExam> GetsPaymentExamAsync(string examId)
|
public async Task<PeriodExam> GetsPaymentExamAsync(string examId)
|
||||||
{
|
{
|
||||||
var periodExam = await _context.PeriodExams.AsQueryable()
|
var periodExam = await _context.PeriodExams.AsQueryable()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue