diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e261ffa..0e3ed6f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -66,21 +66,21 @@ jobs: docker-compose pull docker-compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - uses: snow-actions/line-notify@v1.1.0 - if: success() - with: - access_token: ${{ env.TOKEN_LINE }} - message: | - -Success✅✅✅ - Image: ${{env.IMAGE_NAME}} - Version: ${{ github.event.inputs.IMAGE_VER }} - By: ${{secrets.DOCKER_USER}} - - uses: snow-actions/line-notify@v1.1.0 - if: failure() - with: - access_token: ${{ env.TOKEN_LINE }} - message: | - -Failure❌❌❌ - Image: ${{env.IMAGE_NAME}} - Version: ${{ github.event.inputs.IMAGE_VER }} - By: ${{secrets.DOCKER_USER}} + # - uses: snow-actions/line-notify@v1.1.0 + # if: success() + # with: + # access_token: ${{ env.TOKEN_LINE }} + # message: | + # -Success✅✅✅ + # Image: ${{env.IMAGE_NAME}} + # Version: ${{ github.event.inputs.IMAGE_VER }} + # By: ${{secrets.DOCKER_USER}} + # - uses: snow-actions/line-notify@v1.1.0 + # if: failure() + # with: + # access_token: ${{ env.TOKEN_LINE }} + # message: | + # -Failure❌❌❌ + # Image: ${{env.IMAGE_NAME}} + # Version: ${{ github.event.inputs.IMAGE_VER }} + # By: ${{secrets.DOCKER_USER}} diff --git a/BMA.EHR.Report.Service.csproj b/BMA.EHR.Report.Service.csproj index 96d16fc..5f20e1a 100644 --- a/BMA.EHR.Report.Service.csproj +++ b/BMA.EHR.Report.Service.csproj @@ -59,10 +59,35 @@ - + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/BMA.EHR.Report.Service.sln b/BMA.EHR.Report.Service.sln new file mode 100644 index 0000000..4cbb9f7 --- /dev/null +++ b/BMA.EHR.Report.Service.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34018.315 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BMA.EHR.Report.Service", "BMA.EHR.Report.Service.csproj", "{9A1007A3-3834-4E1F-B242-15CCFEB16BD6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9A1007A3-3834-4E1F-B242-15CCFEB16BD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A1007A3-3834-4E1F-B242-15CCFEB16BD6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A1007A3-3834-4E1F-B242-15CCFEB16BD6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A1007A3-3834-4E1F-B242-15CCFEB16BD6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7C1B80B2-3A5E-42A3-9949-5749FB145086} + EndGlobalSection +EndGlobal diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs index 7b39170..cd75b48 100644 --- a/Controllers/ExamReportController.cs +++ b/Controllers/ExamReportController.cs @@ -9,6 +9,7 @@ using Telerik.Reporting; using BMA.EHR.Report.Service.Responses; using BMA.EHR.Extensions; using BMA.EHR.Core; +using System.Text; namespace BMA.EHR.Report.Service.Controllers { @@ -61,6 +62,27 @@ namespace BMA.EHR.Report.Service.Controllers throw; } } + private string ToThaiNumber(string? value) + { + if (value == null) + return ""; + string arabicNumbers = "0123456789"; + string thaiNumbers = "๐๑๒๓๔๕๖๗๘๙"; + StringBuilder result = new StringBuilder(); + foreach (char digit in value) + { + int index = arabicNumbers.IndexOf(digit); + if (index >= 0) + { + result.Append(thaiNumbers[index]); + } + else + { + result.Append(digit); + } + } + return result.ToString(); + } #endregion @@ -96,12 +118,12 @@ namespace BMA.EHR.Report.Service.Controllers (p, sr) => new { ExamID = p.ExamId, - p.CitizenId, - Order = p.PeriodExam.Round, - Year = p.PeriodExam.Year.Value.ToThaiYear(), + CitizenId = p.CitizenId == null ? "-" : (p.CitizenId), + Order = (p.PeriodExam.Round.ToString()), + Year = (p.PeriodExam.Year.Value.ToThaiYear().ToString()), FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", ExamResult = sr == null ? "" : sr.ExamStatus, - EndDate = p.PeriodExam.RegisterEndDate.ToThaiFullDate3(), + EndDate = (p.PeriodExam.RegisterEndDate.ToThaiFullDate3()), AuthName = "นายณัฐพงศ์ ดิษยบุตร", AuthPosition = "หัวหน้าสำนักงาน ก.ก." }) @@ -170,27 +192,27 @@ namespace BMA.EHR.Report.Service.Controllers (p, sr) => new { ExamId = p.ExamId, - CitizenId = p.CitizenId, + CitizenId = p.CitizenId == null ? "-" : (p.CitizenId), p.Prefix, FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", - DateOfBirth = p.DateOfBirth.ToThaiShortDate(), + DateOfBirth = (p.DateOfBirth.ToThaiShortDate()), Gender = p.Gendor, Degree = p.Educations.First().Degree, Major = p.Educations.First().Major, ExamResult = sr == null ? "" : sr.ExamStatus, University = p.Educations.First().University, PositionName = p.PositionName, - ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}", - Number = sr == null ? "" : sr.Number, + ExamName = ($"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}"), + Number = sr == null ? "" : (sr.Number), // ExamCount = 10, // ExamCount = GetExamCountTes(p.CitizenId), - ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.AddYears(2).ToThaiShortDate(), - FullA = sr == null ? 0 : sr.FullA, - SumA = sr == null ? 0 : sr.SumA, - FullB = sr == null ? 0 : sr.FullB, - SumB = sr == null ? 0 : sr.SumB, - FullC = sr == null ? 0 : sr.FullC, - SumC = sr == null ? 0 : sr.SumC, + ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : (p.PeriodExam.AnnouncementDate.AddYears(2).ToThaiShortDate()), + FullA = sr == null ? "๐" : (sr.FullA.ToString()), + SumA = sr == null ? "๐" : (sr.SumA.ToString()), + FullB = sr == null ? "๐" : (sr.FullB.ToString()), + SumB = sr == null ? "๐" : (sr.SumB.ToString()), + FullC = sr == null ? "๐" : (sr.FullC.ToString()), + SumC = sr == null ? "๐" : (sr.SumC.ToString()), }) .FirstOrDefaultAsync(); var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", $"rptExamResult.trdp"); @@ -262,11 +284,11 @@ namespace BMA.EHR.Report.Service.Controllers .OrderBy(x => x.ExamId) .Select(p => new { - ExamId = p.ExamId, + ExamId = p.ExamId == null ? null : (p.ExamId), FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", PositionName = p.PositionName, ExamName = - $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}", + ($"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}"), }).ToListAsync(); var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", $"rptCandidateList.trdp"); @@ -314,11 +336,11 @@ namespace BMA.EHR.Report.Service.Controllers .OrderBy(x => x.SeatNumber) .Select(p => new { - ExamId = p.SeatNumber, + ExamId = p.SeatNumber == null ? null : (p.SeatNumber), FullName = $"{p.FirstName} {p.LastName}", PositionName = "", ExamName = - $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}", + ($"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}"), }).ToListAsync(); if (data.Count == 0) @@ -379,10 +401,10 @@ namespace BMA.EHR.Report.Service.Controllers { Id = p.PeriodExam.Id, ExamId = p.ExamId, - CitizenId = p.CitizenId, + CitizenId = p.CitizenId == null ? "-" : (p.CitizenId), p.Prefix, FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", - DateOfBirth = p.DateOfBirth.ToThaiShortDate(), + DateOfBirth = (p.DateOfBirth.ToThaiShortDate()), Gender = p.Gendor, Degree = p.Educations.First().Degree, Major = p.Educations.First().Major, @@ -391,13 +413,13 @@ namespace BMA.EHR.Report.Service.Controllers PositionName = p.PositionName, ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}", Number = sr == null ? 99999 : Convert.ToInt32(sr.Number), - FullA = sr == null ? 0 : sr.FullA, - SumA = sr == null ? 0 : sr.SumA, - FullB = sr == null ? 0 : sr.FullB, - SumB = sr == null ? 0 : sr.SumB, - FullC = sr == null ? 0 : sr.FullC, - SumC = sr == null ? 0 : sr.SumC, - SumScore = sr == null ? 0 : sr.SumA + sr.SumB + sr.SumC, + FullA = sr == null ? "๐" : (sr.FullA.ToString()), + SumA = sr == null ? "๐" : (sr.SumA.ToString()), + FullB = sr == null ? "๐" : (sr.FullB.ToString()), + SumB = sr == null ? "๐" : (sr.SumB.ToString()), + FullC = sr == null ? "๐" : (sr.FullC.ToString()), + SumC = sr == null ? "๐" : (sr.SumC.ToString()), + SumScore = sr == null ? "๐" : ((sr.SumA + sr.SumB + sr.SumC).ToString()), }) .OrderBy(x => x.Number) .Where(x => x.Id == id) @@ -454,19 +476,19 @@ namespace BMA.EHR.Report.Service.Controllers .Where(x => x.Status != "register") .Select(p => new { - ExamId = p.SeatNumber, - CitizenId = p.CitizenId, + ExamId = p.SeatNumber == null ? "-" : (p.SeatNumber), + CitizenId = p.CitizenId == null ? "-" : (p.CitizenId), FullName = $"{p.FirstName} {p.LastName}", - DateOfBirth = p.DateOfBirth.Value.ToThaiShortDate(), + DateOfBirth = p.DateOfBirth == null ? "-" : (p.DateOfBirth.Value.ToThaiShortDate()), ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}", Number = p.Number == null ? 99999 : Convert.ToInt32(p.Number), - FullA = 0, - SumA = 0, - FullB = p.PointTotalB, - SumB = p.PointB, - FullC = p.PointTotalC, - SumC = p.PointC, - SumScore = Convert.ToInt32(p.PointB ?? "0") + Convert.ToInt32(p.PointC ?? "0"), + 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()), ExamResult = p.Pass }) .OrderBy(x => x.Number) diff --git a/Fonts/THSarabun.ttf b/Fonts/THSarabun.ttf new file mode 100644 index 0000000..d2abad1 Binary files /dev/null and b/Fonts/THSarabun.ttf differ diff --git a/Fonts/THSarabunBold.ttf b/Fonts/THSarabunBold.ttf new file mode 100644 index 0000000..a1b854b Binary files /dev/null and b/Fonts/THSarabunBold.ttf differ diff --git a/Fonts/THSarabunBoldItalic.ttf b/Fonts/THSarabunBoldItalic.ttf new file mode 100644 index 0000000..beb5249 Binary files /dev/null and b/Fonts/THSarabunBoldItalic.ttf differ diff --git a/Fonts/THSarabunItalic.ttf b/Fonts/THSarabunItalic.ttf new file mode 100644 index 0000000..2ce0e49 Binary files /dev/null and b/Fonts/THSarabunItalic.ttf differ diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 920d7ba..34df898 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -30,6 +30,16 @@ "dotnetRunMessages": true, "applicationUrl": "https://localhost:7187;http://localhost:5215" }, + "report-designer": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "designer.html", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7187;http://localhost:5215" + }, "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, diff --git a/Report/Recruit/rptCandidateList.trdp b/Report/Recruit/rptCandidateList.trdp index 4f6b27e..263b117 100644 Binary files a/Report/Recruit/rptCandidateList.trdp and b/Report/Recruit/rptCandidateList.trdp differ diff --git a/Report/Recruit/rptCertificate1.trdp b/Report/Recruit/rptCertificate1.trdp index 17e4dd1..ce49dac 100644 Binary files a/Report/Recruit/rptCertificate1.trdp and b/Report/Recruit/rptCertificate1.trdp differ diff --git a/Report/Recruit/rptCertificate2.trdp b/Report/Recruit/rptCertificate2.trdp index 75bcf36..437bb75 100644 Binary files a/Report/Recruit/rptCertificate2.trdp and b/Report/Recruit/rptCertificate2.trdp differ diff --git a/Report/Recruit/rptExamResult.trdp b/Report/Recruit/rptExamResult.trdp index 4b1b30c..193951b 100644 Binary files a/Report/Recruit/rptExamResult.trdp and b/Report/Recruit/rptExamResult.trdp differ diff --git a/Report/Recruit/rptPassExamList.trdp b/Report/Recruit/rptPassExamList.trdp index ea03174..16aef50 100644 Binary files a/Report/Recruit/rptPassExamList.trdp and b/Report/Recruit/rptPassExamList.trdp differ diff --git a/wwwroot/designer.html b/wwwroot/designer.html new file mode 100644 index 0000000..d32e628 --- /dev/null +++ b/wwwroot/designer.html @@ -0,0 +1,36 @@ + + + + Telerik Web Report Designer + + + + + + + + +
+ loading... +
+ + + + + + + + + + + \ No newline at end of file