update SwaggerOperation
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing

This commit is contained in:
kamonwan taengsuk
2023-08-18 15:30:37 +07:00
parent 1080400c34
commit b078d3ff42
11 changed files with 152 additions and 131 deletions

View File

@@ -2731,7 +2731,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("งบประมาณรายจ่ายจากเงินรายได้ งบเงินอุดหนุน")]
[SwaggerOperation("ร.6 สรุปโครงการงบดำเนินงาน")]
[HttpPost, Route("reports/summary_subsidy_projects/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetBudgetSubsidySummaryReport([FromRoute] string type,

View File

@@ -25,7 +25,7 @@ namespace rmutr_report.Controllers
{
this._setting = setting;
}
[SwaggerOperation("ร5. คำชี้แจงงบลงทุน ค่าที่ดินและสิ่งก่อสร้าง")]
[HttpPost, Route("reports/ro_five/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetRoFiveReport([FromRoute] string type, [FromBody] ro_five building_fours)
@@ -265,7 +265,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("ร8. ประมาณการรายรับจากงานวิจัยภายนอก")]
[HttpPost, Route("reports/external_research/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetExReport([FromRoute] string type, [FromBody] external_research external)
@@ -352,7 +352,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("ร9. ประมาณการรายรับจากงานบริการวิชาการ")]
[HttpPost, Route("reports/ro_nine/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetNineReport([FromRoute] string type, [FromBody] ro_nine external)
@@ -435,7 +435,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("ร10. ประมาณการรายรับจากการบริหารสินทรัพย์ที่ก่อให้เกิดรายได้")]
[HttpPost, Route("reports/ro_ten/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetTenReport([FromRoute] string type, [FromBody] ro_ten ten)
@@ -496,7 +496,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("ร11. ประมาณการรายรับจากรายได้ประเภทอื่น ๆ")]
[HttpPost, Route("reports/ro_eleven/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetEleReport([FromRoute] string type, [FromBody] ro_eleven eleven)
@@ -544,116 +544,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[HttpPost, Route("reports/revenue_estimate_income_summary/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetEstimateIncomeReport([FromRoute] string type,
[FromBody] revenue_estimate_income_summary estimate)
{
var s1 = estimate.data.Sum(d => d.science_1);
var s2 = estimate.data.Sum(d => d.social_1);
var s3 = estimate.data.Sum(d => d.science_2);
var s4 = estimate.data.Sum(d => d.social_2);
var s5 = estimate.data.Sum(d => d.total_register_fee);
var s6 = estimate.data.Sum(d => d.science_3);
var s7 = estimate.data.Sum(d => d.social_3);
var s8 = estimate.data.Sum(d => d.science_4);
var s9 = estimate.data.Sum(d => d.social_4);
var s10 = estimate.data.Sum(d => d.total_education_fee);
var s11 = estimate.data.Sum(d => d.total_science);
var s12 = estimate.data.Sum(d => d.total_social);
var s13 = estimate.data.Sum(d => d.total_science_social);
estimate.sum_1 = s1;
estimate.sum_2 = s2;
estimate.sum_3 = s3;
estimate.sum_4 = s4;
estimate.sum_5 = s5;
estimate.sum_6 = s6;
estimate.sum_7 = s7;
estimate.sum_8 = s8;
estimate.sum_9 = s9;
estimate.sum_10 = s10;
estimate.sum_11 = s11;
estimate.sum_12 = s12;
estimate.sum_13 = s13;
var estimateEducation = new List<revenue_estimate_income_summary>() { estimate };
Report report = new Report();
report.Load(_setting.report_path + "revenue_estimate_income_summary.frx");
report.RegisterData(estimateEducation, "revenue_estimate_income_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",
"estimateincome_" + ".xlsx");
}
return Ok();
}
[HttpPost, Route("reports/revenue_estimate_education_fee/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetEstimateReport([FromRoute] string type,
[FromBody] revenue_estimate_education_fee estimate)
{
if (estimate.budget_project_name_th != null)
{
string myStr = estimate.budget_project_name_th;
string[] projectname = myStr.Split("ผู้สำเร็จการศึกษา");
foreach (string projectnames in projectname)
{
estimate.side = projectnames;
}
}
var estimateEducation = new List<revenue_estimate_education_fee>() { estimate };
Report report = new Report();
report.Load(_setting.report_path + "revenue_estimate_education_fee.frx");
report.RegisterData(estimateEducation, "revenue_estimate_education_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.openxmlformats-officedocument.spreadsheetml.sheet",
"estimateEducation" + ".xlsx");
}
return Ok();
}
[SwaggerOperation("ร12. ประมาณการรายรับภาคปกติของคณะศิลปศาสตร์จาก ค่าหน่วยกิตที่ลงทะเบียน")]
[HttpPost, Route("reports/revenue_estimate_register_credits/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetRegisterCreditsReport([FromRoute] string type,
@@ -4068,7 +3959,117 @@ namespace rmutr_report.Controllers
"revenueEstimate_register" + ".xlsx");
}
}
[SwaggerOperation("ร13. ประมาณการรายรับภาคปกติของคณะศิลปศาสตร์จาก ค่าบำรุงการศึกษา")]
[HttpPost, Route("reports/revenue_estimate_education_fee/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetEstimateReport([FromRoute] string type,
[FromBody] revenue_estimate_education_fee estimate)
{
if (estimate.budget_project_name_th != null)
{
string myStr = estimate.budget_project_name_th;
string[] projectname = myStr.Split("ผู้สำเร็จการศึกษา");
foreach (string projectnames in projectname)
{
estimate.side = projectnames;
}
}
var estimateEducation = new List<revenue_estimate_education_fee>() { estimate };
Report report = new Report();
report.Load(_setting.report_path + "revenue_estimate_education_fee.frx");
report.RegisterData(estimateEducation, "revenue_estimate_education_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.openxmlformats-officedocument.spreadsheetml.sheet",
"estimateEducation" + ".xlsx");
}
return Ok();
}
[SwaggerOperation("ร14. แบบฟอร์มสรุปรายรับคณะศิลปศาสตร์จากการจัดการศึกษาให้กับคณะอื่น")]
[HttpPost, Route("reports/revenue_estimate_income_summary/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetEstimateIncomeReport([FromRoute] string type,
[FromBody] revenue_estimate_income_summary estimate)
{
var s1 = estimate.data.Sum(d => d.science_1);
var s2 = estimate.data.Sum(d => d.social_1);
var s3 = estimate.data.Sum(d => d.science_2);
var s4 = estimate.data.Sum(d => d.social_2);
var s5 = estimate.data.Sum(d => d.total_register_fee);
var s6 = estimate.data.Sum(d => d.science_3);
var s7 = estimate.data.Sum(d => d.social_3);
var s8 = estimate.data.Sum(d => d.science_4);
var s9 = estimate.data.Sum(d => d.social_4);
var s10 = estimate.data.Sum(d => d.total_education_fee);
var s11 = estimate.data.Sum(d => d.total_science);
var s12 = estimate.data.Sum(d => d.total_social);
var s13 = estimate.data.Sum(d => d.total_science_social);
estimate.sum_1 = s1;
estimate.sum_2 = s2;
estimate.sum_3 = s3;
estimate.sum_4 = s4;
estimate.sum_5 = s5;
estimate.sum_6 = s6;
estimate.sum_7 = s7;
estimate.sum_8 = s8;
estimate.sum_9 = s9;
estimate.sum_10 = s10;
estimate.sum_11 = s11;
estimate.sum_12 = s12;
estimate.sum_13 = s13;
var estimateEducation = new List<revenue_estimate_income_summary>() { estimate };
Report report = new Report();
report.Load(_setting.report_path + "revenue_estimate_income_summary.frx");
report.RegisterData(estimateEducation, "revenue_estimate_income_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",
"estimateincome_" + ".xlsx");
}
return Ok();
}
[SwaggerOperation("ร1. แบบฟอร์มเสนอขอปรับเปลี่ยนชื่อตำแหน่ง")]
[HttpPost, Route("reports/form_1_2/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetForm2Report([FromRoute] string type,
@@ -4119,7 +4120,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("ร1. แบบฟอร์มเสนอขออัตราใหม่")]
[HttpPost, Route("reports/form_1_3/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetForm3Report([FromRoute] string type,
@@ -4294,7 +4295,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("ร1. แบบฟอร์มเสนอขอปรับคุณวุฒิ")]
[HttpPost, Route("reports/budget_income_qualification/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetForm1Report([FromRoute] string type,

View File

@@ -22,7 +22,7 @@ namespace rmutr_report.Controllers
{
this._setting = setting;
}
[SwaggerOperation("ร.3 คำชี้แจงงบดำเนินงาน")]
[HttpPost, Route("reports/operating_budget_ro_three/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetRoThreeReport([FromRoute] string type, [FromBody] operating_budget_ro_three three)
@@ -65,7 +65,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงาน ค่าตอบแทนหัวหน้าภาควิชา")]
[HttpPost, Route("reports/compensation_head_department/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetComReport([FromRoute] string type, [FromBody] compensation_head three)
@@ -115,7 +115,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงาน ค่าตอบแทนหัวหน้าสาขาวิชา")]
[HttpPost, Route("reports/compensation_head_major/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetCom2Report([FromRoute] string type, [FromBody] compensation_head three)
@@ -165,6 +165,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานค่าสอนพิเศษ")]
[HttpPost, Route("reports/teaching_fee_extra_ro_three/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetTeachExReport([FromRoute] string type, [FromBody] teaching_fee_ro_three three)
@@ -209,6 +210,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานค่าสอน")]
[HttpPost, Route("reports/teaching_fee_ro_three/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetTeachReport([FromRoute] string type, [FromBody] teaching_fee_ro_three three)
@@ -253,6 +255,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานค่าสอนเกินภาระงาน")]
[HttpPost, Route("reports/teaching_fee_workload/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetTeachWorkloadReport([FromRoute] string type, [FromBody] teaching_fee_ro_three three)
@@ -297,6 +300,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานค่าวัสดุสำนักงาน")]
[HttpPost, Route("reports/material_office/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial1Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -346,6 +350,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุคอมพิวเตอร์")]
[HttpPost, Route("reports/material_computer/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial2Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -395,6 +400,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุการศึกษา")]
[HttpPost, Route("reports/material_education/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial3Report([FromRoute] string type, [FromBody] material_education three)
@@ -568,6 +574,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุหนังสือ")]
[HttpPost, Route("reports/material_book/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial4Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -617,6 +624,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุโฆษณาและเผยแพร่")]
[HttpPost, Route("reports/material_advertise/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial5Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -666,6 +674,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุงานสิ่งก่อสร้าง")]
[HttpPost, Route("reports/material_construction/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial6Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -715,6 +724,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุเชื้อเพลิงและหล่อลื่น")]
[HttpPost, Route("reports/material_fuel_lubricant/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial7Report([FromRoute] string type, [FromBody] material_fuel_lubricant three)
@@ -779,6 +789,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุไฟฟ้าและวิทยุ")]
[HttpPost, Route("reports/material_electric/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial8Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -828,6 +839,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุการเกษตร")]
[HttpPost, Route("reports/material_agricultural/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial9Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -877,6 +889,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุงานบ้านงานครัว")]
[HttpPost, Route("reports/material_housework/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial10Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -926,6 +939,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุวิทยาศาสตร์หรือการแพทย์")]
[HttpPost, Route("reports/material_science_medical/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial11Report([FromRoute] string type, [FromBody] material_ro_three three)
@@ -975,6 +989,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[SwaggerOperation("รายงานวัสดุกีฬา")]
[HttpPost, Route("reports/material_sport/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterial12Report([FromRoute] string type, [FromBody] material_ro_three three)