From ca699b4d094ce7b7408f38d2b0bac99eea2dc2f4 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 13 Jan 2026 10:42:30 +0700 Subject: [PATCH 1/3] add build prod --- .onedev-buildspec.yml | 138 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 .onedev-buildspec.yml diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml new file mode 100644 index 0000000..502e49d --- /dev/null +++ b/.onedev-buildspec.yml @@ -0,0 +1,138 @@ +version: 38 +jobs: + # - name: CI for UAT + # steps: + # - !CheckoutStep + # name: checkout code + # cloneCredential: !DefaultCredential {} + # withLfs: false + # withSubmodules: false + # condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + # - !GenerateChecksumStep + # name: generate project checksum + # files: "**/*.csproj" + # targetFile: checksum + # condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + # - !SetupCacheStep + # name: set up nuget cache + # key: nuget_packages_@file:checksum@ + # loadKeys: + # - nuget_packages + # paths: + # - /root/.nuget/packages + # uploadStrategy: UPLOAD_IF_NOT_HIT + # condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + # - !CommandStep + # name: test and analyze + # runInContainer: true + # image: mcr.microsoft.com/dotnet/sdk + # interpreter: !DefaultInterpreter + # commands: | + # set -e + # dotnet tool install -g roslynator.dotnet.cli + # dotnet test -l trx --collect:"XPlat Code Coverage" + # #/root/.dotnet/tools/roslynator analyze -o roslynator-analysis.xml + # useTTY: true + # condition: NEVER + # - !PublishTRXReportStep + # name: publish unit test report + # reportName: Unit Test + # filePatterns: "**/*.trx" + # condition: NEVER + # - !PublishCoberturaReportStep + # name: publish code coverage report + # reportName: Code Coverage + # filePatterns: "**/coverage.cobertura.xml" + # condition: NEVER + # - !PublishRoslynatorReportStep + # name: publish code problem report + # reportName: Code Problems + # filePatterns: roslynator-analysis.xml + # failThreshold: HIGH + # condition: NEVER + # - !SetBuildVersionStep + # name: set build version + # buildVersion: "@tag@" + # condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + # - !BuildImageStep + # name: build docker image + # dockerfile: ./Dockerfile + # output: !RegistryOutput + # tags: "@server@/bma-hrms/hrms-api-reportv1:@build_version@ @server@/bma-hrms/hrms-api-reportv1:latest" + # condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + # triggers: + # - !TagCreateTrigger + # tags: uat-* + # branches: main + # retryCondition: never + # maxRetries: 3 + # retryDelay: 30 + # timeout: 14400 + - name: CI for PROD + steps: + - !CheckoutStep + name: checkout code + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !GenerateChecksumStep + name: generate project checksum + files: "**/*.csproj" + targetFile: checksum + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetupCacheStep + name: set up nuget cache + key: nuget_packages_@file:checksum@ + loadKeys: + - nuget_packages + paths: + - /root/.nuget/packages + uploadStrategy: UPLOAD_IF_NOT_HIT + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: test and analyze + runInContainer: true + image: mcr.microsoft.com/dotnet/sdk + interpreter: !DefaultInterpreter + commands: | + set -e + dotnet tool install -g roslynator.dotnet.cli + dotnet test -l trx --collect:"XPlat Code Coverage" + #/root/.dotnet/tools/roslynator analyze -o roslynator-analysis.xml + useTTY: true + condition: NEVER + - !PublishTRXReportStep + name: publish unit test report + reportName: Unit Test + filePatterns: "**/*.trx" + condition: NEVER + - !PublishCoberturaReportStep + name: publish code coverage report + reportName: Code Coverage + filePatterns: "**/coverage.cobertura.xml" + condition: NEVER + - !PublishRoslynatorReportStep + name: publish code problem report + reportName: Code Problems + filePatterns: roslynator-analysis.xml + failThreshold: HIGH + condition: NEVER + - !SetBuildVersionStep + name: set build version + buildVersion: "@tag@" + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image + dockerfile: ./Dockerfile + output: !RegistryOutput + tags: "@server@/bma-hrms/hrms-api-reportv1:@build_version@ @server@/bma-hrms/hrms-api-reportv1:latest" + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !TagCreateTrigger + tags: prod-* + branches: main + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 From f22eff34d4d1d49193f31961fe637e73b996e465 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 13 Jan 2026 12:45:24 +0700 Subject: [PATCH 2/3] fix error build nuget --- nuget.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget.config b/nuget.config index 7d34cfc..f939e9e 100644 --- a/nuget.config +++ b/nuget.config @@ -4,7 +4,7 @@ - + From 120bd654eac1d839ed641394e57364c68222a1a4 Mon Sep 17 00:00:00 2001 From: harid Date: Mon, 2 Mar 2026 17:45:47 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=A2=E0=B8=B0=E0=B8=AB=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=E0=B8=8A=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B9=83=E0=B8=99?= =?UTF-8?q?=E0=B8=95=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=87=20#2347,=20#2348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/ExamReportController.cs | 57 +++++++++++++++----------- Controllers/RecruitReportController.cs | 55 ++++++++++++++----------- 2 files changed, 66 insertions(+), 46 deletions(-) diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs index 629aa63..91fde03 100644 --- a/Controllers/ExamReportController.cs +++ b/Controllers/ExamReportController.cs @@ -738,30 +738,31 @@ namespace BMA.EHR.Report.Service.Controllers // Title var title = new Paragraph($"รายชื่อผู้มีสิทธิ์สอบ\n{examName ?? ""}") .SetBold() - .SetMultipliedLeading(0.9f) + .SetMultipliedLeading(1.0f) .SetTextAlignment(TextAlignment.CENTER); document.Add(title); - + float[] columnWidths = { 10f, 20f, 45f, 25f }; // Loop Groups foreach (var group in groupData) { // Group Header (ตำแหน่ง) Paragraph positionHeader = new Paragraph($"{group.PositionName} {group.Total}") .SetBold() - .SetMultipliedLeading(0.9f) - .SetTextAlignment(TextAlignment.CENTER); + .SetMultipliedLeading(1.0f) + .SetTextAlignment(TextAlignment.CENTER) + .SetMarginBottom(5); document.Add(positionHeader); - var table = new iText.Layout.Element.Table(new float[] { 1, 2, 3, 2 }).UseAllAvailableWidth(); - table.SetWidth(UnitValue.CreatePercentValue(100)); + var table = new iText.Layout.Element.Table(UnitValue.CreatePercentArray(columnWidths)).UseAllAvailableWidth(); // Table Header string[] headers = { "ลำดับที่", "เลขประจำตัวสอบ", "ชื่อ-สกุล", "หมายเหตุ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) + table.AddHeaderCell(new Cell() + .Add(new Paragraph(h).SetMultipliedLeading(1.0f)) .SetBold() .SetTextAlignment(TextAlignment.CENTER)); } @@ -769,13 +770,20 @@ namespace BMA.EHR.Report.Service.Controllers // Table Details foreach (var x in group.Persons) { - table.AddCell(new Cell().Add(new Paragraph(x.No).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.ExamId).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.No ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); + + table.AddCell(new Cell().Add(new Paragraph(x.ExamId ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); + + table.AddCell(new Cell().Add(new Paragraph(x.FullName ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.LEFT)); + + table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); } document.Add(table); - document.Add(new Paragraph("\n")); + document.Add(new Paragraph("").SetMarginBottom(15)); } } return File(stream.ToArray(), "application/pdf", $"รายชื่อผู้มีสิทธิ์สอบ_{examName}"); @@ -865,43 +873,46 @@ namespace BMA.EHR.Report.Service.Controllers var title = new Paragraph($"รายชื่อผู้สอบแข่งขันได้\n{examName}") .SetBold() - .SetMultipliedLeading(0.9f) + .SetMultipliedLeading(1.0f) .SetTextAlignment(TextAlignment.CENTER); document.Add(title); - + float[] columnWidths = { 10f, 20f, 45f, 25f }; foreach (var g in groupData) { // Header per group Paragraph positionHeader = new Paragraph($"{g.PositionName} {g.Total}") .SetBold() - .SetMultipliedLeading(0.9f) - .SetTextAlignment(TextAlignment.CENTER); + .SetMultipliedLeading(1.0f) + .SetTextAlignment(TextAlignment.CENTER) + .SetMarginBottom(5); document.Add(positionHeader); - var table = new iText.Layout.Element.Table(new float[] { 1, 2, 3, 2 }).UseAllAvailableWidth(); - table.SetWidth(UnitValue.CreatePercentValue(100)); + var table = new iText.Layout.Element.Table(UnitValue.CreatePercentArray(columnWidths)).UseAllAvailableWidth(); string[] headers = { "ลำดับที่", "สนามสอบ", "ชื่อ - นามสกุล", "คะแนนสอบ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) + table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(1.0f)) .SetTextAlignment(TextAlignment.CENTER) .SetBold()); } foreach (var p in g.Persons) { - table.AddCell(new Cell().Add(new Paragraph(p.Number).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.Number ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); table.AddCell(new Cell()); - table.AddCell(new Cell().Add(new Paragraph(p.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(p.SumScore).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.FullName ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.LEFT)); + table.AddCell(new Cell().Add(new Paragraph(p.SumScore ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); } document.Add(table); - document.Add(new Paragraph("\n")); + document.Add(new Paragraph("").SetMarginBottom(15)); } } return File(stream.ToArray(), "application/pdf", $"รายชื่อผู้สอบแข่งขันได้_{examName}"); diff --git a/Controllers/RecruitReportController.cs b/Controllers/RecruitReportController.cs index 1afe0be..682de55 100644 --- a/Controllers/RecruitReportController.cs +++ b/Controllers/RecruitReportController.cs @@ -406,30 +406,31 @@ namespace BMA.EHR.Report.Service.Controllers $"รายชื่อผู้ชำระค่าธรรมเนียมการสมัครสอบการแข่งขันเพื่อบรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ {examName ?? ""}" ) .SetBold() - .SetMultipliedLeading(0.9f) + .SetMultipliedLeading(1.0f) .SetTextAlignment(TextAlignment.CENTER); document.Add(title); - + float[] columnWidths = { 10f, 20f, 45f, 25f }; // Loop Groups foreach (var group in groupData) { // Group Header (ตำแหน่ง) Paragraph positionHeader = new Paragraph($"{group.PositionName} {group.Total}") .SetBold() - .SetMultipliedLeading(0.9f) - .SetTextAlignment(TextAlignment.CENTER); + .SetMultipliedLeading(1.0f) + .SetTextAlignment(TextAlignment.CENTER) + .SetMarginBottom(5); document.Add(positionHeader); - var table = new iText.Layout.Element.Table(new float[] { 1, 2, 3, 2 }).UseAllAvailableWidth(); - table.SetWidth(UnitValue.CreatePercentValue(100)); + var table = new iText.Layout.Element.Table(UnitValue.CreatePercentArray(columnWidths)).UseAllAvailableWidth(); // Table Header string[] headers = { "ลำดับที่", "เลขประจำตัวสอบ", "ชื่อ-สกุล", "หมายเหตุ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) + table.AddHeaderCell(new Cell() + .Add(new Paragraph(h).SetMultipliedLeading(1.0f)) .SetBold() .SetTextAlignment(TextAlignment.CENTER)); } @@ -437,14 +438,18 @@ namespace BMA.EHR.Report.Service.Controllers // Table Details foreach (var x in group.Persons) { - table.AddCell(new Cell().Add(new Paragraph(x.No).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.ExamId).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); - table.AddCell(new Cell().Add(new Paragraph(x.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.No ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.ExamId ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(x.FullName ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.LEFT)); + table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); } document.Add(table); // เว้นระหว่าง groups - document.Add(new Paragraph("\n")); + document.Add(new Paragraph("").SetMarginBottom(15)); } } return File(stream.ToArray(), "application/pdf", $"รายชื่อผู้มีสิทธิ์สอบ_{examName}"); @@ -607,43 +612,47 @@ namespace BMA.EHR.Report.Service.Controllers document.SetMargins(30, 15, 20, 15); var title = new Paragraph($"รายชื่อผู้สอบแข่งขันได้\n{examName}") - .SetMultipliedLeading(0.9f) + .SetMultipliedLeading(1.0f) .SetBold() .SetTextAlignment(TextAlignment.CENTER); document.Add(title); - + float[] columnWidths = { 10f, 20f, 45f, 25f }; foreach (var g in groupData) { // Header per group Paragraph positionHeader = new Paragraph($"{g.PositionName} {g.Total}") - .SetMultipliedLeading(0.9f) + .SetMultipliedLeading(1.0f) .SetTextAlignment(TextAlignment.CENTER) - .SetBold(); + .SetBold() + .SetMarginBottom(5); document.Add(positionHeader); - var table = new iText.Layout.Element.Table(new float[] { 1, 2, 3, 2 }).UseAllAvailableWidth(); - table.SetWidth(UnitValue.CreatePercentValue(100)); + var table = new iText.Layout.Element.Table(UnitValue.CreatePercentArray(columnWidths)).UseAllAvailableWidth(); string[] headers = { "ลำดับที่", "สนามสอบ", "ชื่อ - นามสกุล", "คะแนนสอบ" }; foreach (var h in headers) { - table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f)) + table.AddHeaderCell(new Cell() + .Add(new Paragraph(h).SetMultipliedLeading(1.0f)) .SetTextAlignment(TextAlignment.CENTER) .SetBold()); } foreach (var p in g.Persons) { - table.AddCell(new Cell().Add(new Paragraph(p.Number).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.Number ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); table.AddCell(new Cell()); - table.AddCell(new Cell().Add(new Paragraph(p.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT)); - table.AddCell(new Cell().Add(new Paragraph(p.SumScore).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER)); + table.AddCell(new Cell().Add(new Paragraph(p.FullName ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.LEFT)); + table.AddCell(new Cell().Add(new Paragraph(p.SumScore ?? "").SetMultipliedLeading(1.0f)) + .SetTextAlignment(TextAlignment.CENTER)); } document.Add(table); - document.Add(new Paragraph("\n")); + document.Add(new Paragraph("").SetMarginBottom(15)); } } return File(stream.ToArray(), "application/pdf", $"รายชื่อผู้สอบแข่งขันได้_{examName}");