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