diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index 5d69502..be86f6a 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -12,6 +12,7 @@ using FastReport.Export.Pdf; using Microsoft.AspNetCore.Mvc; using rmutr_report.Models; using rmutr_report.Models.Personnel; +using rmutr_report.Models.RoThree; using Swashbuckle.AspNetCore.Annotations; namespace rmutr_report.Controllers @@ -3592,7 +3593,7 @@ namespace rmutr_report.Controllers public IActionResult GetBudgetAllocationReport([FromRoute] string type, [FromBody] estimate_income_expenses budget) { - + var summaryBudget = new List() { budget }; Report report = new Report(); @@ -3620,6 +3621,93 @@ namespace rmutr_report.Controllers "summary_income_allocation" + ".xlsx"); } + return Ok(); + } + [SwaggerOperation("รวมทุกแผน")] + [HttpPost, Route("reports/request_summary_all_plans/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetBudgetRequestSummaryReport([FromRoute] string type, + [FromBody] request_summary requestSummary) + { + int row = 1; + foreach (var requestSummaryDetail in requestSummary.data_1) + { + requestSummaryDetail.rowno = row.ToString(); + row++; + } + + + requestSummary.short_budget_year = requestSummary.budget_year.Substring(2, 2); + var requestSummaries = new List() { requestSummary }; + + Report report = new Report(); + report.Load(_setting.report_path + "all_plans.frx"); + report.RegisterData(requestSummaries, "request_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", + "request_summary" + ".xlsx"); + } + + return Ok(); + } + [SwaggerOperation("แผนบูรณาการแผนยุทธศาสตร์")] + [HttpPost, Route("reports/request_summary_integrated_strategic/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetBudgetRequestSummary2Report([FromRoute] string type, + [FromBody] request_summary requestSummary) + { + requestSummary.short_budget_year = requestSummary.budget_year.Substring(2, 2); + int row = 1; + foreach (var requestSummaryDetail in requestSummary.data_1) + { + requestSummaryDetail.rowno = row.ToString(); + row++; + } + + var requestSummaries = new List() { requestSummary }; + + Report report = new Report(); + report.Load(_setting.report_path + "integrated_strategic.frx"); + report.RegisterData(requestSummaries, "request_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", + "request_summary" + ".xlsx"); + } + return Ok(); } } diff --git a/Models/budget/request_summary.cs b/Models/budget/request_summary.cs new file mode 100644 index 0000000..4cf47b0 --- /dev/null +++ b/Models/budget/request_summary.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models.RoThree +{ + public class request_summary + { + public string budget_year { get; set; } + public string short_budget_year { get; set; } + public decimal? total_amount_1 { get; set; } + public decimal? total_amount_2 { get; set; } + public decimal? total_amount_3 { get; set; } + public decimal? total_amount_4 { get; set; } + public decimal? total_amount_5 { get; set; } + public decimal? total_amount_6 { get; set; } + public decimal? total_amount_7 { get; set; } + public decimal? total_amount_8 { get; set; } + public decimal? total_amount_9 { get; set; } + public decimal? total_amount_10 { get; set; } + public decimal? total_amount_11 { get; set; } + public decimal? total_amount_12 { get; set; } + public decimal? total_amount_13 { get; set; } + public decimal? total_amount_14 { get; set; } + public List data_1 { get; set; } + } + + public class request_summary_detail + { + public string rowno { get; set; } + public string list { get; set; } + public decimal? amount_1 { get; set; } + public decimal? amount_2 { get; set; } + public decimal? amount_3{ get; set; } + public decimal? amount_4 { get; set; } + public decimal? amount_5 { get; set; } + public decimal? amount_6 { get; set; } + public decimal? amount_7 { get; set; } + public decimal? amount_8 { get; set; } + public decimal? amount_9 { get; set; } + public decimal? amount_10 { get; set; } + public decimal? amount_11 { get; set; } + public decimal? amount_12 { get; set; } + public decimal? amount_13 { get; set; } + public decimal? amount_14 { get; set; } + public List data_2 { get; set; } + } + + public class request_summary_detail2 + { + public string rowno { get; set; } + public string list { get; set; } + public decimal? amount_1 { get; set; } + public decimal? amount_2 { get; set; } + public decimal? amount_3{ get; set; } + public decimal? amount_4 { get; set; } + public decimal? amount_5 { get; set; } + public decimal? amount_6 { get; set; } + public decimal? amount_7 { get; set; } + public decimal? amount_8 { get; set; } + public decimal? amount_9 { get; set; } + public decimal? amount_10 { get; set; } + public decimal? amount_11 { get; set; } + public decimal? amount_12 { get; set; } + public decimal? amount_13 { get; set; } + public decimal? amount_14 { get; set; } + public bool? is_bold { get; set; } + public string color { get; set; } + public List data_3 { get; set; } + } + + public class request_summary_detail3 + { + public string rowno { get; set; } + public string list { get; set; } + public decimal? amount_1 { get; set; } + public decimal? amount_2 { get; set; } + public decimal? amount_3{ get; set; } + public decimal? amount_4 { get; set; } + public decimal? amount_5 { get; set; } + public decimal? amount_6 { get; set; } + public decimal? amount_7 { get; set; } + public decimal? amount_8 { get; set; } + public decimal? amount_9 { get; set; } + public decimal? amount_10 { get; set; } + public decimal? amount_11 { get; set; } + public decimal? amount_12 { get; set; } + public decimal? amount_13 { get; set; } + public decimal? amount_14 { get; set; } + public bool? is_bold { get; set; } + } + +} \ No newline at end of file diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index d6ee498..84ee301 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 ecd9910..e8bb0f3 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/rmutr_report.AssemblyInfo.cs b/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs index a5afe2e..be330f1 100644 --- a/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs +++ b/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8f6a0b8c14684a10aba8a1bca94dac283d2e20ac")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8e90a5c766b33cdcf3981c372f01427aaa5d3406")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache b/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache index 2230109..d9da499 100644 --- a/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -bfe575db8eb0a6ce7878fd59debeaf9f2f023ec0e656b8f34fd9a877f6d9582f +e37de4c61d17f22f08c2b24c318ca3d8a5a1773c972482481d0c902920608456 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs index a5afe2e..be330f1 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs +++ b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8f6a0b8c14684a10aba8a1bca94dac283d2e20ac")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8e90a5c766b33cdcf3981c372f01427aaa5d3406")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache index 2230109..d9da499 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -bfe575db8eb0a6ce7878fd59debeaf9f2f023ec0e656b8f34fd9a877f6d9582f +e37de4c61d17f22f08c2b24c318ca3d8a5a1773c972482481d0c902920608456 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache index b15da3e..6b0a0db 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache @@ -1 +1 @@ -377111b3d1b7031d608d1278d8658e8b6f6ca9b2350700b1322226a3d0c15520 +dd01d0f6621f13fc6c7fdcdb9dd7e1054e3bb54fde4920b3b953636d89a59d30 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 4d44606..eb22f13 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -fde8a6f63407284f2bcd1c9b0bb1eb123543982b9dc3ae00f91bf72ae5c98bcf +2a87f4d099a984a0e9253410e6f4597f90c3d03ecbe20d28d0efc2bffc02a7bc diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index d6ee498..84ee301 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 ecd9910..e8bb0f3 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/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props b/obj/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props index bf5e9e1..3ba72c9 100644 --- a/obj/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props +++ b/obj/Debug/netcoreapp3.1/staticwebassets/msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props @@ -48,6 +48,38 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\academic_position_leave_graph.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\all_plans.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\all_plans.frx)) + + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\all_plans2.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\all_plans2.frx)) + Package rmutr_report @@ -864,6 +896,22 @@ PreserveNewest $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\hr_summary_study_leave.frx)) + + Package + rmutr_report + $(MSBuildThisFileDirectory)..\staticwebassets\ + _content/rmutr_report + reports\integrated_strategic.frx + + + + + + + + PreserveNewest + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\staticwebassets\reports\integrated_strategic.frx)) + Package rmutr_report diff --git a/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache b/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache index f7c5d6b..36f4c70 100644 --- a/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache +++ b/obj/Debug/netcoreapp3.1/staticwebassets/rmutr_report.StaticWebAssets.Pack.cache @@ -1 +1 @@ -33814906f52e0f8cfd7bb5360baea6c562ab42de0f2574d78acf3490ba1b4515 +5e2b0a0b0aae1729058a1b869c574d0d8376900c6cb993c5031e219c517c5065 diff --git a/obj/rider.project.model.nuget.info b/obj/rider.project.model.nuget.info index 4c7c633..e08e49c 100644 --- a/obj/rider.project.model.nuget.info +++ b/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17246480032464415 \ No newline at end of file +17246648982055188 \ No newline at end of file diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index 8858570..346ea57 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -17246485221009095 \ No newline at end of file +17246762284769178 \ No newline at end of file diff --git a/wwwroot/reports/all_plans.frx b/wwwroot/reports/all_plans.frx new file mode 100644 index 0000000..c1f2ec1 --- /dev/null +++ b/wwwroot/reports/all_plans.frx @@ -0,0 +1,573 @@ + + + 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_AfterPrint(object sender, EventArgs e) + // { + // if ((String)Report.GetColumnValue("request_summary.data_1.data_2.color"))=="1" + // Data2.FillColor = Color.blue; + // } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/integrated_strategic.frx b/wwwroot/reports/integrated_strategic.frx new file mode 100644 index 0000000..d74dee9 --- /dev/null +++ b/wwwroot/reports/integrated_strategic.frx @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +