diff --git a/Controllers/project_principle_rationale.Controller.cs b/Controllers/project_principle_rationale.Controller.cs index 4bdff59..224704a 100644 --- a/Controllers/project_principle_rationale.Controller.cs +++ b/Controllers/project_principle_rationale.Controller.cs @@ -13,15 +13,16 @@ using Swashbuckle.AspNetCore.Annotations; namespace rmutr_report.Controllers { [SwaggerTag("สำหรับรายงาน ง.5")] - public class ProjectPrincipleRationale: Controller + public class ProjectPrincipleRationale : Controller { - readonly Setting _setting; + readonly Setting _setting; public ProjectPrincipleRationale(Setting setting) { this._setting = setting; } - [HttpPost, Route("reports/project_principle_rationale/{type}")] + + [HttpPost, Route("reports/project_principle_rationale/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetProjectReport([FromRoute] string type, [FromBody] project_principle_rationale project) { @@ -32,41 +33,46 @@ namespace rmutr_report.Controllers if (v.activity != null) { //var total = project.activity.Select(r => r.count).Sum(t => t.Value); - project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total +" โครงการดังนี้คือ"; + project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; } else { project.together_with = null; } } + foreach (var v in project.eighth) { - string na = "ประเด็นยุทธศาสตร์ที่ " ; + string na = "ประเด็นยุทธศาสตร์ที่ "; v.strategic_issues = na + v.strategic_issues; - string na2 = "กลยุทธ์ที่ " ; + string na2 = "กลยุทธ์ที่ "; v.measure = na2 + v.measure; } + foreach (var v in project.fourteenth) { - string na = "องค์ประกอบที่ " ; - v.component = na + v.component; - string na2 = "ตัวบ่งชี้ที่ " ; - v.indicator = na2 + v.indicator; - } - // project.count_activity = total2; + foreach (var vv in v.fourteenths) + { + // string na = "องค์ประกอบที่ " ; + // vv.component = na + vv.component; + string na2 = "ตัวบ่งชี้ที่ "; + vv.indicator = na2 + vv.indicator; + } + } + + // project.count_activity = total2; foreach (var v in project.eighteenth) { foreach (var vv in v.eighteenths) { - string na = "ครั้งที่ "; - vv.the_time = na + vv.the_time; + vv.the_time = na + vv.the_time; string na2 = " จำนวน "; - vv.count_day = na2 + vv.count_day + " วัน"; - if (project.count_day != null) - { - project.text3 = "จำนวน " + project.count_day + " วัน"; - } + vv.count_day = na2 + vv.count_day + " วัน"; + if (project.count_day != null) + { + project.text3 = "จำนวน " + project.count_day + " วัน"; + } } } @@ -74,14 +80,14 @@ namespace rmutr_report.Controllers { project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target; } + if (project.total_board != null) { project.text2 = "ผลรวมคณะกรรมการ " + project.total_board; } + if (project.twenty_one != null) { - - // foreach (var vv in project.twenty_one) // { // if (vv.activity != null || vv.activity!= "") @@ -145,7 +151,7 @@ namespace rmutr_report.Controllers } } - var _project = new List() {project}; + var _project = new List() { project }; Report report = new Report(); report.Load(_setting.report_path + "project_principle_rationale.frx"); @@ -180,7 +186,8 @@ namespace rmutr_report.Controllers stream.Seek(0, SeekOrigin.Begin); return File(stream, "text/csv"); break; - case "doc": case "docx": + case "doc": + case "docx": Word2007Export word = new Word2007Export(); report.Export(word, stream); stream.Seek(0, SeekOrigin.Begin); @@ -190,7 +197,8 @@ namespace rmutr_report.Controllers return Ok(); } -[HttpPost, Route("reports/project_principle_rationale_no_activity/{type}")] + + [HttpPost, Route("reports/project_principle_rationale_no_activity/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetProject2Report([FromRoute] string type, [FromBody] project_principle_rationale project) { @@ -201,41 +209,46 @@ namespace rmutr_report.Controllers if (v.activity != null) { //var total = project.activity.Select(r => r.count).Sum(t => t.Value); - project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total +" โครงการดังนี้คือ"; + project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; } else { project.together_with = null; } } + foreach (var v in project.eighth) { - string na = "ประเด็นยุทธศาสตร์ที่ " ; + string na = "ประเด็นยุทธศาสตร์ที่ "; v.strategic_issues = na + v.strategic_issues; - string na2 = "กลยุทธ์ที่ " ; + string na2 = "กลยุทธ์ที่ "; v.measure = na2 + v.measure; } + foreach (var v in project.fourteenth) { - string na = "องค์ประกอบที่ " ; - v.component = na + v.component; - string na2 = "ตัวบ่งชี้ที่ " ; - v.indicator = na2 + v.indicator; - } - // project.count_activity = total2; + foreach (var vv in v.fourteenths) + { + // string na = "องค์ประกอบที่ " ; + // vv.component = na + vv.component; + string na2 = "ตัวบ่งชี้ที่ "; + vv.indicator = na2 + vv.indicator; + } + } + + // project.count_activity = total2; foreach (var v in project.eighteenth) { foreach (var vv in v.eighteenths) { - string na = "ครั้งที่ "; - vv.the_time = na + vv.the_time; + vv.the_time = na + vv.the_time; string na2 = " จำนวน "; - vv.count_day = na2 + vv.count_day + " วัน"; - if (project.count_day != null) - { - project.text3 = "จำนวน " + project.count_day + " วัน"; - } + vv.count_day = na2 + vv.count_day + " วัน"; + if (project.count_day != null) + { + project.text3 = "จำนวน " + project.count_day + " วัน"; + } } } @@ -243,14 +256,14 @@ namespace rmutr_report.Controllers { project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target; } + if (project.total_board != null) { project.text2 = "ผลรวมคณะกรรมการ " + project.total_board; } + if (project.twenty_one != null) { - - // foreach (var vv in project.twenty_one) // { // if (vv.activity != null || vv.activity!= "") @@ -314,7 +327,7 @@ namespace rmutr_report.Controllers } } - var _project = new List() {project}; + var _project = new List() { project }; Report report = new Report(); report.Load(_setting.report_path + "project_principle_rationale_no_activity.frx"); @@ -349,7 +362,8 @@ namespace rmutr_report.Controllers stream.Seek(0, SeekOrigin.Begin); return File(stream, "text/csv"); break; - case "doc": case "docx": + case "doc": + case "docx": Word2007Export word = new Word2007Export(); report.Export(word, stream); stream.Seek(0, SeekOrigin.Begin); @@ -359,7 +373,5 @@ namespace rmutr_report.Controllers return Ok(); } - - } } \ No newline at end of file diff --git a/Models/budget/project_principle_rationale.cs b/Models/budget/project_principle_rationale.cs index f50ba70..a4a7a8e 100644 --- a/Models/budget/project_principle_rationale.cs +++ b/Models/budget/project_principle_rationale.cs @@ -37,7 +37,6 @@ namespace rmutr_report.Models public string strategic_issues_thirteenth { get; set; } //ข้อ 13 public string subject_thirteenth { get; set; } //ข้อ 13 public string strategy_thirteenth { get; set; } //ข้อ 13 - public string level { get; set; } //ข้อ 14 public List fourteenth { get; set; } //ข้อ 14 public List fifteenth { get; set; } //ข้อ 15 public int? count_activity { get; set; } //ข้อ 16 @@ -105,6 +104,13 @@ namespace rmutr_report.Models } public class fourteenth_data + { + public string level { get; set; } //ข้อ 14 + public List fourteenths { get; set; } + + } + + public class fourteenth_data_detail { public string component { get; set; } public string indicator { get; set; } diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index f3ce322..725af9f 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.dll and b/bin/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.pdb b/bin/Debug/netcoreapp3.1/rmutr_report.pdb index e979931..62bc5d4 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.pdb and b/bin/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index f3ce322..725af9f 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.dll and b/obj/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.pdb b/obj/Debug/netcoreapp3.1/rmutr_report.pdb index e979931..62bc5d4 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/wwwroot/reports/project_principle_rationale.frx b/wwwroot/reports/project_principle_rationale.frx index 1363b40..82d6b15 100644 --- a/wwwroot/reports/project_principle_rationale.frx +++ b/wwwroot/reports/project_principle_rationale.frx @@ -1,5 +1,5 @@  - + @@ -47,10 +47,12 @@ - - - + + + + + @@ -320,138 +322,140 @@ - - - - - - - - + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + - - - - - - + + + + + + + - - + + + + + + + + + + @@ -459,15 +463,15 @@ - - - - - + + + + + - - + + @@ -475,146 +479,146 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + @@ -622,13 +626,13 @@ - - - + + + - + @@ -636,31 +640,31 @@ - - - - - + + + + + - - + + - - - - - + + + + + - - - + + + @@ -668,13 +672,13 @@ - - - + + + - + @@ -682,26 +686,26 @@ - - - - - + + + + + - - - + + + - - - + + + @@ -709,13 +713,13 @@ - - - + + + - + @@ -723,26 +727,26 @@ - - - - - + + + + + - - - + + + - - - + + + @@ -750,13 +754,13 @@ - - - + + + - + @@ -764,16 +768,16 @@ - - - - - + + + + + - + @@ -781,16 +785,16 @@ - - - - - + + + + + - - - + + + @@ -798,11 +802,11 @@ - - - - - + + + + + @@ -812,8 +816,8 @@ - - + + @@ -829,22 +833,22 @@ - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -863,70 +867,70 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - + - - - - - - - + + + + + + + - + - + @@ -935,9 +939,9 @@ - + - + @@ -946,33 +950,33 @@ - + - + - + - + - + - + @@ -983,12 +987,12 @@ - + - - - - + + + + @@ -996,10 +1000,10 @@ - - - - + + + + @@ -1009,10 +1013,10 @@ - - - - + + + + diff --git a/wwwroot/reports/project_principle_rationale_no_activity.frx b/wwwroot/reports/project_principle_rationale_no_activity.frx index c38b65e..5e42651 100644 --- a/wwwroot/reports/project_principle_rationale_no_activity.frx +++ b/wwwroot/reports/project_principle_rationale_no_activity.frx @@ -1,5 +1,5 @@  - + @@ -47,10 +47,12 @@ - - - + + + + + @@ -243,7 +245,7 @@ - + @@ -298,132 +300,134 @@ - - - - - - - - + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + - - - + + + + + + + + + + + + @@ -431,15 +435,15 @@ - - - - - + + + + + - - + + @@ -447,134 +451,134 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - + + + - - - - - - - + + + + + + + - - - + + + @@ -582,13 +586,13 @@ - - - + + + - + @@ -596,31 +600,31 @@ - - - - - + + + + + - - + + - - - - - + + + + + - - - + + + @@ -628,13 +632,13 @@ - - - + + + - + @@ -642,26 +646,26 @@ - - - - - + + + + + - - - + + + - - - + + + @@ -669,13 +673,13 @@ - - - + + + - + @@ -683,26 +687,26 @@ - - - - - + + + + + - - - + + + - - - + + + @@ -710,13 +714,13 @@ - - - + + + - + @@ -724,16 +728,16 @@ - - - - - + + + + + - + @@ -741,16 +745,16 @@ - - - - - + + + + + - - - + + + @@ -758,11 +762,11 @@ - - - - - + + + + + @@ -772,8 +776,8 @@ - - + + @@ -789,22 +793,22 @@ - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -823,54 +827,54 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - + @@ -879,9 +883,9 @@ - + - + @@ -890,33 +894,33 @@ - + - + - + - + - + - + @@ -927,12 +931,12 @@ - + - - - - + + + + @@ -940,10 +944,10 @@ - - - - + + + + @@ -953,10 +957,10 @@ - - - - + + + +