Change REport and Correct Docker file to add THSarabunFont to Docker Image

This commit is contained in:
Suphonchai Phoonsawat 2023-04-22 11:43:16 +07:00
parent 302ee1dd3b
commit 55a83a43ec
17 changed files with 1982 additions and 7 deletions

View file

@ -55,12 +55,12 @@ namespace BMA.EHR.Report.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("certificate/{id:length(36)}/{examId}")]
[HttpGet("certificate/{type:int}/{id:length(36)}/{examId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> GetPeriodByIdAsync(Guid id, string examId)
public async Task<ActionResult<ResponseObject>> GetPeriodByIdAsync(Guid id, string examId,int type)
{
try
{
@ -80,12 +80,13 @@ namespace BMA.EHR.Report.Service.Controllers
Year = p.RecruitImport.Year,
FullName = $"{p.Prefix}{p.FirstName} {p.LastName}",
ExamResult = sr == null ? "" : sr.ExamStatus,
EndDate = DateTime.Now.ToThaiShortDate2()
EndDate = DateTime.Now.ToThaiFullDate3(), // must replace from database
AuthName = "นายณัฐพงศ์ ดิษยบุตร",
AuthPosition = "หัวหน้าสำนักงาน ก.ก."
})
.FirstOrDefaultAsync();
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", "rptCertificate.trdp");
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", $"rptCertificate{type}.trdp");
ReportPackager reportPackager = new ReportPackager();
Telerik.Reporting.Report report = null;
using (var sourceStream = System.IO.File.OpenRead(rptFile))