add แบบรายงานผลการดำเนินงานโครงการ
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
127
Controllers/ProjectPerformanceReport.Controller.cs
Normal file
127
Controllers/ProjectPerformanceReport.Controller.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using FastReport;
|
||||
using FastReport.Export.OoXML;
|
||||
using FastReport.Export.Pdf;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using rmutr_report.Models;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
|
||||
namespace rmutr_report.Controllers
|
||||
{
|
||||
[SwaggerTag("แบบรายงานผลการดำเนินงานโครงการ")]
|
||||
public class projectPerformanceForm : Controller
|
||||
{
|
||||
readonly Setting _setting;
|
||||
|
||||
public projectPerformanceForm(Setting setting)
|
||||
{
|
||||
_setting = setting;
|
||||
}
|
||||
|
||||
[HttpPost, Route("reports/project_performance_report_form/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetProjectPerformanceReport([FromRoute] string type,
|
||||
[FromBody] project_performance_report_form reportForm)
|
||||
{
|
||||
if (reportForm.national_budget_money==true)
|
||||
{
|
||||
reportForm.check_box1 = "/";
|
||||
}
|
||||
if (reportForm.income_budget==true)
|
||||
{
|
||||
reportForm.check_box2 = "/";
|
||||
}
|
||||
if (reportForm.other==true)
|
||||
{
|
||||
reportForm.check_box3 = "/";
|
||||
}
|
||||
if (reportForm.digital_innovation==true)
|
||||
{
|
||||
reportForm.check_box4 = "/";
|
||||
}
|
||||
if (reportForm.moral==true)
|
||||
{
|
||||
reportForm.check_box5 = "/";
|
||||
}
|
||||
if (reportForm.open_mind==true)
|
||||
{
|
||||
reportForm.check_box6 = "/";
|
||||
}
|
||||
if (reportForm.value==true)
|
||||
{
|
||||
reportForm.check_box7 = "/";
|
||||
}
|
||||
if (reportForm.entrepreneurship==true)
|
||||
{
|
||||
reportForm.check_box8 = "/";
|
||||
}
|
||||
if (reportForm.unity==true)
|
||||
{
|
||||
reportForm.check_box9 = "/";
|
||||
}
|
||||
if (reportForm.porfessional==true)
|
||||
{
|
||||
reportForm.check_box10 = "/";
|
||||
}
|
||||
if (reportForm.check_twenty_four==true)
|
||||
{
|
||||
reportForm.check_twenty_four1 = "/";
|
||||
}
|
||||
if (reportForm.check_twenty_four==false)
|
||||
{
|
||||
reportForm.check_twenty_four2 = "/";
|
||||
}
|
||||
if (reportForm.project_style!=null)
|
||||
{
|
||||
foreach (var projects in reportForm.project_style)
|
||||
{
|
||||
if (projects.check == true)
|
||||
{
|
||||
projects.checkbox = "/";
|
||||
}
|
||||
if (projects.check == false)
|
||||
{
|
||||
projects.checkbox = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (reportForm.twenty_four_table!=null)
|
||||
{
|
||||
var sum1 = reportForm.twenty_four_table.Sum(g => g.amount_1);
|
||||
var sum2 = reportForm.twenty_four_table.Sum(g => g.amount_2);
|
||||
reportForm.total_amount_1 = sum1;
|
||||
reportForm.total_amount_2 = sum2;
|
||||
}
|
||||
var projectPerformance = new List<project_performance_report_form>() { reportForm };
|
||||
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "project_performance_report_form.frx");
|
||||
report.RegisterData(projectPerformance, "project_performance_report_form");
|
||||
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",
|
||||
"project_performance_report_form" + ".xlsx");
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
156
Models/budget/project_performance_report_form.cs
Normal file
156
Models/budget/project_performance_report_form.cs
Normal file
@@ -0,0 +1,156 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace rmutr_report.Models
|
||||
{
|
||||
public class project_performance_report_form
|
||||
{
|
||||
public string budget_year { get; set; }
|
||||
public string project_name { get; set; }
|
||||
public string responsible_person { get; set; }
|
||||
public string faculty { get; set; }
|
||||
public string start_date { get; set; }
|
||||
public string end_date { get; set; }
|
||||
public string project_location { get; set; }
|
||||
public List<project_styles> project_style{ get; set; } //ข้อ 6
|
||||
|
||||
public string strategic_issues { get; set; }//ข้อ 7
|
||||
public List<project_objectives> project_objective{ get; set; } //ข้อ 8
|
||||
public List<operations_activities> operations_activitie { get; set; }//ข้อ 9
|
||||
public bool? national_budget_money { get; set; }//ข้อ 10
|
||||
public bool? income_budget { get; set; }//ข้อ 10
|
||||
public bool? other { get; set; }//ข้อ 10
|
||||
public string check_box1 { get; set; }//ข้อ 10
|
||||
public string check_box2 { get; set; }//ข้อ 10
|
||||
public string check_box3 { get; set; }//ข้อ 10
|
||||
public string other_remark { get; set; }//ข้อ 10
|
||||
public string product { get; set; }//ข้อ 10
|
||||
public decimal? amount { get; set; }//ข้อ 10
|
||||
public decimal? approval { get; set; }//ข้อ 10
|
||||
public decimal? really_pay { get; set; }//ข้อ 10
|
||||
public List<overall_operating_results> overall_operating_result { get; set; }//ข้อ 11.1
|
||||
public List<qualitatives> qualitative { get; set; }//ข้อ 11.2
|
||||
public List<times> time { get; set; }//ข้อ 11.3
|
||||
public List<indicators_project_objectives> indicators_project_objective { get; set; }//ข้อ 11.4
|
||||
public bool? digital_innovation { get; set; }//ข้อ 12
|
||||
public bool? moral { get; set; }//ข้อ 12
|
||||
public bool? open_mind { get; set; }//ข้อ 12
|
||||
public bool? value { get; set; }//ข้อ 12
|
||||
public bool? entrepreneurship { get; set; }//ข้อ 12
|
||||
public bool? unity { get; set; }//ข้อ 12
|
||||
public bool? porfessional { get; set; }//ข้อ 12
|
||||
public string check_box4 { get; set; }//ข้อ 12
|
||||
public string check_box5 { get; set; }//ข้อ 12
|
||||
public string check_box6 { get; set; }//ข้อ 12
|
||||
public string check_box7 { get; set; }//ข้อ 12
|
||||
public string check_box8 { get; set; }//ข้อ 12
|
||||
public string check_box9 { get; set; }//ข้อ 12
|
||||
public string check_box10 { get; set; }//ข้อ 12
|
||||
public string developed { get; set; }//ข้อ 12
|
||||
public string explain { get; set; }//ข้อ 13
|
||||
public string explain_SDG { get; set; }//ข้อ 14
|
||||
public string value_analysis { get; set; }//ข้อ 15
|
||||
public string output { get; set; }//ข้อ 16
|
||||
public string outcome { get; set; }//ข้อ 17
|
||||
public string effect { get; set; } //ข้อ 18
|
||||
public string obstacle { get; set; } //ข้อ 19
|
||||
public string suggestions { get; set; } //ข้อ 20
|
||||
public string expected_results_inside { get; set; } //ข้อ 21
|
||||
public string expected_results_outside { get; set; } //ข้อ 21
|
||||
public string next_action_plan { get; set; } //ข้อ 22
|
||||
public string results_continuous_development { get; set; } //ข้อ 23
|
||||
public bool? check_twenty_four { get; set; }//ข้อ 24
|
||||
public string check_twenty_four1 { get; set; }//ข้อ 24
|
||||
public string check_twenty_four2 { get; set; }//ข้อ 24
|
||||
public List<twenty_four_tables> twenty_four_table { get; set; }//ข้อ 24
|
||||
public decimal? total_amount_1 { get; set; }
|
||||
public decimal? total_amount_2 { get; set; }
|
||||
}
|
||||
|
||||
public class project_styles
|
||||
{
|
||||
public bool? check { get; set; }//ข้อ 6
|
||||
public string checkbox { get; set; }//ข้อ 6
|
||||
public string project_style { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class project_objectives
|
||||
{
|
||||
public string row { get; set; }
|
||||
public string project_objective { get; set; }//ข้อ 8
|
||||
|
||||
}
|
||||
|
||||
public class operations_activities
|
||||
{
|
||||
public string row { get; set; }
|
||||
public string operations_activitie { get; set; }//ข้อ 9
|
||||
}
|
||||
|
||||
public class overall_operating_results
|
||||
{
|
||||
|
||||
public decimal? quantity { get; set; }
|
||||
public decimal? participants_quantity { get; set; }
|
||||
public decimal? participants_university { get; set; }
|
||||
public decimal? board { get; set; }
|
||||
public decimal? lecturer { get; set; }
|
||||
public decimal? participants { get; set; }
|
||||
public decimal? executive_1 { get; set; }
|
||||
public decimal? teacher_1 { get; set; }
|
||||
public decimal? student_1 { get; set; }
|
||||
public decimal? support_personnel_1 { get; set; }
|
||||
public decimal? government_officer { get; set; }
|
||||
public decimal? university_staff { get; set; }
|
||||
public decimal? government_employee { get; set; }
|
||||
public decimal? temporary_employee { get; set; }
|
||||
public decimal? external_participants { get; set; }
|
||||
public decimal? external_lecturer { get; set; }
|
||||
public decimal? external_participants2 { get; set; }
|
||||
public decimal? executive_2 { get; set; }
|
||||
public decimal? teacher_2 { get; set; }
|
||||
public decimal? student_2 { get; set; }
|
||||
public decimal? personnel_2 { get; set; }
|
||||
public decimal? activity { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class qualitatives
|
||||
{
|
||||
public string topic { get; set; }
|
||||
public List<data_lists> data { get; set; }
|
||||
}
|
||||
|
||||
public class data_lists
|
||||
{
|
||||
public string list { get; set; }
|
||||
public decimal? percentage { get; set; }
|
||||
}
|
||||
|
||||
public class times
|
||||
{
|
||||
public decimal? percentage { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class indicators_project_objectives
|
||||
{
|
||||
public string kpi { get; set; }
|
||||
public decimal? target_value_plan { get; set; }
|
||||
public decimal? target_value_result { get; set; }
|
||||
public string remark { get; set; }
|
||||
}
|
||||
|
||||
public class twenty_four_tables
|
||||
{
|
||||
public int? topic_type { get; set; }
|
||||
public string topic { get; set; }
|
||||
public decimal? amount_1 { get; set; }
|
||||
public decimal? amount_2 { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
f29f532d408de6504926f35348a4e885e76ac54a
|
||||
34f6847c55c258dd2ba577a21dc408fdad799519
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
08426863366ac1cc0305f074194bd81e401f7c35
|
||||
19cbe7ca27a40701bf27c16c63d4cc2288aaa77f
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
16939829599595269
|
||||
16952815406574131
|
||||
611
wwwroot/reports/project_performance_report_form.frx
Normal file
611
wwwroot/reports/project_performance_report_form.frx
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user