diff --git a/Controllers/MultiplierDetails.Controller.cs b/Controllers/MultiplierDetails.Controller.cs new file mode 100644 index 0000000..8653381 --- /dev/null +++ b/Controllers/MultiplierDetails.Controller.cs @@ -0,0 +1,202 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using FastReport; +using FastReport.Export.Csv; +using FastReport.Export.Mht; +using FastReport.Export.OoXML; +using FastReport.Export.Pdf; +using Microsoft.AspNetCore.Mvc; +using rmutr_report.Models; +using Swashbuckle.AspNetCore.Annotations; + +namespace rmutr_report.Controllers +{ + [SwaggerTag("สำหรับรายงานรายละเอียดแยกตัวคูณ")] + public class MultiplierDetails: Controller + { + readonly Setting _setting; + + public MultiplierDetails(Setting setting) + { + this._setting = setting; + } + [HttpPost, Route("reports/expenditure_budget_proposal/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetExpendReport([FromRoute] string type, [FromBody] expenditure_budget_proposal budget_summary_reports) + { + var _budget_summary_report = new List() { budget_summary_reports }; + + Report report = new Report(); + report.Load(_setting.report_path + "expenditure_budget_proposal.frx"); + report.RegisterData(_budget_summary_report, "expenditure_budget_proposal"); + 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.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_excess_tuitionfee_science/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetExpendReport([FromRoute] string type, [FromBody] summary_excess_tuitionfee budget_summary_reports) + { + var _budget_summary_report = new List() { budget_summary_reports }; + + Report report = new Report(); + report.Load(_setting.report_path + "summary_excess_tuition.frx"); + report.RegisterData(_budget_summary_report, "summary_excess_tuitionfee"); + 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.ms-excel"); + break; + + } + + return Ok(); + } + [HttpPost, Route("reports/summary_excess_tuitionfee_social/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetExpend2Report([FromRoute] string type, [FromBody] summary_excess_tuitionfee budget_summary_reports) + { + var _budget_summary_report = new List() { budget_summary_reports }; + + Report report = new Report(); + report.Load(_setting.report_path + "summary_excess_tuition2.frx"); + report.RegisterData(_budget_summary_report, "summary_excess_tuitionfee"); + 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.ms-excel"); + break; + + } + + return Ok(); + } + [HttpPost, Route("reports/service_fee/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetExpend3Report([FromRoute] string type, [FromBody] service_fee budget_summary_reports) + { + var s1 = budget_summary_reports.data.Sum(d => d.wage_rate_science); + var s2 = budget_summary_reports.data.Sum(d => d.wage_rate_social); + budget_summary_reports.total_amount_1 = s1; + budget_summary_reports.total_amount_2 = s2; + budget_summary_reports.total_amount_all = budget_summary_reports.total_amount_1 + budget_summary_reports.total_amount_2; + + var _budget_summary_report = new List() { budget_summary_reports }; + + Report report = new Report(); + report.Load(_setting.report_path + "service_fee.frx"); + report.RegisterData(_budget_summary_report, "service_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.ms-excel"); + break; + + } + + return Ok(); + } + + [HttpPost, Route("reports/car_insurance/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetExpend4Report([FromRoute] string type, [FromBody] car_insurance budget_summary_reports) + { + var ss = budget_summary_reports.group_header.Sum(f => f.data.Sum(g => g.data_detail.Sum(h => h.amount))); + budget_summary_reports.total_amount_all = ss; + var _budget_summary_report = new List() { budget_summary_reports }; + + Report report = new Report(); + report.Load(_setting.report_path + "car_insurance.frx"); + report.RegisterData(_budget_summary_report, "car_insurance"); + 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.ms-excel"); + break; + + } + + return Ok(); + } + + } +} \ No newline at end of file diff --git a/Models/budget/car_insurance.cs b/Models/budget/car_insurance.cs new file mode 100644 index 0000000..5bf8bd3 --- /dev/null +++ b/Models/budget/car_insurance.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class car_insurance{ + public string budget_year { get; set; } + public string car_insurance_year { get; set; } + public decimal? total_amount_all { get; set; } + public List group_header { get; set; } + +} + +public class area_group_headers +{ + public string area { get; set; } + + public List data { get; set; } + +} + +public class car_insurance_detail +{ + public string list { get; set; } + public List data_detail { get; set; } + +} + +public class car_insurance_detail2 +{ + public string list { get; set; } + public string unit { get; set; } + public string pay_month { get; set; } + public decimal? amount { get; set; } + +} +} \ No newline at end of file diff --git a/Models/budget/expenditure_budget_proposal.cs b/Models/budget/expenditure_budget_proposal.cs new file mode 100644 index 0000000..a225aa5 --- /dev/null +++ b/Models/budget/expenditure_budget_proposal.cs @@ -0,0 +1,68 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class expenditure_budget_proposal + { + public string budget_year { get; set; } + // public decimal? budget_amount { get; set; } + // public decimal? total_amount_1 { get; set; } + // public decimal? total_amount_2 { get; set; } + public List group_header { get; set; } + + } + + public class group_headers + { + public string list_1 { get; set; } + public string list_2 { get; set; } + public string rowno { get; set; } + public string list_3 { get; set; } + public decimal? budget_amount { get; set; } + public decimal? total_amount_1 { get; set; } + public decimal? total_amount_2 { get; set; } + public List header { get; set; } + + } + + public class expenditure_budget_proposal_headers + { + public string rowno { get; set; } + public string header { get; set; } + public decimal? budget_amount { get; set; } + public List data { get; set; } + + + } + + public class expenditure_budget_proposal_headers2 + { + public string list { get; set; } + public decimal? target_group_count { get; set; } + public string target_group_unit { get; set; } + public decimal? time_count { get; set; } + public string time_unit { get; set; } + public decimal? budget_count { get; set; } + public string budget_unit { get; set; } + public decimal? quantity { get; set; } + public string quantity_unit { get; set; } + public decimal? budget_amount { get; set; } + public List data2 { get; set; } + + + } + + public class expenditure_budget_proposal_headers3 + { + public string list { get; set; } + public decimal? target_group_count { get; set; } + public string target_group_unit { get; set; } + public decimal? time_count { get; set; } + public string time_unit { get; set; } + public decimal? budget_count { get; set; } + public string budget_unit { get; set; } + public decimal? quantity { get; set; } + public string quantity_unit { get; set; } + public decimal? budget_amount { get; set; } + } +} \ No newline at end of file diff --git a/Models/budget/service_fee.cs b/Models/budget/service_fee.cs new file mode 100644 index 0000000..b7ce9ce --- /dev/null +++ b/Models/budget/service_fee.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class service_fee + { + public decimal? total_amount_1 { get; set; } + public decimal? total_amount_2 { get; set; } + public decimal? total_amount_all { get; set; } + public List data { get; set; } + + } + + public class service_fee_detail + { + public string agency { get; set; } + public string list { get; set; } + public decimal? wage_rate_science { get; set; } + public decimal? wage_rate_social { get; set; } + + } +} \ No newline at end of file diff --git a/Models/budget/summary_excess_tuitionfee.cs b/Models/budget/summary_excess_tuitionfee.cs new file mode 100644 index 0000000..4275569 --- /dev/null +++ b/Models/budget/summary_excess_tuitionfee.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class summary_excess_tuitionfee + { + public string academic_year_name_th1 { get; set; } + public string academic_year_name_th2 { get; set; } + public string academic_semester_name_th1 { get; set; } + public string academic_semester_name_th2 { get; set; } + public List data { get; set; } + //public List data_detail { get; set; } + + public decimal? pertype1 { get; set; } + public decimal? teaching_hours_workload1 { get; set; } + public decimal? tuition_rate1 { get; set; } + public decimal? amount1 { get; set; } + public decimal? pertype2 { get; set; } + public decimal? teaching_hours_workload2 { get; set; } + public decimal? tuition_rate2 { get; set; } + public decimal? amount2 { get; set; } + public decimal? total_amount { get; set; } + } + + + public class summary_excess_tuitionfee_detail + { + public string faculty { get; set; } + public decimal? pertype1 { get; set; } + public decimal? teaching_hours_workload1 { get; set; } + public decimal? tuition_rate1 { get; set; } + public decimal? amount1 { get; set; } + public decimal? pertype2 { get; set; } + public decimal? teaching_hours_workload2 { get; set; } + public decimal? tuition_rate2 { get; set; } + public decimal? amount2 { get; set; } + public decimal? total_amount { get; set; } + public string remark { get; set; } + public List data_detail { get; set; } + public List data1 { get; set; } + + + } + public class summary_excess_tuitionfee_detail2{ + public string sub_name { get; set; } + public decimal? pertype1 { get; set; } + public decimal? teaching_hours_workload1 { get; set; } + public decimal? tuition_rate1 { get; set; } + public decimal? amount1 { get; set; } + public decimal? pertype2 { get; set; } + public decimal? teaching_hours_workload2 { get; set; } + public decimal? tuition_rate2 { get; set; } + public decimal? amount2 { get; set; } + public decimal? total_amount { get; set; } + public string remark { get; set; } + } + public class summary_excess_tuitionfee_details + { + public string faculty { get; set; } + public decimal? pertype1 { get; set; } + public decimal? teaching_hours_workload1 { get; set; } + public decimal? tuition_rate1 { get; set; } + public decimal? amount1 { get; set; } + public decimal? pertype2 { get; set; } + public decimal? teaching_hours_workload2 { get; set; } + public decimal? tuition_rate2 { get; set; } + public decimal? amount2 { get; set; } + public decimal? total_amount { get; set; } + public string remark { get; set; } + } +} \ No newline at end of file diff --git a/bin/Debug/net5.0/rmutr-report.dll b/bin/Debug/net5.0/rmutr-report.dll index 964371f..7f8e6e7 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 88eb136..ebe6fa4 100644 Binary files a/bin/Debug/net5.0/rmutr-report.pdb and b/bin/Debug/net5.0/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 38527c2..d8c6428 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 38527c2..d8c6428 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.csproj.CoreCompileInputs.cache b/obj/Debug/net5.0/rmutr-report.csproj.CoreCompileInputs.cache index 173d976..6b9ddf0 100644 --- a/obj/Debug/net5.0/rmutr-report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net5.0/rmutr-report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -953bf99eff308035779e1eaadb6c497ed13331bb +fd3e7cbd0b298300a8f9594e98013d068c4edd53 diff --git a/obj/Debug/net5.0/rmutr-report.dll b/obj/Debug/net5.0/rmutr-report.dll index 964371f..7f8e6e7 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 88eb136..ebe6fa4 100644 Binary files a/obj/Debug/net5.0/rmutr-report.pdb and b/obj/Debug/net5.0/rmutr-report.pdb differ diff --git a/wwwroot/reports/car_insurance.frx b/wwwroot/reports/car_insurance.frx new file mode 100644 index 0000000..c8b4fc3 --- /dev/null +++ b/wwwroot/reports/car_insurance.frx @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/expenditure_budget_proposal.frx b/wwwroot/reports/expenditure_budget_proposal.frx new file mode 100644 index 0000000..214921d --- /dev/null +++ b/wwwroot/reports/expenditure_budget_proposal.frx @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/service_fee.frx b/wwwroot/reports/service_fee.frx new file mode 100644 index 0000000..9fc870b --- /dev/null +++ b/wwwroot/reports/service_fee.frx @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/summary_excess_tuition.frx b/wwwroot/reports/summary_excess_tuition.frx new file mode 100644 index 0000000..1033a6b --- /dev/null +++ b/wwwroot/reports/summary_excess_tuition.frx @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/summary_excess_tuition2.frx b/wwwroot/reports/summary_excess_tuition2.frx new file mode 100644 index 0000000..7409571 --- /dev/null +++ b/wwwroot/reports/summary_excess_tuition2.frx @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +