From 3ce12e73fcba4dbed8cfd00f8519189d3f2cf443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nut=2E=E0=B9=84=E0=B8=9B=E0=B9=80=E0=B8=A3=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=A2?= Date: Wed, 2 Sep 2026 07:27:13 +0700 Subject: [PATCH] =?UTF-8?q?feat(agency=5Freport):=20=E0=B9=81=E0=B8=AA?= =?UTF-8?q?=E0=B8=94=E0=B8=87=E0=B8=82=E0=B9=89=E0=B8=AD=2013.1-13.4=20?= =?UTF-8?q?=E0=B8=A7=E0=B8=B4=E0=B8=AA=E0=B8=B1=E0=B8=A2=E0=B8=97=E0=B8=B1?= =?UTF-8?q?=E0=B8=A8=E0=B8=99=E0=B9=8C/=E0=B8=84=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=E0=B8=B4=E0=B8=A2=E0=B8=A1/=E0=B9=80=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=A5=E0=B8=B1=E0=B8=81=E0=B8=A9=E0=B8=93=E0=B9=8C?= =?UTF-8?q?/=E0=B8=AD=E0=B8=B1=E0=B8=95=E0=B8=A5=E0=B8=B1=E0=B8=81?= =?UTF-8?q?=E0=B8=A9=E0=B8=93=E0=B9=8C=20=E0=B9=83=E0=B8=99=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit เดิมรายงานยังผูกกับ checkbox แบบเก่า 7 ตัวเลือก (bool_13_1-7) ที่หน้าเว็บไม่ได้ใช้แล้ว เปลี่ยนเป็นแสดงชื่อ+ตัวชี้วัดที่เลือกจริงของแต่ละหมวด (รวมข้อความด้วยขึ้นบรรทัดใหม่) Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01FyqMVwbVZLfTe8QJSmrUjQ --- Controllers/AgencyReport.Controller.cs | 16 ++++++ Models/budget/agency_report.cs | 68 ++++++++++++++++++++++++++ wwwroot/reports/agency_report.frx | 42 +++++++++------- 3 files changed, 108 insertions(+), 18 deletions(-) diff --git a/Controllers/AgencyReport.Controller.cs b/Controllers/AgencyReport.Controller.cs index 7e0f8c5..1fb216f 100644 --- a/Controllers/AgencyReport.Controller.cs +++ b/Controllers/AgencyReport.Controller.cs @@ -25,6 +25,13 @@ namespace rmutr_report.Controllers this._setting = setting; } + private static string JoinNames(IEnumerable names) + { + return names == null + ? "" + : string.Join("\n", names.Where(n => !string.IsNullOrWhiteSpace(n))); + } + [HttpPost, Route("reports/agency_result_report/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetAgencyReport([FromRoute] string type, [FromBody] List agencyReports) @@ -61,6 +68,15 @@ namespace rmutr_report.Controllers agencyReport.text_25_1 = agencyReport.bool_25_1 == true ? "X" : ""; agencyReport.text_25_2 = agencyReport.bool_25_2 == true ? "X" : ""; + + agencyReport.vision_names_text = JoinNames(agencyReport.agency_report_visions?.Select(c => c.vision_name_th)); + agencyReport.vision_indicators_text = JoinNames(agencyReport.agency_report_vision_indicators?.Select(c => c.vision_indicator_name)); + agencyReport.popularity_names_text = JoinNames(agencyReport.agency_report_popularities?.Select(c => c.popularity_name_th)); + agencyReport.popularity_indicators_text = JoinNames(agencyReport.agency_report_popularity_indicators?.Select(c => c.popularity_indicator_name)); + agencyReport.uniqueness_names_text = JoinNames(agencyReport.agency_report_uniquenesses?.Select(c => c.uniqueness_name_th)); + agencyReport.uniqueness_indicators_text = JoinNames(agencyReport.agency_report_uniqueness_indicators?.Select(c => c.uniqueness_indicator_name)); + agencyReport.identity_names_text = JoinNames(agencyReport.agency_report_identities?.Select(c => c.identity_name_th)); + agencyReport.identity_indicators_text = JoinNames(agencyReport.agency_report_identity_indicators?.Select(c => c.identity_indicator_name)); } if (_setting == null || string.IsNullOrEmpty(_setting.report_path)) diff --git a/Models/budget/agency_report.cs b/Models/budget/agency_report.cs index 9bfe4cb..f02f3ff 100644 --- a/Models/budget/agency_report.cs +++ b/Models/budget/agency_report.cs @@ -304,6 +304,74 @@ public class agency_report public string text_26_4_row_3_3 { get; set; } public bool? is_sent { get; set; } public List agency_report_details { get; set; } + + // 13. วิสัยทัศน์ /ค่านิยม/เอกลักษณ์ / อัตลักษณ์ + public List agency_report_popularities { get; set; } + public List agency_report_visions { get; set; } + public List agency_report_uniquenesses { get; set; } + public List agency_report_identities { get; set; } + public List agency_report_vision_indicators { get; set; } + public List agency_report_uniqueness_indicators { get; set; } + public List agency_report_identity_indicators { get; set; } + public List agency_report_popularity_indicators { get; set; } + + // ข้อความรวม (คั่นด้วยขึ้นบรรทัดใหม่) สำหรับแสดงในรายงาน คำนวณใน AgencyReport.Controller.cs + public string vision_names_text { get; set; } + public string vision_indicators_text { get; set; } + public string popularity_names_text { get; set; } + public string popularity_indicators_text { get; set; } + public string uniqueness_names_text { get; set; } + public string uniqueness_indicators_text { get; set; } + public string identity_names_text { get; set; } + public string identity_indicators_text { get; set; } +} + +public class agency_report_popularity +{ + public Guid? popularity_uid { get; set; } + public string popularity_name_th { get; set; } +} + +public class agency_report_vision +{ + public Guid? vision_uid { get; set; } + public string vision_name_th { get; set; } +} + +public class agency_report_uniqueness +{ + public Guid? uniqueness_uid { get; set; } + public string uniqueness_name_th { get; set; } +} + +public class agency_report_identity +{ + public Guid? identity_uid { get; set; } + public string identity_name_th { get; set; } +} + +public class agency_report_vision_indicator +{ + public Guid? vision_indicator_uid { get; set; } + public string vision_indicator_name { get; set; } +} + +public class agency_report_uniqueness_indicator +{ + public Guid? uniqueness_indicator_uid { get; set; } + public string uniqueness_indicator_name { get; set; } +} + +public class agency_report_identity_indicator +{ + public Guid? identity_indicator_uid { get; set; } + public string identity_indicator_name { get; set; } +} + +public class agency_report_popularity_indicator +{ + public Guid? popularity_indicator_uid { get; set; } + public string popularity_indicator_name { get; set; } } public class agency_report_detail diff --git a/wwwroot/reports/agency_report.frx b/wwwroot/reports/agency_report.frx index d1177f9..c86232c 100644 --- a/wwwroot/reports/agency_report.frx +++ b/wwwroot/reports/agency_report.frx @@ -462,27 +462,33 @@ - + - - - - - - - - - - - - - - - + + + + + + + + + + + - - + + + + + + + + + + + +