diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index 5c093de..3a86278 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using System.Globalization; +using System.ComponentModel; using System.IO; using System.Linq; using ClosedXML.Excel; @@ -11,7 +11,6 @@ using FastReport.Export.OoXML; using FastReport.Export.Pdf; using Microsoft.AspNetCore.Mvc; using rmutr_report.Models; -using rmutr_report.Models.Hr; using rmutr_report.Models.Personnel; using Swashbuckle.AspNetCore.Annotations; @@ -24,9 +23,9 @@ namespace rmutr_report.Controllers public Budget(Setting setting) { - this._setting = setting; + _setting = setting; } - + [SwaggerOperation(Summary = "รายงานงบประมาณแยกตามพื้นที่")] [HttpPost, Route("reports/budget_report/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSum1Report([FromRoute] string type, [FromBody] List budget_reports) @@ -81,7 +80,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation(Summary = "รายงานสรุปงบประมาณรายจ่าย")] [HttpPost, Route("reports/budget_summary_report/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumReport([FromRoute] string type, @@ -245,7 +244,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("สรุปรายการสิ่งก่อสร้างที่เสนอขอ")] [HttpPost, Route("reports/summary_building_table/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumbuildingReport([FromRoute] string type, @@ -307,7 +306,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("สรุปรายการครุภัณฑ์ที่เสนอขอ")] [HttpPost, Route("reports/summary_durable_articles_table/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumDurableArticlesReport([FromRoute] string type, @@ -352,7 +351,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("ตารางและรายงานสรุปคำขอในส่วนของโครงการทั้งหมด")] [HttpPost, Route("reports/summary_all_project_table/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumAllProjectReport([FromRoute] string type, @@ -397,7 +396,7 @@ namespace rmutr_report.Controllers return Ok(); } - +[SwaggerOperation("สรุปการเสนอของบประมาณโครงการประจำปีงบประมาณ")] [HttpPost, Route("reports/summary_project_budget_proposals/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumPReport([FromRoute] string type, [FromBody] summary_project_budget_proposals eleven) @@ -450,7 +449,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("งบประมาณแผ่นดิน พื้นฐาน")] [HttpPost, Route("reports/basic_plan/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBasicPlanReport([FromRoute] string type, @@ -770,7 +769,7 @@ namespace rmutr_report.Controllers return Ok(); } } - + [SwaggerOperation("งบประมาณแผ่นดิน แผนบูรณาการ+แผนยุทธศาสตร์")] [HttpPost, Route("reports/integration_strategic_plan/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetInStrPlanReport([FromRoute] string type, @@ -1164,7 +1163,7 @@ namespace rmutr_report.Controllers "integration_strategic_plan_" + date + ".xlsx"); } } - + [SwaggerOperation("งบประมาณแผ่นดิน รวมทุกแผน")] [HttpPost, Route("reports/basic_plan_all/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBasicPlanAllReport([FromRoute] string type, @@ -1706,7 +1705,7 @@ namespace rmutr_report.Controllers "basic_plan_all_" + date + ".xlsx"); } } - + [SwaggerOperation("ตารางสรุปประเด็นยุทธศาสตร์ เป้าหมายหลัก ตัวชี้วัดและกลยุทธ์")] [HttpPost, Route("reports/summary_strategic/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumStrategicReport([FromRoute] string type, @@ -1744,7 +1743,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("ร.15 ประมาณการรายรับจากการจัดการศึกษา")] [HttpPost, Route("reports/budget_expenditure_from_revenue/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBudgetReport([FromRoute] string type, @@ -1968,7 +1967,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("สรุปรายรับและจัดสรรตามเกณฑ์")] [HttpPost, Route("reports/revenue_estimates/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetRevenueEstimatesReport([FromRoute] string type, @@ -2432,7 +2431,7 @@ namespace rmutr_report.Controllers "revenue_estimates_" + date + ".xlsx"); } } - + [SwaggerOperation("ตารางสรุปงบประมาณประจำปี แยกตามผลผลิตของมหาวิทยาลัย")] [HttpPost, Route("reports/summary_budget_university/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetSumBudgetUniReport([FromRoute] string type, @@ -2469,7 +2468,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("แผนงานบุคลากรภาครัฐ")] [HttpPost, Route("reports/budget_expenditure_report_from_revenue/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBudgetExpenditureRevenueReport([FromRoute] string type, @@ -2512,6 +2511,7 @@ namespace rmutr_report.Controllers return Ok(); } + [SwaggerOperation("สรุปงบประมาณแผนปฏิบัติราชการประจำปี")] [HttpPost, Route("reports/summary_government_budget_plan/{type}")] [ApiExplorerSettings(GroupName = "reports")] @@ -2656,7 +2656,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("แผนงาน/ผลผลิตของมหาวิทยาลัยฯ")] [HttpPost, Route("reports/budget_projects/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBudgetProjectsReport([FromRoute] string type, @@ -2693,7 +2693,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("ข้อมูลงบประมาณเงินแผ่นดิน งบประมาณเงินรายได้")] [HttpPost, Route("reports/total_budget/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBudgetTotalReport([FromRoute] string type, @@ -2731,7 +2731,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("งบประมาณรายจ่ายจากเงินรายได้ งบเงินอุดหนุน")] [HttpPost, Route("reports/summary_subsidy_projects/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetBudgetSubsidySummaryReport([FromRoute] string type, @@ -2785,6 +2785,314 @@ namespace rmutr_report.Controllers "project_summary_subsidy" + ".xlsx"); } + return Ok(); + } + [SwaggerOperation("ตารางเป้าหมายผลผลิต")] + [HttpPost, Route("reports/target_budget_project/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetTargetBudgetReport([FromRoute] string type, + [FromBody] List targetBudgetProjectsbudget) + { + + Report report = new Report(); + report.Load(_setting.report_path + "target_budget_project.frx"); + report.RegisterData(targetBudgetProjectsbudget, "target_budget_project"); + 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", + "target_budget_project" + ".xlsx"); + } + + return Ok(); + } + [SwaggerOperation("แผนการรับนักศึกษา")] + [HttpPost, Route("reports/student_admission_plan/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetStdAdmissionReport([FromRoute] string type, + [FromBody] student_admission_plan studentAdmission) + { + if (studentAdmission.student_type_code==1) + { + studentAdmission.student_type_name = "นักศึกษารับใหม่"; + studentAdmission.text = "ภาคสมทบ"; + } + if (studentAdmission.student_type_code==2) + { + studentAdmission.student_type_name = "นักศึกษาทั้งหมด"; + studentAdmission.text = "ภาคสมทบ/ภาคพิเศษ"; + } + if (studentAdmission.student_type_code==3) + { + studentAdmission.student_type_name = "นักศึกษาสำเร็จ"; + studentAdmission.text = "ภาคสมทบ/ภาคพิเศษ"; + } + foreach (var detail in studentAdmission.data) + { + if (detail.topic_type == 4) + { + detail.topic = "- "+detail.topic; + } + + } + var studentAdmissionPlans = new List() { studentAdmission }; + Report report = new Report(); + report.Load(_setting.report_path + "student_admission_plan.frx"); + report.RegisterData(studentAdmissionPlans, "student_admission_plan"); + 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", + "student_admission_plan" + ".xlsx"); + } + + return Ok(); + } + [SwaggerOperation("รายงานภาพรวมนักศึกษา")] + [HttpPost, Route("reports/student_overview/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetStdoverviewReport([FromRoute] string type, + [FromBody] student_overview studentOverview) + { + if (studentOverview.student_type_code==1) + { + studentOverview.student_type_name = "นักศึกษาทั้งหมด"; + } + if (studentOverview.student_type_code==2) + { + studentOverview.student_type_name = "นักศึกษารับใหม่"; + } + if (studentOverview.student_type_code==3) + { + studentOverview.student_type_name = "นักศึกษาสำเร็จ"; + } + if (studentOverview.student_type_code==4) + { + studentOverview.student_type_name = "นักศึกษาปกติทั้งหมด"; + } + if (studentOverview.student_type_code==5) + { + studentOverview.student_type_name = "นักศึกษาปกติรับใหม่"; + } + if (studentOverview.student_type_code==6) + { + studentOverview.student_type_name = "นักศึกษาปกติสำเร็จ"; + } + if (studentOverview.student_type_code==7) + { + studentOverview.student_type_name = "นักศึกษาสมทบ/พิเศษทั้งหมด"; + } + if (studentOverview.student_type_code==8) + { + studentOverview.student_type_name = "นักศึกษาสมทบ/พิเศษรับใหม่"; + } + if (studentOverview.student_type_code==9) + { + studentOverview.student_type_name = "นักศึกษาสมทบ/พิเศษสำเร็จ"; + } + + var sum1 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_science_1); + var sum2 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_social_1); + var sum3 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_total_1); + var sum4 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_science_1); + var sum5 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_social_1); + var sum6 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_total_1); + var sum7 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_science_1); + var sum8 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_social_1); + var sum9 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_total_1); + var sum10 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_science_1); + var sum11 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_social_1); + var sum12 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_1); + var sum13 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_science_2); + var sum14 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_social_2); + var sum15 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_total_2); + var sum16 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_science_2); + var sum17 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_social_2); + var sum18 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_total_2); + var sum19 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_science_2); + var sum20 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_social_2); + var sum21 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_total_2); + var sum22 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_science_2); + var sum23 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_social_2); + var sum24 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_2); + var sum25 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_science_3); + var sum26 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_social_3); + var sum27 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_total_3); + var sum28 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_science_3); + var sum29 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_social_3); + var sum30 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_total_3); + var sum31 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_science_3); + var sum32 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_social_3); + var sum33 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_total_3); + var sum34 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_science_3); + var sum35 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_social_3); + var sum36 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_3); + var sum37 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_science_4); + var sum38 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_social_4); + var sum39 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_total_4); + var sum40 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_science_4); + var sum41 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_social_4); + var sum42 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_total_4); + var sum43 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_science_4); + var sum44 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_social_4); + var sum45 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_total_4); + var sum46 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_science_4); + var sum47 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_social_4); + var sum48 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_4); + var sum49 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_science_5); + var sum50 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_social_5); + var sum51 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_total_5); + var sum52 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_science_5); + var sum53 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_social_5); + var sum54 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_total_5); + var sum55 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_science_5); + var sum56 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_social_5); + var sum57 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_total_5); + var sum58 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_science_5); + var sum59 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_social_5); + var sum60 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_5); + var sum61 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_science_6); + var sum62 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_social_6); + var sum63 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ba_degree_total_6); + var sum64 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_science_6); + var sum65 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_social_6); + var sum66 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.ma_degree_total_6); + var sum67 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_science_6); + var sum68 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_social_6); + var sum69 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.doctor_degree_total_6); + var sum70 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_science_6); + var sum71 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_social_6); + var sum72 = studentOverview.data.Where(g=>g.topic_type==1).Sum(d => d.total_6); + + studentOverview.ba_degree_science_1 = sum1; + studentOverview.ba_degree_social_1 = sum2; + studentOverview.ba_degree_total_1 = sum3; + studentOverview.ma_degree_science_1 = sum4; + studentOverview.ma_degree_social_1 = sum5; + studentOverview.ma_degree_total_1 = sum6; + studentOverview.doctor_degree_science_1 = sum7; + studentOverview.doctor_degree_social_1 = sum8; + studentOverview.doctor_degree_total_1 = sum9; + studentOverview.total_science_1 = sum10; + studentOverview.total_social_1 = sum11; + studentOverview.total_1 = sum12; + + studentOverview.ba_degree_science_2 = sum13; + studentOverview.ba_degree_social_2 = sum14; + studentOverview.ba_degree_total_2 = sum15; + studentOverview.ma_degree_science_2 = sum16; + studentOverview.ma_degree_social_2 = sum17; + studentOverview.ma_degree_total_2 = sum18; + studentOverview.doctor_degree_science_2 = sum19; + studentOverview.doctor_degree_social_2 = sum20; + studentOverview.doctor_degree_total_2 = sum21; + studentOverview.total_science_2 = sum22; + studentOverview.total_social_2 = sum23; + studentOverview.total_2 = sum24; + studentOverview.ba_degree_science_3 = sum25; + studentOverview.ba_degree_social_3 = sum26; + studentOverview.ba_degree_total_3 = sum27; + studentOverview.ma_degree_science_3 = sum28; + studentOverview.ma_degree_social_3 = sum29; + studentOverview.ma_degree_total_3 = sum30; + studentOverview.doctor_degree_science_3 = sum31; + studentOverview.doctor_degree_social_3 = sum32; + studentOverview.doctor_degree_total_3 = sum33; + studentOverview.total_science_3 = sum34; + studentOverview.total_social_3 = sum35; + studentOverview.total_3 = sum36; + studentOverview.ba_degree_science_4 = sum37; + studentOverview.ba_degree_social_4 = sum38; + studentOverview.ba_degree_total_4 = sum39; + studentOverview.ma_degree_science_4 = sum40; + studentOverview.ma_degree_social_4 = sum41; + studentOverview.ma_degree_total_4 = sum42; + studentOverview.doctor_degree_science_4 = sum43; + studentOverview.doctor_degree_social_4 = sum44; + studentOverview.doctor_degree_total_4 = sum45; + studentOverview.total_science_4 = sum46; + studentOverview.total_social_4 = sum47; + studentOverview.total_4 = sum48; + studentOverview.ba_degree_science_5 = sum49; + studentOverview.ba_degree_social_5 = sum50; + studentOverview.ba_degree_total_5 = sum51; + studentOverview.ma_degree_science_5 = sum52; + studentOverview.ma_degree_social_5 = sum53; + studentOverview.ma_degree_total_5 = sum54; + studentOverview.doctor_degree_science_5 = sum55; + studentOverview.doctor_degree_social_5 = sum56; + studentOverview.doctor_degree_total_5 = sum57; + studentOverview.total_science_5 = sum58; + studentOverview.total_social_5 = sum59; + studentOverview.total_5 = sum60; + studentOverview.ba_degree_science_6 = sum61; + studentOverview.ba_degree_social_6 = sum62; + studentOverview.ba_degree_total_6 = sum63; + studentOverview.ma_degree_science_6 = sum64; + studentOverview.ma_degree_social_6 = sum65; + studentOverview.ma_degree_total_6 = sum66; + studentOverview.doctor_degree_science_6 = sum67; + studentOverview.doctor_degree_social_6 = sum68; + studentOverview.doctor_degree_total_6 = sum69; + studentOverview.total_science_6 = sum70; + studentOverview.total_social_6 = sum71; + studentOverview.total_6 = sum72; + var studentOverviews = new List() { studentOverview }; + Report report = new Report(); + report.Load(_setting.report_path + "student_overview.frx"); + report.RegisterData(studentOverviews, "student_overview"); + 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", + "student_overview" + ".xlsx"); + } + return Ok(); } } diff --git a/Controllers/GovernmentBudget.Controller.cs b/Controllers/GovernmentBudget.Controller.cs index 15d12d8..cdd0003 100644 --- a/Controllers/GovernmentBudget.Controller.cs +++ b/Controllers/GovernmentBudget.Controller.cs @@ -20,7 +20,7 @@ namespace rmutr_report.Controllers { this._setting = setting; } - + [SwaggerOperation("รับเงินแผ่นดิน")] [HttpPost, Route("reports/receive_government/{type}")] //รับเงินแผ่นดิน [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetGovernmentBudgetReport([FromRoute] string type, @@ -62,7 +62,7 @@ namespace rmutr_report.Controllers return Ok(); } - + [SwaggerOperation("การจัดสรรงบประมาณแผ่นดิน พื้นฐาน+ยุทธศาตร์")] [HttpPost, Route("reports/budget_government_allocate/{type}")] // (พื้นฐาน+ยุทธศาตร์) [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetInStrAllocateReport([FromRoute] string type, diff --git a/Models/budget/student_admission_plan.cs b/Models/budget/student_admission_plan.cs new file mode 100644 index 0000000..370b529 --- /dev/null +++ b/Models/budget/student_admission_plan.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class student_admission_plan + { + public int? student_type_code { get; set; } //1นักศึกษารับใหม่ 2นักศึกษาทั้งหมด 3นักศึกษาสำเร็จ + public string student_type_name { get; set; } + public string academic_year_from { get; set; } + public string academic_year_to{ get; set; } + public string faculty_name_th { get; set; } + public string level { get; set; } + public string course_name_th { get; set; } + public string major_name_th { get; set; } + public string budget_project_name_th { get; set; } + public string agency_name_th { get; set; } + public string budget_location_name_th { get; set; } + // + public string year_1 { get; set; } + public string year_2 { get; set; } + public string year_3 { get; set; } + public string year_4 { get; set; } + public string year_5 { get; set; } + public string year_6 { get; set; } + public string text { get; set; } + + public List data { get; set; } + } + + public class student_admission_plan_detail + { + public int? topic_type { get; set; } + public string topic { get; set; } + public decimal? sector_normal_year_1 { get; set; } + public decimal? sector_normal_year_2 { get; set; } + public decimal? sector_normal_year_3 { get; set; } + public decimal? sector_normal_year_4 { get; set; } + public decimal? sector_normal_year_5 { get; set; } + public decimal? sector_normal_year_6 { get; set; } + public decimal? sector_associate_year_1 { get; set; } + public decimal? sector_associate_year_2 { get; set; } + public decimal? sector_associate_year_3 { get; set; } + public decimal? sector_associate_year_4 { get; set; } + public decimal? sector_associate_year_5 { get; set; } + public decimal? sector_associate_year_6 { get; set; } + public decimal? total_year_1 { get; set; } + public decimal? total_year_2 { get; set; } + public decimal? total_year_3 { get; set; } + public decimal? total_year_4 { get; set; } + public decimal? total_year_5 { get; set; } + public decimal? total_year_6 { get; set; } + } +} \ No newline at end of file diff --git a/Models/budget/student_overview.cs b/Models/budget/student_overview.cs new file mode 100644 index 0000000..5346a97 --- /dev/null +++ b/Models/budget/student_overview.cs @@ -0,0 +1,182 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class student_overview + { + public int? student_type_code { get; set; } //1นักศึกษารับใหม่ 2นักศึกษาทั้งหมด 3นักศึกษาสำเร็จ + public string student_type_name { get; set; } + public string academic_year_from { get; set; } + public string academic_year_to{ get; set; } + // + public string year_1 { get; set; } + public string year_2 { get; set; } + public string year_3 { get; set; } + public string year_4 { get; set; } + public string year_5 { get; set; } + public string year_6 { get; set; } + public List data { get; set; } + public decimal? ba_degree_science_1 { get; set; } + public decimal? ba_degree_social_1{ get; set; } + public decimal? ba_degree_total_1 { get; set; } + public decimal? ma_degree_science_1 { get; set; } + public decimal? ma_degree_social_1 { get; set; } + public decimal? ma_degree_total_1 { get; set; } + public decimal? doctor_degree_science_1 { get; set; } + public decimal? doctor_degree_social_1 { get; set; } + public decimal? doctor_degree_total_1 { get; set; } + public decimal? total_science_1 { get; set; } + public decimal? total_social_1 { get; set; } + public decimal? total_1 { get; set; } + // + public decimal? ba_degree_science_2 { get; set; } + public decimal? ba_degree_social_2{ get; set; } + public decimal? ba_degree_total_2 { get; set; } + public decimal? ma_degree_science_2 { get; set; } + public decimal? ma_degree_social_2 { get; set; } + public decimal? ma_degree_total_2 { get; set; } + public decimal? doctor_degree_science_2 { get; set; } + public decimal? doctor_degree_social_2 { get; set; } + public decimal? doctor_degree_total_2 { get; set; } + public decimal? total_science_2 { get; set; } + public decimal? total_social_2 { get; set; } + public decimal? total_2 { get; set; } + // + public decimal? ba_degree_science_3 { get; set; } + public decimal? ba_degree_social_3{ get; set; } + public decimal? ba_degree_total_3 { get; set; } + public decimal? ma_degree_science_3 { get; set; } + public decimal? ma_degree_social_3 { get; set; } + public decimal? ma_degree_total_3 { get; set; } + public decimal? doctor_degree_science_3 { get; set; } + public decimal? doctor_degree_social_3 { get; set; } + public decimal? doctor_degree_total_3 { get; set; } + public decimal? total_science_3 { get; set; } + public decimal? total_social_3 { get; set; } + public decimal? total_3 { get; set; } + // + public decimal? ba_degree_science_4 { get; set; } + public decimal? ba_degree_social_4{ get; set; } + public decimal? ba_degree_total_4 { get; set; } + public decimal? ma_degree_science_4 { get; set; } + public decimal? ma_degree_social_4 { get; set; } + public decimal? ma_degree_total_4 { get; set; } + public decimal? doctor_degree_science_4 { get; set; } + public decimal? doctor_degree_social_4 { get; set; } + public decimal? doctor_degree_total_4 { get; set; } + public decimal? total_science_4 { get; set; } + public decimal? total_social_4 { get; set; } + public decimal? total_4 { get; set; } + // + public decimal? ba_degree_science_5 { get; set; } + public decimal? ba_degree_social_5{ get; set; } + public decimal? ba_degree_total_5 { get; set; } + public decimal? ma_degree_science_5 { get; set; } + public decimal? ma_degree_social_5 { get; set; } + public decimal? ma_degree_total_5 { get; set; } + public decimal? doctor_degree_science_5 { get; set; } + public decimal? doctor_degree_social_5 { get; set; } + public decimal? doctor_degree_total_5 { get; set; } + public decimal? total_science_5 { get; set; } + public decimal? total_social_5 { get; set; } + public decimal? total_5 { get; set; } + // + public decimal? ba_degree_science_6 { get; set; } + public decimal? ba_degree_social_6{ get; set; } + public decimal? ba_degree_total_6 { get; set; } + public decimal? ma_degree_science_6 { get; set; } + public decimal? ma_degree_social_6 { get; set; } + public decimal? ma_degree_total_6 { get; set; } + public decimal? doctor_degree_science_6 { get; set; } + public decimal? doctor_degree_social_6 { get; set; } + public decimal? doctor_degree_total_6 { get; set; } + public decimal? total_science_6 { get; set; } + public decimal? total_social_6 { get; set; } + public decimal? total_6 { get; set; } + + } + + public class student_overview_detail + { + public int? topic_type { get; set; } + public string row_no { get; set; } + public string topic { get; set; } + public decimal? ba_degree_science_1 { get; set; } + public decimal? ba_degree_social_1{ get; set; } + public decimal? ba_degree_total_1 { get; set; } + public decimal? ma_degree_science_1 { get; set; } + public decimal? ma_degree_social_1 { get; set; } + public decimal? ma_degree_total_1 { get; set; } + public decimal? doctor_degree_science_1 { get; set; } + public decimal? doctor_degree_social_1 { get; set; } + public decimal? doctor_degree_total_1 { get; set; } + public decimal? total_science_1 { get; set; } + public decimal? total_social_1 { get; set; } + public decimal? total_1 { get; set; } + // + public decimal? ba_degree_science_2 { get; set; } + public decimal? ba_degree_social_2{ get; set; } + public decimal? ba_degree_total_2 { get; set; } + public decimal? ma_degree_science_2 { get; set; } + public decimal? ma_degree_social_2 { get; set; } + public decimal? ma_degree_total_2 { get; set; } + public decimal? doctor_degree_science_2 { get; set; } + public decimal? doctor_degree_social_2 { get; set; } + public decimal? doctor_degree_total_2 { get; set; } + public decimal? total_science_2 { get; set; } + public decimal? total_social_2 { get; set; } + public decimal? total_2 { get; set; } + // + public decimal? ba_degree_science_3 { get; set; } + public decimal? ba_degree_social_3{ get; set; } + public decimal? ba_degree_total_3 { get; set; } + public decimal? ma_degree_science_3 { get; set; } + public decimal? ma_degree_social_3 { get; set; } + public decimal? ma_degree_total_3 { get; set; } + public decimal? doctor_degree_science_3 { get; set; } + public decimal? doctor_degree_social_3 { get; set; } + public decimal? doctor_degree_total_3 { get; set; } + public decimal? total_science_3 { get; set; } + public decimal? total_social_3 { get; set; } + public decimal? total_3 { get; set; } + // + public decimal? ba_degree_science_4 { get; set; } + public decimal? ba_degree_social_4{ get; set; } + public decimal? ba_degree_total_4 { get; set; } + public decimal? ma_degree_science_4 { get; set; } + public decimal? ma_degree_social_4 { get; set; } + public decimal? ma_degree_total_4 { get; set; } + public decimal? doctor_degree_science_4 { get; set; } + public decimal? doctor_degree_social_4 { get; set; } + public decimal? doctor_degree_total_4 { get; set; } + public decimal? total_science_4 { get; set; } + public decimal? total_social_4 { get; set; } + public decimal? total_4 { get; set; } + // + public decimal? ba_degree_science_5 { get; set; } + public decimal? ba_degree_social_5{ get; set; } + public decimal? ba_degree_total_5 { get; set; } + public decimal? ma_degree_science_5 { get; set; } + public decimal? ma_degree_social_5 { get; set; } + public decimal? ma_degree_total_5 { get; set; } + public decimal? doctor_degree_science_5 { get; set; } + public decimal? doctor_degree_social_5 { get; set; } + public decimal? doctor_degree_total_5 { get; set; } + public decimal? total_science_5 { get; set; } + public decimal? total_social_5 { get; set; } + public decimal? total_5 { get; set; } + // + public decimal? ba_degree_science_6 { get; set; } + public decimal? ba_degree_social_6{ get; set; } + public decimal? ba_degree_total_6 { get; set; } + public decimal? ma_degree_science_6 { get; set; } + public decimal? ma_degree_social_6 { get; set; } + public decimal? ma_degree_total_6 { get; set; } + public decimal? doctor_degree_science_6 { get; set; } + public decimal? doctor_degree_social_6 { get; set; } + public decimal? doctor_degree_total_6 { get; set; } + public decimal? total_science_6 { get; set; } + public decimal? total_social_6 { get; set; } + public decimal? total_6 { get; set; } + } +} \ No newline at end of file diff --git a/Models/budget/target_budget_project.cs b/Models/budget/target_budget_project.cs new file mode 100644 index 0000000..006bd1e --- /dev/null +++ b/Models/budget/target_budget_project.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class target_budget_project + { + public string budget_project_name_th { get; set; } + public string plan_year_1 { get; set; } + public string plan_year_2 { get; set; } + public string plan_year_3 { get; set; } + public string plan_year_4 { get; set; } + public string plan_year_5 { get; set; } + public List data { get; set; } + } + + public class target_budget_project_detail + { + public string indicators_money_source { get; set; } + public string unit { get; set; } + public string plan_value_1 { get; set; } + public string plan_value_2 { get; set; } + public string plan_value_3 { get; set; } + public string plan_value_4 { get; set; } + public string plan_value_5 { 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 fa1f7b8..57b7df9 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 1b03505..2e6728f 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 a8a2972..68c9149 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -4d0f1df7896c70c97a1bff4f0233f6b6c499c19c +8a21b47cb8ccf1667e9a1e072a5dd8d9abbe5dc0 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index fa1f7b8..57b7df9 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 1b03505..2e6728f 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 3ab1b1e..e0f66d6 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -16917407168862588 \ No newline at end of file +16920967126989349 \ No newline at end of file diff --git a/wwwroot/reports/student_admission_plan.frx b/wwwroot/reports/student_admission_plan.frx new file mode 100644 index 0000000..08185e8 --- /dev/null +++ b/wwwroot/reports/student_admission_plan.frx @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/student_overview.frx b/wwwroot/reports/student_overview.frx new file mode 100644 index 0000000..6662862 --- /dev/null +++ b/wwwroot/reports/student_overview.frx @@ -0,0 +1,1264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/target_budget_project.frx b/wwwroot/reports/target_budget_project.frx new file mode 100644 index 0000000..a4dc5f0 --- /dev/null +++ b/wwwroot/reports/target_budget_project.frx @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +