diff --git a/Controllers/project_principle_rationale.Controller.cs b/Controllers/project_principle_rationale.Controller.cs index f0e295a..bea2c13 100644 --- a/Controllers/project_principle_rationale.Controller.cs +++ b/Controllers/project_principle_rationale.Controller.cs @@ -27,164 +27,216 @@ namespace rmutr_report.Controllers [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetProjectReport([FromRoute] string type, [FromBody] project_principle_rationale project) { - var total = project.activity.Count; - if (project.activity != null) + if (project != null) { - foreach (var v in project.activity) + var total = project.activity.Count; + if (project.activity != null) { - if (v.activity != null) + foreach (var v in project.activity) { - //var total = project.activity.Select(r => r.count).Sum(t => t.Value); - project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; - } - else - { - project.together_with = null; - } - } - } - - if (project.eighth != null) - { - foreach (var v in project.eighth) - { - string na = "ประเด็นยุทธศาสตร์ที่ "; - v.strategic_issues = na + v.strategic_issues; - string na2 = "กลยุทธ์ที่ "; - v.measure = na2 + v.measure; - } - } - - if (project.fourteenth != null) - { - foreach (var vv in project.fourteenth) - { - // string na = "องค์ประกอบที่ " ; - // vv.component = na + vv.component; - string na2 = "ตัวบ่งชี้ที่ "; - vv.indicator = na2 + vv.indicator; - } - } - - if (project.sixteenths != null) - { - foreach (var sixteenthData in project.sixteenths) - { - var sum1 = sixteenthData.sixteenths2.Sum(d => d.salaya); - var sum2 = sixteenthData.sixteenths2.Sum(d => d.bophitphimuk); - var sum3 = sixteenthData.sixteenths2.Sum(d => d.pohchang); - var sum4 = sixteenthData.sixteenths2.Sum(d => d.klai_kangwon); - sixteenthData.salaya_total = sum1; - sixteenthData.bophitphimuk_total = sum2; - sixteenthData.pohchang_total = sum3; - sixteenthData.klai_kangwon_total = sum4; - } - } - - if (project.eighteenth != null) - { - foreach (var v in project.eighteenth) - { - foreach (var vv in v.eighteenths) - { - string na = "ครั้งที่ "; - vv.the_time = na + vv.the_time; - string na2 = " จำนวน "; - vv.count_day = na2 + vv.count_day + " วัน"; - if (project.count_day != null) + if (v.activity != null) { - project.text3 = "จำนวน " + project.count_day + " วัน"; + //var total = project.activity.Select(r => r.count).Sum(t => t.Value); + project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ"; + } + else + { + project.together_with = null; } } } - } - if (project.total_target != null) - { - 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!= "") - // { - // vv.activity = vv.activity; - // } - // if (vv.clause1 != null || vv.clause1!= "") - // { - // vv.clause1 = vv.clause1; - // } - // if (vv.clause2 != null || vv.clause2!= "") - // { - // vv.clause2 = vv.clause2; - // } - // if (vv.clause3 != null || vv.clause3!= "") - // { - // vv.clause3 = vv.clause3; - // } - // if (vv.clause4 != null || vv.clause4!= "") - // { - // vv.clause4 = vv.clause4; - // } - // if (vv.count_unit != null || vv.count_unit != "") - // { - // string na = "ผู้เข้าร่วมโครงการ จำนวน "; - // string na2 = " หน่วยนับ"; - // project.text1 = na + vv.count_unit + na2; - // } - // - // if (vv.count_project != null || vv.count_project != "") - // { - // string na = "จำนวนครั้งที่ดำเนินโครงการ "; - // string na2 = " ครั้ง"; - // project.text2 = na + vv.count_project + na2; - // } - // - // if (vv.count_training != null || vv.count_training != "") - // { - // string na = "จำนวนการจัดอบรมและสัมมนา "; - // string na2 = " เรื่อง"; - // project.text3 = na + vv.count_training + na2; - // } - // - // if (vv.count_knowledge != null || vv.count_knowledge != "") - // { - // string na = "จำนวนเผยแพร่ความรู้บริการวิชาการ "; - // string na2 = " ครั้ง"; - // project.text4 = na + vv.count_knowledge + na2; - // } - // string na3 = "วัน/เดือน/ปี ที่จะดำเนินโครงการ "; - // string na4 = " ถึง "; - // project.text5 = na3 + vv.project_start_date + na4 + vv.project_end_date; - // string na5 = "โครงการแล้วเสร็จตามเวลาที่กำหนด (ร้อยละ) "; - // project.text6 = na5 + vv.percentage_finish; - // - // } - - if (project.twenty_one == null) + if (project.eighth != null) { - project.twenty_one = null; - } - } - - if (project.twenty_fifth != null) - { - foreach (var fifthData in project.twenty_fifth) - { - foreach (var acti in fifthData.activity) + foreach (var v in project.eighth) { - fifthData.activitys = acti; + string na = "ประเด็นยุทธศาสตร์ที่ "; + v.strategic_issues = na + v.strategic_issues; + string na2 = "กลยุทธ์ที่ "; + v.measure = na2 + v.measure; } - foreach (var locat in fifthData.location) + } + + if (project.fourteenth != null) + { + foreach (var vv in project.fourteenth) { - fifthData.locations = locat; + // string na = "องค์ประกอบที่ " ; + // vv.component = na + vv.component; + string na2 = "ตัวบ่งชี้ที่ "; + vv.indicator = na2 + vv.indicator; + } + } + + + if (project.sixteenths != null) + { + foreach (var sixteenthData in project.sixteenths) + { + var sum1 = sixteenthData.sixteenths2.Sum(d => d.salaya); + var sum2 = sixteenthData.sixteenths2.Sum(d => d.bophitphimuk); + var sum3 = sixteenthData.sixteenths2.Sum(d => d.pohchang); + var sum4 = sixteenthData.sixteenths2.Sum(d => d.klai_kangwon); + sixteenthData.salaya_total = sum1; + sixteenthData.bophitphimuk_total = sum2; + sixteenthData.pohchang_total = sum3; + sixteenthData.klai_kangwon_total = sum4; + } + } + + if (project.eighteenth != null) + { + foreach (var v in project.eighteenth) + { + foreach (var vv in v.eighteenths) + { + string na = "ครั้งที่ "; + 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 + " วัน"; + } + } + } + } + + if (project.total_target != null) + { + 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!= "") + // { + // vv.activity = vv.activity; + // } + // if (vv.clause1 != null || vv.clause1!= "") + // { + // vv.clause1 = vv.clause1; + // } + // if (vv.clause2 != null || vv.clause2!= "") + // { + // vv.clause2 = vv.clause2; + // } + // if (vv.clause3 != null || vv.clause3!= "") + // { + // vv.clause3 = vv.clause3; + // } + // if (vv.clause4 != null || vv.clause4!= "") + // { + // vv.clause4 = vv.clause4; + // } + // if (vv.count_unit != null || vv.count_unit != "") + // { + // string na = "ผู้เข้าร่วมโครงการ จำนวน "; + // string na2 = " หน่วยนับ"; + // project.text1 = na + vv.count_unit + na2; + // } + // + // if (vv.count_project != null || vv.count_project != "") + // { + // string na = "จำนวนครั้งที่ดำเนินโครงการ "; + // string na2 = " ครั้ง"; + // project.text2 = na + vv.count_project + na2; + // } + // + // if (vv.count_training != null || vv.count_training != "") + // { + // string na = "จำนวนการจัดอบรมและสัมมนา "; + // string na2 = " เรื่อง"; + // project.text3 = na + vv.count_training + na2; + // } + // + // if (vv.count_knowledge != null || vv.count_knowledge != "") + // { + // string na = "จำนวนเผยแพร่ความรู้บริการวิชาการ "; + // string na2 = " ครั้ง"; + // project.text4 = na + vv.count_knowledge + na2; + // } + // string na3 = "วัน/เดือน/ปี ที่จะดำเนินโครงการ "; + // string na4 = " ถึง "; + // project.text5 = na3 + vv.project_start_date + na4 + vv.project_end_date; + // string na5 = "โครงการแล้วเสร็จตามเวลาที่กำหนด (ร้อยละ) "; + // project.text6 = na5 + vv.percentage_finish; + // + // } + + if (project.twenty_one == null) + { + project.twenty_one = null; + } + } + + if (project.twenty_four != null) + { + int no = 1; + foreach (var tw in project.twenty_four) + { + foreach (var dataDetail in tw.twenty_fours) + { + string a = "ชื่อผู้รับผิดชอบ กิจกรรมที่ " + no; + no++; + if (dataDetail.responsible_person != null) + { + dataDetail.text1 = a + " " + dataDetail.responsible_person; + } + + string b = "หน่วยงาน / คณะ "; + if (dataDetail.agency != null) + { + dataDetail.text2 = b + dataDetail.agency; + } + + string c = "พื้นที่ "; + if (dataDetail.area != null) + { + dataDetail.text3 = c + dataDetail.area; + } + + string d = "เบอร์โทรศัพท์ภายใน "; + if (dataDetail.telephone_number != null) + { + dataDetail.text4 = d + dataDetail.telephone_number; + } + + string e = "เบอร์มือถือ "; + if (dataDetail.mobile_number != null) + { + dataDetail.text5 = e + dataDetail.mobile_number; + } + + string f = "อีเมล "; + if (dataDetail.email != null) + { + dataDetail.text6 = f + dataDetail.email; + } + } + } + } + + if (project.twenty_fifth != null) + { + foreach (var fifthData in project.twenty_fifth) + { + foreach (var acti in fifthData.activity) + { + fifthData.activitys = acti; + } + + foreach (var locat in fifthData.location) + { + fifthData.locations = locat; + } } } } @@ -238,7 +290,8 @@ namespace rmutr_report.Controllers [HttpPost, Route("reports/project_principle_rationale_no_activity/{type}")] [ApiExplorerSettings(GroupName = "reports")] - public IActionResult GetProject2Report([FromRoute] string type, [FromBody] project_principle_rationale project) + public IActionResult GetProject2Report([FromRoute] string type, + [FromBody] project_principle_rationale project) { var total = project.activity.Count; if (project.activity != null) @@ -386,6 +439,54 @@ namespace rmutr_report.Controllers project.twenty_one = null; } } + + if (project.twenty_four != null) + { + int no = 1; + foreach (var tw in project.twenty_four) + { + foreach (var dataDetail in tw.twenty_fours) + { + string a = "ชื่อผู้รับผิดชอบ กิจกรรมที่ " + no; + no++; + if (dataDetail.responsible_person != null) + { + dataDetail.text1 = a + " " + dataDetail.responsible_person; + } + + string b = "หน่วยงาน / คณะ "; + if (dataDetail.agency != null) + { + dataDetail.text2 = b + dataDetail.agency; + } + + string c = "พื้นที่ "; + if (dataDetail.area != null) + { + dataDetail.text3 = c + dataDetail.area; + } + + string d = "เบอร์โทรศัพท์ภายใน "; + if (dataDetail.telephone_number != null) + { + dataDetail.text4 = d + dataDetail.telephone_number; + } + + string e = "เบอร์มือถือ "; + if (dataDetail.mobile_number != null) + { + dataDetail.text5 = e + dataDetail.mobile_number; + } + + string f = "อีเมล "; + if (dataDetail.email != null) + { + dataDetail.text6 = f + dataDetail.email; + } + } + } + } + if (project.twenty_fifth != null) { foreach (var fifthData in project.twenty_fifth) @@ -394,6 +495,7 @@ namespace rmutr_report.Controllers { fifthData.activitys = acti; } + foreach (var locat in fifthData.location) { fifthData.locations = locat; diff --git a/Models/budget/project_principle_rationale.cs b/Models/budget/project_principle_rationale.cs index d2c4011..f65bb1d 100644 --- a/Models/budget/project_principle_rationale.cs +++ b/Models/budget/project_principle_rationale.cs @@ -484,6 +484,12 @@ namespace rmutr_report.Models } public class twenty_four_data + { + public string activity { get; set; } + public List twenty_fours { get; set; } + } + + public class twenty_four_data_detail { public string text1 { get; set; } public string text2 { get; set; } @@ -496,7 +502,7 @@ namespace rmutr_report.Models public string area { get; set; } public string telephone_number { get; set; } public string mobile_number { get; set; } - public string email { get; set; } + public string email { get; set; } } public class twenty_fifth_data diff --git a/bin/Debug/net5.0/rmutr_report.dll b/bin/Debug/net5.0/rmutr_report.dll index 578ac95..75a1690 100644 Binary files a/bin/Debug/net5.0/rmutr_report.dll and b/bin/Debug/net5.0/rmutr_report.dll differ diff --git a/bin/Debug/net5.0/rmutr_report.pdb b/bin/Debug/net5.0/rmutr_report.pdb index 687f85a..bb695d6 100644 Binary files a/bin/Debug/net5.0/rmutr_report.pdb and b/bin/Debug/net5.0/rmutr_report.pdb differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 133599d..303acdf 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 f8a748c..df11acb 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/net5.0/ref/rmutr_report.dll b/obj/Debug/net5.0/ref/rmutr_report.dll index 6796697..8dc65d9 100644 Binary files a/obj/Debug/net5.0/ref/rmutr_report.dll and b/obj/Debug/net5.0/ref/rmutr_report.dll differ diff --git a/obj/Debug/net5.0/refint/rmutr_report.dll b/obj/Debug/net5.0/refint/rmutr_report.dll index 6796697..8dc65d9 100644 Binary files a/obj/Debug/net5.0/refint/rmutr_report.dll and b/obj/Debug/net5.0/refint/rmutr_report.dll differ diff --git a/obj/Debug/net5.0/rmutr_report.dll b/obj/Debug/net5.0/rmutr_report.dll index 578ac95..75a1690 100644 Binary files a/obj/Debug/net5.0/rmutr_report.dll and b/obj/Debug/net5.0/rmutr_report.dll differ diff --git a/obj/Debug/net5.0/rmutr_report.pdb b/obj/Debug/net5.0/rmutr_report.pdb index 687f85a..bb695d6 100644 Binary files a/obj/Debug/net5.0/rmutr_report.pdb and b/obj/Debug/net5.0/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 133599d..303acdf 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 f8a748c..df11acb 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index d52c201..936e6f7 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -16934730478373239 \ No newline at end of file +16935604775337552 \ No newline at end of file diff --git a/wwwroot/reports/project_principle_rationale.frx b/wwwroot/reports/project_principle_rationale.frx index 401c85d..9c599be 100644 --- a/wwwroot/reports/project_principle_rationale.frx +++ b/wwwroot/reports/project_principle_rationale.frx @@ -1,5 +1,5 @@  - + @@ -256,18 +256,21 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -401,7 +404,7 @@ - + @@ -758,7 +761,7 @@ - + @@ -791,15 +794,15 @@ - + - + - + @@ -808,16 +811,16 @@ - - + + - - + + @@ -834,9 +837,9 @@ - + - + @@ -845,9 +848,9 @@ - + - + @@ -856,39 +859,42 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/project_principle_rationale_no_activity.frx b/wwwroot/reports/project_principle_rationale_no_activity.frx index 5273f54..029549f 100644 --- a/wwwroot/reports/project_principle_rationale_no_activity.frx +++ b/wwwroot/reports/project_principle_rationale_no_activity.frx @@ -1,5 +1,5 @@  - + @@ -231,18 +231,21 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -715,7 +718,7 @@ - + @@ -748,9 +751,9 @@ - + - + @@ -775,9 +778,9 @@ - + - + @@ -786,9 +789,9 @@ - + - + @@ -797,39 +800,47 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +