Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 47s

This commit is contained in:
harid 2026-03-02 17:46:18 +07:00
commit fdafb5aad5
4 changed files with 205 additions and 47 deletions

138
.onedev-buildspec.yml Normal file
View file

@ -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

View file

@ -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}");

View file

@ -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}");

View file

@ -4,7 +4,7 @@
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="private_nuget" value="https://nuget.frappet.synology.me/v3/index.json" />
<!-- <add key="private_nuget" value="https://nuget.frappet.synology.me/v3/index.json" /> -->
<add key="Components" value="./Components" />
</packageSources>
</configuration>