export payment

This commit is contained in:
kittapath 2025-01-31 10:43:36 +07:00
parent b7b2ea40d0
commit 9a71ab6b87
3 changed files with 105 additions and 0 deletions

View file

@ -1620,6 +1620,44 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
return periodExam;
}
public async Task<dynamic> ExportsPaymentExamAsync(string candidateId)
{
var periodExam = await _context.Candidates.AsQueryable()
.Include(x => x.PeriodExam)
.ThenInclude(x => x.PeriodExamBarCodes)
.ThenInclude(x => x.Document)
.Include(x => x.PeriodExam)
.ThenInclude(x => x.PeriodExamQrCodes)
.ThenInclude(x => x.Document)
.Where(x => x.Id == Guid.Parse(candidateId))
.FirstOrDefaultAsync();
if (periodExam == null)
throw new Exception(GlobalMessages.ExamNotFound);
return new
{
template = "candidate",
reportName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}",
data = new
{
data = new
{
FeRemarke = periodExam?.PeriodExam?.Remark ?? "-",
CompanyCode = periodExam?.PeriodExam?.CompanyCode ?? "-",
PeriodExamBarCodes = (periodExam?.PeriodExam?.PeriodExamBarCodes[0]?.Document?.Id ?? null) == null ? "" : _minioService.ImagesPath(periodExam?.PeriodExam?.PeriodExamBarCodes[0]?.Document?.Id ?? Guid.Parse("00000000-0000-0000-0000-000000000000")).Result,
Reason = periodExam?.PeriodExam?.Reason ?? "-",
RefNo1 = periodExam?.PeriodExam?.RefNo1 ?? "-",
PeriodExamQrCodes = (periodExam?.PeriodExam?.PeriodExamQrCodes[0]?.Document?.Id ?? null) == null ? "" : _minioService.ImagesPath(periodExam?.PeriodExam?.PeriodExamQrCodes[0]?.Document?.Id ?? Guid.Parse("00000000-0000-0000-0000-000000000000")).Result,
CitizenId = periodExam?.CitizenId ?? "-",
Fee = periodExam?.PeriodExam?.Fee?.ToString() ?? "-",
FeeText = (periodExam?.PeriodExam?.Fee ?? null) == null ? "-" : periodExam?.PeriodExam?.Fee.Value.NumberToThaiText() ?? "-",
}
}
};
}
public async Task<List<DashboardResponseItem>> GetsDashboardPaymentExamAsync(string examId)
{
var periodExam = await _context.PeriodExams.AsQueryable()