diff --git a/Controllers/RoFive.Controller.cs b/Controllers/RoFive.Controller.cs index 109ea74..3e9571a 100644 --- a/Controllers/RoFive.Controller.cs +++ b/Controllers/RoFive.Controller.cs @@ -10,6 +10,7 @@ using FastReport.Export.OoXML; using FastReport.Export.Pdf; using Microsoft.AspNetCore.Mvc; using rmutr_report.Models; +using rmutr_report.Models.RoThree; using Swashbuckle.AspNetCore.Annotations; namespace rmutr_report.Controllers @@ -544,6 +545,104 @@ namespace rmutr_report.Controllers } + return Ok(); + } + [HttpPost, Route("reports/revenue_estimate_income_summary/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetEstimateIncomeReport([FromRoute] string type, [FromBody] revenue_estimate_income_summary estimate) + { + var s1 = estimate.data.Sum(d => d.science_1); + var s2 = estimate.data.Sum(d => d.social_1); + var s3 = estimate.data.Sum(d => d.science_2); + var s4 = estimate.data.Sum(d => d.social_2); + var s5 = estimate.data.Sum(d => d.total_register_fee); + var s6 = estimate.data.Sum(d => d.science_3); + var s7 = estimate.data.Sum(d => d.social_3); + var s8 = estimate.data.Sum(d => d.science_4); + var s9 = estimate.data.Sum(d => d.social_4); + var s10 = estimate.data.Sum(d => d.total_education_fee); + var s11 = estimate.data.Sum(d => d.total_science); + var s12 = estimate.data.Sum(d => d.total_social); + var s13 = estimate.data.Sum(d => d.total_science_social); + + estimate.sum_1 = s1; + estimate.sum_2 = s2; + estimate.sum_3 = s3; + estimate.sum_4 = s4; + estimate.sum_5 = s5; + estimate.sum_6 = s6; + estimate.sum_7 = s7; + estimate.sum_8 = s8; + estimate.sum_9 = s9; + estimate.sum_10 = s10; + estimate.sum_11 = s11; + estimate.sum_12 = s12; + estimate.sum_13 = s13; + var estimateEducation = new List() { estimate }; + + Report report = new Report(); + report.Load(_setting.report_path + "revenue_estimate_income_summary.frx"); + report.RegisterData(estimateEducation, "revenue_estimate_income_summary"); + 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": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "estimateincome_" + ".xlsx"); + + } + + return Ok(); + } + [HttpPost, Route("reports/revenue_estimate_education_fee/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetEstimateReport([FromRoute] string type, [FromBody] revenue_estimate_education_fee estimate) + { + + var estimateEducation = new List() { estimate }; + + Report report = new Report(); + report.Load(_setting.report_path + "revenue_estimate_education_fee.frx"); + report.RegisterData(estimateEducation, "revenue_estimate_education_fee"); + 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": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "estimateEducation" + ".xlsx"); + + } + return Ok(); } } diff --git a/Fonts/wingding.ttf b/Fonts/wingding.ttf new file mode 100644 index 0000000..e8c4b95 Binary files /dev/null and b/Fonts/wingding.ttf differ diff --git a/Models/RoThree/compensation_head.cs b/Models/RoReport/compensation_head.cs similarity index 100% rename from Models/RoThree/compensation_head.cs rename to Models/RoReport/compensation_head.cs diff --git a/Models/RoThree/material_education.cs b/Models/RoReport/material_education.cs similarity index 100% rename from Models/RoThree/material_education.cs rename to Models/RoReport/material_education.cs diff --git a/Models/RoThree/material_fuel_lubricant.cs b/Models/RoReport/material_fuel_lubricant.cs similarity index 100% rename from Models/RoThree/material_fuel_lubricant.cs rename to Models/RoReport/material_fuel_lubricant.cs diff --git a/Models/RoThree/material_ro_three.cs b/Models/RoReport/material_ro_three.cs similarity index 100% rename from Models/RoThree/material_ro_three.cs rename to Models/RoReport/material_ro_three.cs diff --git a/Models/RoThree/operating_budget_ro_three.cs b/Models/RoReport/operating_budget_ro_three.cs similarity index 100% rename from Models/RoThree/operating_budget_ro_three.cs rename to Models/RoReport/operating_budget_ro_three.cs diff --git a/Models/RoReport/revenue_estimate_education_fee.cs b/Models/RoReport/revenue_estimate_education_fee.cs new file mode 100644 index 0000000..8f9e942 --- /dev/null +++ b/Models/RoReport/revenue_estimate_education_fee.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models.RoThree +{ + public class revenue_estimate_education_fee + { + public string budget_year { get; set; } + public string area { get; set; } + public string faculty { get; set; } + public string semester { get; set; } + public string year { get; set; } + public string budget_project_name_th { get; set; } +public List data_1 { get; set; } +public string side { get; set; } +public decimal? total_curriculum { get; set; } +public decimal? total_revenue { get; set; } + + + } + + public class revenue_estimate_education_fee_detail1 + { + public string curriculum { get; set; } + public List data_2 { get; set; } + + } + public class revenue_estimate_education_fee_detail2 + { + public string year_class { get; set; } + public string code { get; set; } + public decimal? credits_1 { get; set; } + public decimal? credits_2 { get; set; } + public decimal? total_credits { get; set; } + public decimal? register_credits { get; set; } + public string major { get; set; } + public decimal? students { get; set; } + public decimal? education_fee { get; set; } + public decimal? total_education_fee { get; set; } + public decimal? depreciation { get; set; } + public decimal? balance { get; set; } + public decimal? allocation { get; set; } + public decimal? total_allocation_amount { get; set; } + public List data_3 { get; set; } + + + } + public class revenue_estimate_education_fee_detail3 + { + public string topic_code { get; set; } + public string topic { get; set; } + public decimal? credits_1 { get; set; } + public decimal? credits_2 { get; set; } + public decimal? total_credits { get; set; } + public decimal? register_credits { get; set; } + public string major { get; set; } + public decimal? students { get; set; } + public decimal? education_fee { get; set; } + public decimal? total_education_fee { get; set; } + public decimal? depreciation { get; set; } + public decimal? balance { get; set; } + public decimal? allocation { get; set; } + public decimal? total_allocation_amount { get; set; } + } +} \ No newline at end of file diff --git a/Models/RoReport/revenue_estimate_income_summary.cs b/Models/RoReport/revenue_estimate_income_summary.cs new file mode 100644 index 0000000..c12cf39 --- /dev/null +++ b/Models/RoReport/revenue_estimate_income_summary.cs @@ -0,0 +1,55 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models.RoThree +{ + public class revenue_estimate_income_summary + { + public string budget_year { get; set; } + public string date_range { get; set; } + public string area { get; set; } + public string register_semester_year_1 { get; set; } + public string register_semester_year_2 { get; set; } + public string education_semester_year_1 { get; set; } + public string education_semester_year_2 { get; set; } + public List data{ get; set; } + public decimal? sum_1 { get; set; } + public decimal? sum_2 { get; set; } + public decimal? sum_3 { get; set; } + public decimal? sum_4 { get; set; } + public decimal? sum_5 { get; set; } + public decimal? sum_6 { get; set; } + public decimal? sum_7 { get; set; } + public decimal? sum_8 { get; set; } + public decimal? sum_9 { get; set; } + public decimal? sum_10 { get; set; } + public decimal? sum_11 { get; set; } + public decimal? sum_12 { get; set; } + public decimal? sum_13 { get; set; } + public string maker { get; set; } + public string position_maker { get; set; } + public string maker_date { get; set; } + public string test { get; set; } + public string position_test { get; set; } + public string test_date { get; set; } + + } + + public class revenue_estimate_income_summary_detail + { + public string faculty { get; set; } + public decimal? science_1 { get; set; } + public decimal? social_1 { get; set; } + public decimal? science_2 { get; set; } + public decimal? social_2 { get; set; } + public decimal? total_register_fee { get; set; } + public decimal? science_3 { get; set; } + public decimal? social_3 { get; set; } + public decimal? science_4 { get; set; } + public decimal? social_4 { get; set; } + public decimal? total_education_fee { get; set; } + public decimal? total_science { get; set; } + public decimal? total_social { get; set; } + public decimal? total_science_social { get; set; } + + } +} \ No newline at end of file diff --git a/Models/RoReport/revenue_estimate_register_credits.cs b/Models/RoReport/revenue_estimate_register_credits.cs new file mode 100644 index 0000000..dba5898 --- /dev/null +++ b/Models/RoReport/revenue_estimate_register_credits.cs @@ -0,0 +1,7 @@ +namespace rmutr_report.Models.RoThree +{ + public class revenue_estimate_register_credits + { + + } +} \ No newline at end of file diff --git a/Models/RoThree/teaching_fee_ro_three.cs b/Models/RoReport/teaching_fee_ro_three.cs similarity index 100% rename from Models/RoThree/teaching_fee_ro_three.cs rename to Models/RoReport/teaching_fee_ro_three.cs diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 46bd542..bb28814 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 203e991..a87cec6 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.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 963f381..344c763 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -f31ba1af0ba6d1ef2356e60b405023ff1b260a7a +78da8d1f09865b4dbb055f9d21ffa040046ab4d4 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 46bd542..bb28814 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 203e991..a87cec6 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/personnel_salary_permanent.frx b/wwwroot/reports/personnel_salary_permanent.frx deleted file mode 100644 index f887dd9..0000000 --- a/wwwroot/reports/personnel_salary_permanent.frx +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wwwroot/reports/personnel_table_1.frx b/wwwroot/reports/personnel_table_1.frx new file mode 100644 index 0000000..ae6fa42 --- /dev/null +++ b/wwwroot/reports/personnel_table_1.frx @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/revenue_estimate_education_fee.frx b/wwwroot/reports/revenue_estimate_education_fee.frx new file mode 100644 index 0000000..93ea39a --- /dev/null +++ b/wwwroot/reports/revenue_estimate_education_fee.frx @@ -0,0 +1,438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/revenue_estimate_income_summary.frx b/wwwroot/reports/revenue_estimate_income_summary.frx new file mode 100644 index 0000000..8bda882 --- /dev/null +++ b/wwwroot/reports/revenue_estimate_income_summary.frx @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +