From e44a255b534ec63203951a8e447dfb3b4cd71bbe Mon Sep 17 00:00:00 2001 From: kittapath-Jool Date: Mon, 15 Sep 2025 00:11:36 +0700 Subject: [PATCH 1/6] =?UTF-8?q?=E0=B9=82=E0=B8=AB=E0=B8=A5=E0=B8=94?= =?UTF-8?q?=E0=B9=83=E0=B8=9A=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=A3=E0=B8=AD?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/ExamReportController.cs | 36 +++++++++++++++++++++- Controllers/RecruitReportController.cs | 41 ++++++++++++++++---------- Models/Exam/Disable/Disable.cs | 10 +++++++ Models/Recruits/Recruit.cs | 10 +++++++ 4 files changed, 81 insertions(+), 16 deletions(-) diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs index b510196..8195c7f 100644 --- a/Controllers/ExamReportController.cs +++ b/Controllers/ExamReportController.cs @@ -11,6 +11,8 @@ using BMA.EHR.Organization.Service.Extensions; // using BMA.EHR.Core; using System.Text; using static System.Runtime.InteropServices.JavaScript.JSType; +using System.Net.Http.Headers; +using Newtonsoft.Json; namespace BMA.EHR.Report.Service.Controllers { @@ -28,6 +30,7 @@ namespace BMA.EHR.Report.Service.Controllers private readonly IWebHostEnvironment _hostingEnvironment; private readonly IConfiguration _configuration; private readonly string space = "ㅤ"; + private readonly IHttpContextAccessor _httpContextAccessor; #endregion @@ -35,13 +38,16 @@ namespace BMA.EHR.Report.Service.Controllers public ExamReportController(ExamDbContext context, IWebHostEnvironment hostingEnvironment, + IHttpContextAccessor httpContextAccessor, IConfiguration configuration) { this._context = context; this._hostingEnvironment = hostingEnvironment; this._configuration = configuration; + this._httpContextAccessor = httpContextAccessor; } + private string? token => _httpContextAccessor.HttpContext.Request.Headers["Authorization"]; #endregion #region " Methods " @@ -108,6 +114,34 @@ namespace BMA.EHR.Report.Service.Controllers { try { + var _data = await _context.Disables.AsQueryable() + .Include(x => x.PeriodExam) + .Where(x => x.PeriodExam.Id == id) + .Where(x => x.ExamId == examId) + .FirstOrDefaultAsync(); + if (_data == null) + return Error("ไม่พบข้อมูลในระบบ"); + + if (_data.AuthName == null || _data.AuthName == "") + { + var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); + var _res = await client.SendAsync(_req); + var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + var org = JsonConvert.DeserializeObject(_result); + _data.AuthName = org.result.name == null ? "" : org.result.name; + _data.AuthPosition = org.result.position == null ? "" : org.result.position; + await _context.SaveChangesAsync(); + } + } + } + var data = await _context.Disables.AsQueryable() .Include(x => x.PeriodExam) .Where(x => x.PeriodExam.Id == id) @@ -453,7 +487,7 @@ namespace BMA.EHR.Report.Service.Controllers SumScore = sr == null ? "๐" //: (((sr.SumA > 0 ? sr.SumA : 0) + /*sr.SumB +*/ (sr.SumC > 0 ? sr.SumC : 0)).ToString()).ToThaiNumber(), - : (((sr.SumA > 0 ? sr.SumA : 0) + (sr.SumB > 0 ? sr.SumB : 0 ) + (sr.SumC > 0 ? sr.SumC : 0)).ToString()).ToThaiNumber(), + : (((sr.SumA > 0 ? sr.SumA : 0) + (sr.SumB > 0 ? sr.SumB : 0) + (sr.SumC > 0 ? sr.SumC : 0)).ToString()).ToThaiNumber(), }) .OrderBy(x => x.Number) .Where(x => x.Id == id) diff --git a/Controllers/RecruitReportController.cs b/Controllers/RecruitReportController.cs index 4999e2a..abff95f 100644 --- a/Controllers/RecruitReportController.cs +++ b/Controllers/RecruitReportController.cs @@ -75,23 +75,34 @@ namespace BMA.EHR.Report.Service.Controllers { try { - var name = ""; - var position = ""; - var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; - using (var client = new HttpClient()) + var _data = await _context.Recruits.AsQueryable() + .Include(x => x.RecruitImport) + .Where(x => x.RecruitImport.Id == id) + .Where(x => x.ExamId == examId) + .FirstOrDefaultAsync(); + if (_data == null) + return Error("ไม่พบข้อมูลในระบบ"); + + if (_data.AuthName == null || _data.AuthName == "") { - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); - var _res = await client.SendAsync(_req); - var _result = await _res.Content.ReadAsStringAsync(); - if (_res.IsSuccessStatusCode) + var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; + using (var client = new HttpClient()) { - var org = JsonConvert.DeserializeObject(_result); - name = org.result.rootId == null ? "" : org.result.rootId; - position = org.result.rootId == null ? "" : org.result.rootId; + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); + var _res = await client.SendAsync(_req); + var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + var org = JsonConvert.DeserializeObject(_result); + _data.AuthName = org.result.name == null ? "" : org.result.name; + _data.AuthPosition = org.result.position == null ? "" : org.result.position; + await _context.SaveChangesAsync(); + } } } + var data = await _context.Recruits.AsQueryable() .Include(x => x.RecruitImport) .Where(x => x.RecruitImport.Id == id) @@ -109,8 +120,8 @@ namespace BMA.EHR.Report.Service.Controllers FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", ExamResult = sr == null ? "" : sr.ExamStatus, EndDate = p.RecruitImport.RegisterEndDate == null ? "-" : p.RecruitImport.RegisterEndDate.Value.ToThaiFullDate3(), - AuthName = name, - AuthPosition = position + AuthName = p.AuthName, + AuthPosition = p.AuthPosition }) .FirstOrDefaultAsync(); if (data == null) diff --git a/Models/Exam/Disable/Disable.cs b/Models/Exam/Disable/Disable.cs index 4d789ae..a5bebcb 100644 --- a/Models/Exam/Disable/Disable.cs +++ b/Models/Exam/Disable/Disable.cs @@ -78,5 +78,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables public DateTime ApplyDate { get; set; } public string? PositionName { get; set; } + public string? PositionType { get; set; } + public string? PositionLevel { get; set; } + public string? AuthName { get; set; } + public string? AuthPosition { get; set; } + + [Comment("บัญชีสอบ")] + public string? HddPosition { get; set; } = string.Empty; + + [Comment("ประเภทการสอบภาค ก.")] + public string? typeTest { get; set; } = string.Empty; } } diff --git a/Models/Recruits/Recruit.cs b/Models/Recruits/Recruit.cs index 880f96e..df91824 100644 --- a/Models/Recruits/Recruit.cs +++ b/Models/Recruits/Recruit.cs @@ -78,5 +78,15 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits public DateTime ApplyDate { get; set; } public string? PositionName { get; set; } + public string? PositionType { get; set; } + public string? PositionLevel { get; set; } + public string? AuthName { get; set; } + public string? AuthPosition { get; set; } + + [Comment("บัญชีสอบ")] + public string? HddPosition { get; set; } = string.Empty; + + [Comment("ประเภทการสอบภาค ก.")] + public string? typeTest { get; set; } = string.Empty; } } From 5cceb26218eaa172c977b21fa7b4b2e10ea0ee19 Mon Sep 17 00:00:00 2001 From: "DESKTOP-FS20BRA\\user" Date: Mon, 15 Sep 2025 00:31:18 +0700 Subject: [PATCH 2/6] build no noti --- .github/workflows/release.yaml | 72 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index aac45e1..08f85cd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -74,40 +74,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - - name: Notify Discord Success - if: success() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "✅ Deployment Success!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - "color": 3066993, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/success-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Success + # if: success() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "✅ Deployment Success!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + # "color": 3066993, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/success-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} - - name: Notify Discord Failure - if: failure() - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d '{ - "embeds": [{ - "title": "❌ Deployment Failed!", - "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - "color": 15158332, - "footer": { - "text": "Release Notification", - "icon_url": "https://example.com/failure-icon.png" - }, - "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - }] - }' \ - ${{ secrets.DISCORD_WEBHOOK }} + # - name: Notify Discord Failure + # if: failure() + # run: | + # curl -H "Content-Type: application/json" \ + # -X POST \ + # -d '{ + # "embeds": [{ + # "title": "❌ Deployment Failed!", + # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + # "color": 15158332, + # "footer": { + # "text": "Release Notification", + # "icon_url": "https://example.com/failure-icon.png" + # }, + # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + # }] + # }' \ + # ${{ secrets.DISCORD_WEBHOOK }} From fc747782d472e7ecdf4944eef1cb2d6b60083871 Mon Sep 17 00:00:00 2001 From: kittapath-Jool Date: Mon, 15 Sep 2025 00:51:44 +0700 Subject: [PATCH 3/6] test build --- Controllers/ExamReportController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs index 8195c7f..a2c8c66 100644 --- a/Controllers/ExamReportController.cs +++ b/Controllers/ExamReportController.cs @@ -159,8 +159,8 @@ namespace BMA.EHR.Report.Service.Controllers FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", ExamResult = sr == null ? "" : sr.ExamStatus, EndDate = p.PeriodExam.RegisterEndDate == null ? "" : (p.PeriodExam.RegisterEndDate.Value.ToThaiFullDate3()), - AuthName = "นายณัฐพงศ์ ดิษยบุตร", - AuthPosition = "หัวหน้าสำนักงาน ก.ก." + AuthName = p.AuthName, + AuthPosition = p.AuthPosition }) .FirstOrDefaultAsync(); From 155a1f0613dde07d2f275c8205365f934b375770 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 15 Sep 2025 15:18:52 +0700 Subject: [PATCH 4/6] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A5?= =?UTF-8?q?=E0=B8=B3=E0=B8=94=E0=B8=B1=E0=B8=9A=E0=B8=9C=E0=B8=A5=E0=B8=AA?= =?UTF-8?q?=E0=B8=AD=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/ExamReportController.cs | 6 +++--- Controllers/RecruitReportController.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs index a2c8c66..5279ba7 100644 --- a/Controllers/ExamReportController.cs +++ b/Controllers/ExamReportController.cs @@ -477,7 +477,7 @@ namespace BMA.EHR.Report.Service.Controllers //University = p.Educations.First().University, //PositionName = p.PositionName, ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round.ToString().ToThaiNumber()}/{p.PeriodExam.Year.Value.ToThaiYear().ToString().ToThaiNumber()}", - Number = sr == null ? "๐" : sr.Number, + Number = sr == null || sr.Number == null ? 0 : Convert.ToInt32(sr.Number), //FullA = sr == null ? "๐" : (sr.FullA.ToString()), //SumA = sr == null ? "๐" : (sr.SumA.ToString()), //FullB = sr == null ? "๐" : (sr.FullB.ToString()), @@ -486,7 +486,6 @@ namespace BMA.EHR.Report.Service.Controllers //SumC = sr == null ? "๐" : (sr.SumC.ToString()), SumScore = sr == null ? "๐" - //: (((sr.SumA > 0 ? sr.SumA : 0) + /*sr.SumB +*/ (sr.SumC > 0 ? sr.SumC : 0)).ToString()).ToThaiNumber(), : (((sr.SumA > 0 ? sr.SumA : 0) + (sr.SumB > 0 ? sr.SumB : 0) + (sr.SumC > 0 ? sr.SumC : 0)).ToString()).ToThaiNumber(), }) .OrderBy(x => x.Number) @@ -496,10 +495,11 @@ namespace BMA.EHR.Report.Service.Controllers if (data.Count == 0) return Error("ไม่พบข้อมูลในระบบ"); + var data_ = data.Select(x => new { x.ExamName, - Number = x.Number.ToThaiNumber(), + Number = x.Number.ToString().ToThaiNumber(), x.ExamId, x.FullName, x.SumScore diff --git a/Controllers/RecruitReportController.cs b/Controllers/RecruitReportController.cs index abff95f..b86ae63 100644 --- a/Controllers/RecruitReportController.cs +++ b/Controllers/RecruitReportController.cs @@ -402,7 +402,7 @@ namespace BMA.EHR.Report.Service.Controllers { try { - var data = await _context.Recruits.AsQueryable() + var data = await _context.Recruits.AsQueryable() .Include(x => x.RecruitImport) .ThenInclude(x => x.ScoreImport) .Include(x => x.Documents) @@ -435,8 +435,7 @@ namespace BMA.EHR.Report.Service.Controllers ? "" : $"{p.RecruitImport.Name} ครั้งที่ {p.RecruitImport.Order.ToString().ToThaiNumber()}/{p.RecruitImport.Year.ToThaiYear().ToString().ToThaiNumber()}", - - Number = sr.Number == null ? "๐" : sr.Number, + Number = sr == null || sr.Number == null ? 0 : Convert.ToInt32(sr.Number), //ExamCount = _recruitService.GetExamCount(p.CitizenId), //ScoreExpire = p.RecruitImport.AnnouncementDate == null ? "" : p.RecruitImport.AnnouncementDate.Value.AddYears(2).ToThaiShortDate(), @@ -449,19 +448,20 @@ namespace BMA.EHR.Report.Service.Controllers //SumC = sr.SumC == null ? 0.0 : sr.SumC, SumScore = sr == null ? "๐" - : (((sr.SumA > 0 ? sr.SumA : 0) + /*sr.SumB +*/ (sr.SumC > 0 ? sr.SumC : 0)).ToString()).ToThaiNumber(), + : (((sr.SumA > 0 ? sr.SumA : 0) + (sr.SumB > 0 ? sr.SumB : 0) + (sr.SumC > 0 ? sr.SumC : 0)).ToString()).ToThaiNumber(), }) .OrderBy(x => x.Number) .Where(x => x.Id == id) .Where(x => x.ExamResult == "ผ่าน") .ToListAsync(); - if (data.Count == 0) return Error("ไม่พบข้อมูลในระบบ"); + if (data.Count == 0) + return Error("ไม่พบข้อมูลในระบบ"); var data_ = data.Select(x => new { x.ExamName, - Number = x.Number.ToThaiNumber(), + Number = x.Number.ToString().ToThaiNumber(), x.ExamId, x.FullName, x.SumScore From 3bb786478943b0c91e939975e9882a1d2c06fabf Mon Sep 17 00:00:00 2001 From: kittapath-Jool Date: Mon, 15 Sep 2025 16:03:21 +0700 Subject: [PATCH 5/6] add authname --- Controllers/ExamReportController.cs | 42 +++++++++++++------------- Controllers/RecruitReportController.cs | 42 +++++++++++++------------- Models/Exam/Disable/Disable.cs | 4 +-- Models/Exam/PeriodExam.cs | 2 ++ Models/Recruits/Recruit.cs | 4 +-- Models/Recruits/RecruitImport.cs | 26 ++++++++-------- 6 files changed, 62 insertions(+), 58 deletions(-) diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs index a2c8c66..fd8b6e9 100644 --- a/Controllers/ExamReportController.cs +++ b/Controllers/ExamReportController.cs @@ -122,25 +122,25 @@ namespace BMA.EHR.Report.Service.Controllers if (_data == null) return Error("ไม่พบข้อมูลในระบบ"); - if (_data.AuthName == null || _data.AuthName == "") - { - var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; - using (var client = new HttpClient()) - { - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); - var _res = await client.SendAsync(_req); - var _result = await _res.Content.ReadAsStringAsync(); - if (_res.IsSuccessStatusCode) - { - var org = JsonConvert.DeserializeObject(_result); - _data.AuthName = org.result.name == null ? "" : org.result.name; - _data.AuthPosition = org.result.position == null ? "" : org.result.position; - await _context.SaveChangesAsync(); - } - } - } + // if (_data.AuthName == null || _data.AuthName == "") + // { + // var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; + // using (var client = new HttpClient()) + // { + // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + // client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + // var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); + // var _res = await client.SendAsync(_req); + // var _result = await _res.Content.ReadAsStringAsync(); + // if (_res.IsSuccessStatusCode) + // { + // var org = JsonConvert.DeserializeObject(_result); + // _data.AuthName = org.result.name == null ? "" : org.result.name; + // _data.AuthPosition = org.result.position == null ? "" : org.result.position; + // await _context.SaveChangesAsync(); + // } + // } + // } var data = await _context.Disables.AsQueryable() .Include(x => x.PeriodExam) @@ -159,8 +159,8 @@ namespace BMA.EHR.Report.Service.Controllers FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", ExamResult = sr == null ? "" : sr.ExamStatus, EndDate = p.PeriodExam.RegisterEndDate == null ? "" : (p.PeriodExam.RegisterEndDate.Value.ToThaiFullDate3()), - AuthName = p.AuthName, - AuthPosition = p.AuthPosition + AuthName = p.PeriodExam.AuthName, + AuthPosition = p.PeriodExam.AuthPosition }) .FirstOrDefaultAsync(); diff --git a/Controllers/RecruitReportController.cs b/Controllers/RecruitReportController.cs index abff95f..6145db3 100644 --- a/Controllers/RecruitReportController.cs +++ b/Controllers/RecruitReportController.cs @@ -83,25 +83,25 @@ namespace BMA.EHR.Report.Service.Controllers if (_data == null) return Error("ไม่พบข้อมูลในระบบ"); - if (_data.AuthName == null || _data.AuthName == "") - { - var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; - using (var client = new HttpClient()) - { - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); - var _res = await client.SendAsync(_req); - var _result = await _res.Content.ReadAsStringAsync(); - if (_res.IsSuccessStatusCode) - { - var org = JsonConvert.DeserializeObject(_result); - _data.AuthName = org.result.name == null ? "" : org.result.name; - _data.AuthPosition = org.result.position == null ? "" : org.result.position; - await _context.SaveChangesAsync(); - } - } - } + // if (_data.AuthName == null || _data.AuthName == "") + // { + // var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; + // using (var client = new HttpClient()) + // { + // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + // client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + // var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); + // var _res = await client.SendAsync(_req); + // var _result = await _res.Content.ReadAsStringAsync(); + // if (_res.IsSuccessStatusCode) + // { + // var org = JsonConvert.DeserializeObject(_result); + // _data.AuthName = org.result.name == null ? "" : org.result.name; + // _data.AuthPosition = org.result.position == null ? "" : org.result.position; + // await _context.SaveChangesAsync(); + // } + // } + // } var data = await _context.Recruits.AsQueryable() .Include(x => x.RecruitImport) @@ -120,8 +120,8 @@ namespace BMA.EHR.Report.Service.Controllers FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", ExamResult = sr == null ? "" : sr.ExamStatus, EndDate = p.RecruitImport.RegisterEndDate == null ? "-" : p.RecruitImport.RegisterEndDate.Value.ToThaiFullDate3(), - AuthName = p.AuthName, - AuthPosition = p.AuthPosition + AuthName = p.RecruitImport.AuthName, + AuthPosition = p.RecruitImport.AuthPosition }) .FirstOrDefaultAsync(); if (data == null) diff --git a/Models/Exam/Disable/Disable.cs b/Models/Exam/Disable/Disable.cs index a5bebcb..b7c1ab9 100644 --- a/Models/Exam/Disable/Disable.cs +++ b/Models/Exam/Disable/Disable.cs @@ -80,8 +80,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables public string? PositionName { get; set; } public string? PositionType { get; set; } public string? PositionLevel { get; set; } - public string? AuthName { get; set; } - public string? AuthPosition { get; set; } + // public string? AuthName { get; set; } + // public string? AuthPosition { get; set; } [Comment("บัญชีสอบ")] public string? HddPosition { get; set; } = string.Empty; diff --git a/Models/Exam/PeriodExam.cs b/Models/Exam/PeriodExam.cs index 4167b10..1caceb7 100644 --- a/Models/Exam/PeriodExam.cs +++ b/Models/Exam/PeriodExam.cs @@ -88,6 +88,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models [Comment("สำนัก")] public string? Category { get; set; } + public string? AuthName { get; set; } + public string? AuthPosition { get; set; } [Comment("รายชื่อคนสม้ครในรอบ")] public List Candidate { get; set; } = new List(); diff --git a/Models/Recruits/Recruit.cs b/Models/Recruits/Recruit.cs index df91824..8b94c4b 100644 --- a/Models/Recruits/Recruit.cs +++ b/Models/Recruits/Recruit.cs @@ -80,8 +80,8 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits public string? PositionName { get; set; } public string? PositionType { get; set; } public string? PositionLevel { get; set; } - public string? AuthName { get; set; } - public string? AuthPosition { get; set; } + // public string? AuthName { get; set; } + // public string? AuthPosition { get; set; } [Comment("บัญชีสอบ")] public string? HddPosition { get; set; } = string.Empty; diff --git a/Models/Recruits/RecruitImport.cs b/Models/Recruits/RecruitImport.cs index 9ea0f41..0163ece 100644 --- a/Models/Recruits/RecruitImport.cs +++ b/Models/Recruits/RecruitImport.cs @@ -6,16 +6,16 @@ using BMA.EHR.Report.Service.Models; namespace BMA.EHR.Recruit.Service.Models.Recruits { - public class RecruitImport : EntityBase - { - [Required, Comment("ปีที่จัดการสอบ"), Column(Order = 1)] - public int Year { get; set; } + public class RecruitImport : EntityBase + { + [Required, Comment("ปีที่จัดการสอบ"), Column(Order = 1)] + public int Year { get; set; } - [Required, MaxLength(250), Comment("ชื่อการสอบ"), Column(Order = 2)] - public string Name { get; set; } = string.Empty; + [Required, MaxLength(250), Comment("ชื่อการสอบ"), Column(Order = 2)] + public string Name { get; set; } = string.Empty; - [Required, Comment("ครั้งที่"), Column(Order = 3)] - public int Order { get; set; } = 1; + [Required, Comment("ครั้งที่"), Column(Order = 3)] + public int Order { get; set; } = 1; [Column(Order = 4, TypeName = "text"), Comment("รายละเอียด")] public string? Detail { get; set; } @@ -46,15 +46,17 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits [Column(Order = 13, TypeName = "text"), Comment("หมายเหตุ")] public string? Note { get; set; } + public string? AuthName { get; set; } + public string? AuthPosition { get; set; } public DateTime? AnnouncementDate { get; set; } public Document ImportFile { get; set; } = new Document(); - public List Recruits { get; set; } = new List(); + public List Recruits { get; set; } = new List(); - public ScoreImport ScoreImport { get; set; } + public ScoreImport ScoreImport { get; set; } - public List ImportHostories { get; set; } = new List(); - } + public List ImportHostories { get; set; } = new List(); + } } From 6b585ac1934c4899be429709751cb7d2b72244d8 Mon Sep 17 00:00:00 2001 From: kittapath-Jool Date: Mon, 15 Sep 2025 16:34:36 +0700 Subject: [PATCH 6/6] build reload image --- .github/workflows/release.yaml | 81 ++++++++++++++++------------------ 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 08f85cd..40e8759 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,20 +4,13 @@ on: push: tags: - "reportv1-[0-9]+.[0-9]+.[0-9]+" - # push: - # tags: - # - 'v[0-9]+.[0-9]+.[0-9]+' - # tags-ignore: - # - '2.*' - # Allow run workflow manually from Action tab workflow_dispatch: env: REGISTRY: docker.frappet.com IMAGE_NAME: ehr/bma-ehr-report-service DEPLOY_HOST: frappet.com DEPLOY_PORT: 10102 - COMPOSE_PATH: /home/frappet/docker/bma-ehr - # COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-report + COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-report TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0 jobs: @@ -74,40 +67,40 @@ jobs: docker compose pull docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - name: Notify Discord Success - # if: success() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "✅ Deployment Success!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", - # "color": 3066993, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/success-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Success + if: success() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "✅ Deployment Success!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`", + "color": 3066993, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/success-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }} - # - name: Notify Discord Failure - # if: failure() - # run: | - # curl -H "Content-Type: application/json" \ - # -X POST \ - # -d '{ - # "embeds": [{ - # "title": "❌ Deployment Failed!", - # "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", - # "color": 15158332, - # "footer": { - # "text": "Release Notification", - # "icon_url": "https://example.com/failure-icon.png" - # }, - # "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" - # }] - # }' \ - # ${{ secrets.DISCORD_WEBHOOK }} + - name: Notify Discord Failure + if: failure() + run: | + curl -H "Content-Type: application/json" \ + -X POST \ + -d '{ + "embeds": [{ + "title": "❌ Deployment Failed!", + "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`", + "color": 15158332, + "footer": { + "text": "Release Notification", + "icon_url": "https://example.com/failure-icon.png" + }, + "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" + }] + }' \ + ${{ secrets.DISCORD_WEBHOOK }}