This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user