add report
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2023-08-16 12:01:11 +07:00
parent 7132b7c4ed
commit 9fd0c16fbf
20 changed files with 250 additions and 145 deletions

View File

@@ -62,7 +62,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("การจัดสรรงบประมาณแผ่นดิน พื้นฐาน+ยุทธศาตร์")]
[SwaggerOperation("การจัดสรรงบประมาณแผ่นดินรวมทุกแผนงาน, แผนงานบุคลากร, พื้นฐาน+ยุทธศาตร์")]
[HttpPost, Route("reports/budget_government_allocate/{type}")] // (พื้นฐาน+ยุทธศาตร์)
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetInStrAllocateReport([FromRoute] string type,

View File

@@ -27,7 +27,7 @@ namespace rmutr_report.Controllers
{
this._setting = setting;
}
[SwaggerOperation("ข้อมูลจำนวนบุคลากร")]
[HttpPost, Route("reports/personnel_summary/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetHrReport([FromRoute] string type, [FromBody] personnel_summary personnel_summarys)
@@ -84,7 +84,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("จำนวนบุคลากร สายวิชาการ และ สายสนับสนุน")]
[HttpPost, Route("reports/man_power/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetManReport([FromRoute] string type, [FromBody] List<man_power> man_powers)
@@ -128,7 +128,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("จำนวนบุคลากร สายสนับสนุน")]
[HttpPost, Route("reports/data_line_support/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetDataLineReport([FromRoute] string type, [FromBody] data_line_support data_line_supports)
@@ -172,7 +172,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("จำนวนบุคลากร สายวิชาการ จำแนกตามอัตรา มีคนครอง และอัตราว่าง")]
[HttpPost, Route("reports/data_line_academic/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetDataLineAcaReport([FromRoute] string type,
@@ -217,7 +217,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("จำนวนบุคลากร สายวิชาการ จำแนกตามอัตรา มีคนครอง และอัตราว่าง")]
[HttpPost, Route("reports/qualifications_teacher/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetQualificationsTeacherReport([FromRoute] string type,
@@ -262,7 +262,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("จำนวนบุคลากร สายวิชาการ ตามตำแหน่งทางวิชาการ")]
[HttpPost, Route("reports/academic_position/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetAcademicPositionReport([FromRoute] string type,
@@ -307,7 +307,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("หนังสือแจ้งผลการเลื่อนค่าตอบแทนพนักงานราชการ")]
[HttpPost, Route("reports/postponement_compensation/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetPostponementCompensationReport([FromRoute] string type,
@@ -494,7 +494,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("พนักงานราชการ")]
[HttpPost, Route("reports/personnel_salary_government_employee/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetPersonSalaryReport([FromRoute] string type,
@@ -1012,7 +1012,7 @@ namespace rmutr_report.Controllers
}
}
[SwaggerOperation("ข้าราชการ")]
[HttpPost, Route("reports/personnel_salary_government/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetPersonSalaryGovernmentReport([FromRoute] string type,
@@ -2105,7 +2105,7 @@ namespace rmutr_report.Controllers
}
}
[SwaggerOperation("ลูกจ้างประจํา")]
[HttpPost, Route("reports/personnel_salary_permanent/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetPersonSalaryReport([FromRoute] string type,
@@ -2796,7 +2796,7 @@ namespace rmutr_report.Controllers
"personnel_permanent_" + date + ".xlsx");
}
}
[SwaggerOperation("ลูกจ้างชั่วคราว")]
[HttpPost, Route("reports/personnel_salary_temporary/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetTemporaryReport([FromRoute] string type,
@@ -3236,7 +3236,7 @@ namespace rmutr_report.Controllers
"personnel_temporary_" + date + ".xlsx");
}
}
[SwaggerOperation("พนักงานมหาวิทยาลัย")]
[HttpPost, Route("reports/personnel_salary_university/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetPersonSalaryUniversityReport([FromRoute] string type,
@@ -4130,7 +4130,7 @@ namespace rmutr_report.Controllers
}
}
[SwaggerOperation("ค่าตอบแทนพนักงานราชการ")]
[HttpPost, Route("reports/set_personnel_budget/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSetPersonBudgetReport([FromRoute] string type,
@@ -4808,7 +4808,7 @@ namespace rmutr_report.Controllers
"personnel_" + date + ".xlsx");
}
}
[SwaggerOperation("การตั้งงบประมาณค่าใช้จ่ายบุคลากร")]
[HttpPost, Route("reports/personnel_expense_budget/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSetPersonExBudgetReport([FromRoute] string type,
@@ -6214,7 +6214,7 @@ namespace rmutr_report.Controllers
"personnel_expense_budget" + date + ".xlsx");
}
}
[SwaggerOperation("บุคลากร งบประมาณแผ่นดิน")]
[HttpPost, Route("reports/national_budget/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetNationalBudgetReport([FromRoute] string type,
@@ -6479,7 +6479,7 @@ namespace rmutr_report.Controllers
"national_budget_" + date + ".xlsx");
}
}
[SwaggerOperation("งบประมาณ MTEF")]
[HttpPost, Route("reports/mtef_personnel/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMtefReport([FromRoute] string type,
@@ -6862,7 +6862,7 @@ namespace rmutr_report.Controllers
"mtef_personnel_" + date + ".xlsx");
}
}
[SwaggerOperation("ข้อมูลการตั้งงบประมาณค่าใช้จ่ายบุคลากร")]
[HttpPost, Route("reports/set_personnel_budget_university/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSetPersonUniBudgetReport([FromRoute] string type,
@@ -8817,7 +8817,7 @@ namespace rmutr_report.Controllers
"set_personnel_budget_university_" + date + ".xlsx");
}
}
[SwaggerOperation("การตั้งงบประมาณค่าใช้จ่ายบุคลากร ของลูกจ้างประจำ")]
[HttpPost, Route("reports/set_personnel_budget_permanent/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSetPersonPermanentReport([FromRoute] string type,
@@ -9482,7 +9482,7 @@ namespace rmutr_report.Controllers
"set_personnel_budget_permanent_" + date + ".xlsx");
}
}
[SwaggerOperation("รายละเอียดข้อเสนอวงเงิน, สรุปข้อเสนอวงเงิน")]
[HttpPost, Route("reports/budget_expenditure_proposal/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetPersonDetailReport([FromRoute] string type,

View File

@@ -11,7 +11,7 @@ using Swashbuckle.AspNetCore.Annotations;
namespace rmutr_report.Controllers
{
[SwaggerTag("สำหรับรายงาน HR")]
[SwaggerTag("สำหรับรายงานบุคลากร")]
public class PersonnelReport : Controller
{
readonly Setting _setting;

View File

@@ -25,7 +25,7 @@ namespace rmutr_report.Controllers
{
this._setting = setting;
}
[SwaggerOperation("สรุปแผนความต้องการ รายการครุภัณฑ์")]
[HttpPost, Route("reports/summary_of_equipment/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSum1Report([FromRoute] string type,
@@ -298,7 +298,7 @@ namespace rmutr_report.Controllers
// }
return Ok();
}
[SwaggerOperation("สรุปแผนความต้องการ รายการครุภัณฑ์ 5 ปี")]
[HttpPost, Route("reports/summary_of_equipment_five_year/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetEquipmentReport([FromRoute] string type,
@@ -859,7 +859,7 @@ namespace rmutr_report.Controllers
}
}
[SwaggerOperation("รายละเอียดคำชี้แจงค่าครุภัณฑ์")]
[HttpPost, Route("reports/statement_of_equipment/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetStEquipmentReport([FromRoute] string type,
@@ -950,7 +950,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("สรุปแผนความต้องการรายการก่อสร้างอาคารหรือสิ่งก่อสร้าง")]
[HttpPost, Route("reports/summary_building_construction/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSum2Report([FromRoute] string type,
@@ -1584,5 +1584,50 @@ namespace rmutr_report.Controllers
}
}
}
[SwaggerOperation("สรุปงบลงทุน")]
[HttpPost, Route("reports/investment_budget_summary/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetInvestmentReport([FromRoute] string type,
[FromBody] investment_budget_summary investmentBudget)
{
foreach (var detail in investmentBudget.data)
{
if (detail.topic_type==1)
{
detail.row_no = null;
}
if (detail.topic_type==3)
{
detail.row_no = null;
}
}
var investmentBudgetSummaries = new List<investment_budget_summary>() { investmentBudget };
Report report = new Report();
report.Load(_setting.report_path + "investment_budget_summary.frx");
report.RegisterData(investmentBudgetSummaries, "investment_budget_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",
"investment_budget_summary" + ".xlsx");
}
return Ok();
}
}
}