diff --git a/Controllers/Summary.Controller.cs b/Controllers/Summary.Controller.cs index ef51199..da8749c 100644 --- a/Controllers/Summary.Controller.cs +++ b/Controllers/Summary.Controller.cs @@ -66,6 +66,126 @@ namespace rmutr_report.Controllers return Ok(); } + [HttpPost, Route("reports/summary_of_equipment_five_year/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetEquipmentReport([FromRoute] string type, [FromBody] summary_of_equipment_five_year summary_of_equipments) + { + + var _summary_of_equipment = new List() { summary_of_equipments }; + + Report report = new Report(); + report.Load(_setting.report_path + "summary_of_equipment_5_year.frx"); + report.RegisterData(_summary_of_equipment, "summary_of_equipment_five_year"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/vnd.ms-excel"); + break; + case "mht": + MHTExport mht = new MHTExport(); + report.Export(mht, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "multipart/related"); + break; + case "csv": + CSVExport csv = new CSVExport(); + report.Export(csv, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "text/csv"); + break; + } + + return Ok(); + } + [HttpPost, Route("reports/statement_of_equipment/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetStEquipmentReport([FromRoute] string type, [FromBody] statement_of_equipment equipments) + { + var a = equipments.page_1.ToArray(); + foreach (var aa in a) + { + var s1 = aa.page_1_detail.Sum(d => d.quantity); + var s2 = aa.page_1_detail.Sum(d => d.unit_price); + var s3 = aa.page_1_detail.Sum(d => d.amount); + foreach (var b in aa.page_1_detail) + { + if (b.quantity != null) + { + aa.sum1 = s1; + } + if (b.quantity == null) + { + aa.sum1 = 0; + } + if (b.unit_price != null) + { + aa.sum2 = s2; + } + if (b.unit_price == null) + { + aa.sum2 = 0; + } + if (b.amount != null) + { + aa.sum3 = s3; + } + if (b.amount == null) + { + aa.sum3 = 0; + } + } + } + + var _statement_of_equipment = new List() { equipments }; + + Report report = new Report(); + report.Load(_setting.report_path + "statement_of_equipment.frx"); + report.RegisterData(_statement_of_equipment, "statement_of_equipment"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/vnd.ms-excel"); + break; + case "mht": + MHTExport mht = new MHTExport(); + report.Export(mht, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "multipart/related"); + break; + case "csv": + CSVExport csv = new CSVExport(); + report.Export(csv, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "text/csv"); + break; + } + + return Ok(); + } [HttpPost, Route("reports/summary_building_construction/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSum2Report([FromRoute] string type, [FromBody] summary_building_construction summary_building_constructions) @@ -74,7 +194,7 @@ namespace rmutr_report.Controllers var _summary_building_constructions = new List() { summary_building_constructions }; Report report = new Report(); - report.Load(_setting.report_path + "summary_building_construction.frx"); + report.Load(_setting.report_path + "summary_building_constructions.frx"); report.RegisterData(_summary_building_constructions, "summary_building_construction"); report.Prepare(); diff --git a/Models/statement_of_equipment.cs b/Models/statement_of_equipment.cs new file mode 100644 index 0000000..3f35968 --- /dev/null +++ b/Models/statement_of_equipment.cs @@ -0,0 +1,228 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class statement_of_equipment + { + public List page_1 { get; set; } + public List page_2 { get; set; } + public List page_3 { get; set; } + public List page_4 { get; set; } + public List page_5 { get; set; } + public List page_6 { get; set; } + public List page_7 { get; set; } + public List page_8 { get; set; } + public List page_9 { get; set; } + + } + + public class data_page_1 + { + public string agency_name_th { get; set; } + public string major_name_th { get; set; } + public string area { get; set; } + public string display_name_th { get; set; } + public string phone_number { get; set; } + public string product { get; set; } + public List page_1_detail { get; set; } + public string building_assembly_equipment { get; set; } + public string building_assembly_equipment_name { get; set; } + public string building { get; set; } + public string budget_year { get; set; } + public string educational_equipment { get; set; } + public string computer_equipment { get; set; } + public string other_equipment { get; set; } + public string in_country { get; set; } + public string out_country { get; set; } + public string strategic1 { get; set; } + public string strategic2 { get; set; } + public string strategic3 { get; set; } + public string strategic4 { get; set; } + public string strategic5 { get; set; } + public string strategic6 { get; set; } + public string consistency_goals { get; set; } + public decimal? sum1 { get; set; } + public decimal? sum2 { get; set; } + public decimal? sum3 { get; set; } + } + public class data_page_1_detail{ + public string list { get; set; } + public decimal? quantity { get; set; } + public decimal? unit_price { get; set; } + public decimal? amount { get; set; } + } + + public class data_page_2 + { + public string consistency_strategy { get; set; } + public string exist_quantity { get; set; } + public string workable_quantity { get; set; } + public string defective_quantity { get; set; } + public string major_quantity { get; set; } + public string agency_quantity { get; set; } + public string knowledge_quantity { get; set; } + public string teaching { get; set; } + public string train { get; set; } + public string test { get; set; } + public string other_work { get; set; } + public string teaching_quantity { get; set; } + public string train_quantity { get; set; } + public string test_quantity { get; set; } + public string other_work_quantity { get; set; } + public string teaching_person { get; set; } + public string train_person { get; set; } + public string teaching_quantity_person { get; set; } + public string train_quantity_person { get; set; } + public string assembly_list { get; set; } + public decimal? specification_quantity { get; set; } + public decimal? unit_price { get; set; } + public decimal? total { get; set; } + public string specification { get; set; } + } + + public class data_page_3 + { + public string assembly_list1 { get; set; } + public decimal? specification_quantity1 { get; set; } + public decimal? unit_price1 { get; set; } + public decimal? total1 { get; set; } + public string specification1 { get; set; } + public string assembly_list2 { get; set; } + public decimal? specification_quantity2 { get; set; } + public decimal? unit_price2 { get; set; } + public decimal? total2 { get; set; } + public string specification2 { get; set; } + public List page_3_detail { get; set; } + public string july { get; set; } + public string august { get; set; } + public string september { get; set; } + public string quarter_1_indebtedness { get; set; } + public string quarter_2_indebtedness { get; set; } + public string quarter_1_disburse { get; set; } + public string quarter_1_disburse_detail1 { get; set; } + public string quarter_1_disburse_detail2 { get; set; } + public string quarter_2_disburse { get; set; } + public string quarter_2_disburse_detail1 { get; set; } + public string quarter_2_disburse_detail2 { get; set; } + } + + public class data_page_3_detail + { + public string list { get; set; } + public string month_1 { get; set; } + public string month_2 { get; set; } + public string month_3 { get; set; } + public string month_4 { get; set; } + public string month_5 { get; set; } + public string month_6 { get; set; } + public string month_7 { get; set; } + public string month_8 { get; set; } + public string month_9 { get; set; } + public string month_10 { get; set; } + public string month_11 { get; set; } + public string month_12 { get; set; } + } + + public class data_page_4 + { + public string result { get; set; } + public string unit { get; set; } + public string result_year1 { get; set; } + public string result_year2 { get; set; } + public string result_year3 { get; set; } + public string result_year4 { get; set; } + public string result_year5 { get; set; } + } + public class data_page_5 + { + public string explain { get; set; } + public string company_1 { get; set; } + public decimal? amount_1 { get; set; } + public string company_2 { get; set; } + public decimal? amount_2 { get; set; } + public string company_3 { get; set; } + public decimal? amount_3 { get; set; } + public string case1 { get; set; } + public string case2 { get; set; } + public string case3 { get; set; } + public string case4 { get; set; } + } + + public class data_page_6 + { + public string list { get; set; } + public decimal? amount { get; set; } + public string necessity { get; set; } + public string fully_functional { get; set; } + public string partly_available { get; set; } + public string not_available { get; set; } + public string other_available { get; set; } + public string repairable { get; set; } + public string repair { get; set; } + public string not_repair { get; set; } + public string other_repair { get; set; } + public string target { get; set; } + public string use_equipment { get; set; } + public string not_use_equipment { get; set; } + public string summary_equipment1 { get; set; } + public string summary_equipment2 { get; set; } + public string summary_equipment3 { get; set; } + public string summary_equipment4 { get; set; } + public string summary_equipment5 { get; set; } + + } + + public class data_page_7 + { + public string output_target1 { get; set; } + public string output_target2 { get; set; } + public string development_target1 { get; set; } + public string development_target2 { get; set; } + public string original_equipment1 { get; set; } + public string original_equipment2 { get; set; } + public string original_equipment3 { get; set; } + public string original_equipment4 { get; set; } + public string target_equipment { get; set; } + public string work_equipment { get; set; } + public string sum_original_equipment1 { get; set; } + public string sum_original_equipment2 { get; set; } + public string sum_original_equipment3 { get; set; } + public string sum_original_equipment4 { get; set; } + public string performance_data { get; set; } + public string quality_requirements { get; set; } + } + public class data_page_8 + { + public string efficiency1 { get; set; } + public string efficiency2 { get; set; } + public string original_equipment1 { get; set; } + public string original_equipment2 { get; set; } + public string original_equipment3 { get; set; } + public string original_equipment4 { get; set; } + public string target_equipment { get; set; } + public string work_equipment { get; set; } + public string sum_original_equipment1 { get; set; } + public string sum_original_equipment2 { get; set; } + public string sum_original_equipment3 { get; set; } + public string sum_original_equipment4 { get; set; } + public string product_equipment { get; set; } + public string support_plan1 { get; set; } + public string support_plan2 { get; set; } + public string target_audience1 { get; set; } + public string target_audience2 { get; set; } + } + + public class data_page_9 + { + public string original_equipment1 { get; set; } + public string original_equipment2 { get; set; } + public string original_equipment3 { get; set; } + public string original_equipment4 { get; set; } + public string target_equipment { get; set; } + public string work_equipment { get; set; } + public string sum_original_equipment1 { get; set; } + public string sum_original_equipment2 { get; set; } + public string sum_original_equipment3 { get; set; } + public string sum_original_equipment4 { get; set; } + } +} \ No newline at end of file diff --git a/Models/summary_building_construction.cs b/Models/summary_building_construction.cs index 495db29..10f71cd 100644 --- a/Models/summary_building_construction.cs +++ b/Models/summary_building_construction.cs @@ -4,6 +4,10 @@ namespace rmutr_report.Models { public class summary_building_construction { + public string academic_year_name_th { get; set; } + public string header_name { get; set; } + public string agency_name_th { get; set; } + public string location { get; set; } public string academic_year { get; set; } public string budget_year_1 { get; set; } public string budget_year_2 { get; set; } diff --git a/Models/summary_of_equipment.cs b/Models/summary_of_equipment.cs index 0f7fa01..857967c 100644 --- a/Models/summary_of_equipment.cs +++ b/Models/summary_of_equipment.cs @@ -14,6 +14,7 @@ namespace rmutr_report.Models public string budget_year_3 { get; set; } public string budget_year_4 { get; set; } public string budget_year_5 { get; set; } + public List data { get; set; } } public class summary_of_equipment_detail diff --git a/Models/summary_of_equipment_five_year.cs b/Models/summary_of_equipment_five_year.cs new file mode 100644 index 0000000..debeb7c --- /dev/null +++ b/Models/summary_of_equipment_five_year.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class summary_of_equipment_five_year + { + public string academic_year { get; set; } + public string budget_year_1 { get; set; } + public string budget_year_2 { get; set; } + public string budget_year_3 { get; set; } + public string budget_year_4 { get; set; } + public string budget_year_5 { get; set; } + public decimal? amount { get; set; } + public string company { get; set; } + public List data { get; set; } + } + + public class summary_of_equipment_five_year_detail + { + public int? no { get; set; } + public string list { get; set; } + public string type_1 { get; set; } + public string type_2 { get; set; } + public string type_3 { get; set; } + public string unit { get; set; } + public decimal? unit_price { get; set; } + public decimal? price_1 { get; set; } + public decimal? price_2 { get; set; } + public decimal? price_3 { get; set; } + public decimal? price_4 { get; set; } + public decimal? price_5 { get; set; } + public decimal? amount { get; set; } + public string company { get; set; } + public string description { get; set; } + } +} \ No newline at end of file diff --git a/bin/Debug/net5.0/font2021.3.0.list b/bin/Debug/net5.0/font2021.3.0.list index 3b8a853..bf08bb5 100644 --- a/bin/Debug/net5.0/font2021.3.0.list +++ b/bin/Debug/net5.0/font2021.3.0.list @@ -486,3 +486,4 @@ Yu Gothic UI C:\WINDOWS\Fonts\YuGothM.ttc Yu Gothic C:\WINDOWS\Fonts\YuGothR.ttc 游ゴシック C:\WINDOWS\Fonts\YuGothR.ttc Yu Gothic UI Semilight C:\WINDOWS\Fonts\YuGothR.ttc +Sans Serif Collection C:\WINDOWS\Fonts\SansSerifCollection.ttf diff --git a/wwwroot/reports/statement_of_equipment.frx b/wwwroot/reports/statement_of_equipment.frx new file mode 100644 index 0000000..b6fc803 --- /dev/null +++ b/wwwroot/reports/statement_of_equipment.frx @@ -0,0 +1,868 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/summary_building_constructions.frx b/wwwroot/reports/summary_building_constructions.frx new file mode 100644 index 0000000..5e5042d --- /dev/null +++ b/wwwroot/reports/summary_building_constructions.frx @@ -0,0 +1,235 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Data2_BeforePrint(object sender, EventArgs e) + { + if (((String)Report.GetColumnValue("summary_building_construction.data.list"))== "รวมก่อสร้างอาคารและปรับปรุงซ่อมแซมต่อเติม" ) + + Data2.FillColor = Color.Gainsboro; + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/summary_of_equipment_5_year.frx b/wwwroot/reports/summary_of_equipment_5_year.frx new file mode 100644 index 0000000..a2b58ac --- /dev/null +++ b/wwwroot/reports/summary_of_equipment_5_year.frx @@ -0,0 +1,184 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Data2_BeforePrint(object sender, EventArgs e) + { + if (((String)Report.GetColumnValue("summary_of_equipment_five_year.data.list"))== "รวมครุภัณฑ์วงเงินทั้งสิ้น" ) + + Data2.FillColor = Color.Gainsboro; + + + if (((String)Report.GetColumnValue("summary_of_equipment_five_year.data.list"))== "ผลผลิตผู้สำเร็จการศึกษาด้านสังคมศาสตร์" ) + + Data2.FillColor = Color.Gainsboro; + if (((String)Report.GetColumnValue("summary_of_equipment_five_year.data.list"))== "คณะบริหารธุรกิจ พื้นที่บพิตรพิมุข จักรวรรดิ" ) + + Data2.FillColor = Color.Gainsboro; + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +