This commit is contained in:
@@ -14,17 +14,19 @@ using Swashbuckle.AspNetCore.Annotations;
|
||||
namespace rmutr_report.Controllers
|
||||
{
|
||||
[SwaggerTag("สำหรับรายงานคำขอโครงการพันธุกรรมพืช ง.5-2.1")]
|
||||
public class plant_genetic_conservation_project: Controller
|
||||
public class plant_genetic_conservation_project : Controller
|
||||
{
|
||||
readonly Setting _setting;
|
||||
readonly Setting _setting;
|
||||
|
||||
public plant_genetic_conservation_project(Setting setting)
|
||||
{
|
||||
this._setting = setting;
|
||||
}
|
||||
[HttpPost, Route("reports/plant_genetic_conservation_project/{type}")]
|
||||
|
||||
[HttpPost, Route("reports/plant_genetic_conservation_project/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetConservationProjectReport([FromRoute] string type, [FromBody] project_principle_rationale project)
|
||||
public IActionResult GetConservationProjectReport([FromRoute] string type,
|
||||
[FromBody] project_principle_rationale project)
|
||||
{
|
||||
if (project != null)
|
||||
{
|
||||
@@ -44,7 +46,7 @@ namespace rmutr_report.Controllers
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (project.ninth!=null)
|
||||
if (project.ninth != null)
|
||||
{
|
||||
foreach (var vv in project.ninth)
|
||||
{
|
||||
@@ -52,10 +54,29 @@ namespace rmutr_report.Controllers
|
||||
{
|
||||
vv.clause = "12.1 ตัวชี้วัดผลสัมฤทธิ์";
|
||||
}
|
||||
|
||||
if (vv.clause == "9.2 ตัวชี้วัดเชิงนโยบาย")
|
||||
{
|
||||
vv.clause = "12.2 ตัวชี้วัดเชิงนโยบาย";
|
||||
}
|
||||
|
||||
if (vv.ninths.Any())
|
||||
{
|
||||
if (vv.ninths == null)
|
||||
{
|
||||
foreach (var detail6 in vv.ninths)
|
||||
{
|
||||
detail6.detail = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vv.ninths.Add(new ninth_data_detail()
|
||||
{
|
||||
detail = ""
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +95,42 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
if (project.seventeenth != null)
|
||||
{
|
||||
foreach (var v in project.seventeenth)
|
||||
{
|
||||
int t = 1;
|
||||
string a = "กิจกรรมที่ ";
|
||||
v.activity = a + v.activity;
|
||||
foreach (var vv in v.seventeenths)
|
||||
{
|
||||
string na = "ครั้งที่ ";
|
||||
vv.the_time = na + t;
|
||||
t++;
|
||||
foreach (var detail in vv.seventeenths2)
|
||||
{
|
||||
string in1 = "พื้นที่ (ภายในมหาวิทยาลัย) ";
|
||||
string in2 = "ระบุสถานที่ ";
|
||||
string out1 = "จังหวัด (ภายนอกมหาวิทยาลัย) ";
|
||||
|
||||
if (detail.internal_external1 == "ภายในมหาวิทยาลัย")
|
||||
{
|
||||
detail.text1 = "ภายในมหาวิทยาลัย";
|
||||
detail.area_province1 = in1 + detail.area_province1;
|
||||
detail.location1 = in2 + detail.location1;
|
||||
}
|
||||
|
||||
if (detail.internal_external2 == "ภายนอกมหาวิทยาลัย")
|
||||
{
|
||||
detail.text2 = "ภายนอกมหาวิทยาลัย";
|
||||
detail.area_province2 = out1 + detail.area_province2;
|
||||
detail.location2 = in2 + detail.location2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.eighteenth != null)
|
||||
{
|
||||
foreach (var v in project.eighteenth)
|
||||
@@ -134,7 +191,6 @@ namespace rmutr_report.Controllers
|
||||
// }
|
||||
if (vv.count_quantitative != null)
|
||||
{
|
||||
|
||||
string na = " หน่วยนับ";
|
||||
vv.khrang1 = na;
|
||||
}
|
||||
@@ -206,7 +262,8 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
var _project = new List<project_principle_rationale>() {project};
|
||||
|
||||
var _project = new List<project_principle_rationale>() { project };
|
||||
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "plant_genetic_conservation_project.frx");
|
||||
@@ -241,7 +298,8 @@ namespace rmutr_report.Controllers
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "text/csv");
|
||||
break;
|
||||
case "doc": case "docx":
|
||||
case "doc":
|
||||
case "docx":
|
||||
Word2007Export word = new Word2007Export();
|
||||
report.Export(word, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
@@ -251,6 +309,5 @@ namespace rmutr_report.Controllers
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -29,27 +29,29 @@ namespace rmutr_report.Controllers
|
||||
{
|
||||
if (project != null)
|
||||
{
|
||||
// var total = project.activity.Count;
|
||||
// if (project.activity != null)
|
||||
// {
|
||||
// foreach (var v in project.activity)
|
||||
// {
|
||||
// if (v.activity != null)
|
||||
// {
|
||||
// //var total = project.activity.Select(r => r.count).Sum(t => t.Value);
|
||||
// project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// project.together_with = null;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (project.ninth != null)
|
||||
{
|
||||
foreach (var vv in project.ninth)
|
||||
{
|
||||
if (vv.ninths.Any())
|
||||
{
|
||||
if (vv.ninths == null)
|
||||
{
|
||||
foreach (var detail6 in vv.ninths)
|
||||
{
|
||||
detail6.detail = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vv.ninths.Add(new ninth_data_detail()
|
||||
{
|
||||
detail = ""
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.sixteenths != null)
|
||||
{
|
||||
@@ -66,6 +68,42 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
if (project.seventeenth != null)
|
||||
{
|
||||
foreach (var v in project.seventeenth)
|
||||
{
|
||||
int t = 1;
|
||||
string a = "กิจกรรมที่ ";
|
||||
v.activity = a + v.activity;
|
||||
foreach (var vv in v.seventeenths)
|
||||
{
|
||||
string na = "ครั้งที่ ";
|
||||
vv.the_time = na + t;
|
||||
t++;
|
||||
foreach (var detail in vv.seventeenths2)
|
||||
{
|
||||
string in1 = "พื้นที่ (ภายในมหาวิทยาลัย) ";
|
||||
string in2 = "ระบุสถานที่ ";
|
||||
string out1 = "จังหวัด (ภายนอกมหาวิทยาลัย) ";
|
||||
|
||||
if (detail.internal_external1 == "ภายในมหาวิทยาลัย")
|
||||
{
|
||||
detail.text1 = "ภายในมหาวิทยาลัย";
|
||||
detail.area_province1 = in1 + detail.area_province1;
|
||||
detail.location1 = in2 + detail.location1;
|
||||
}
|
||||
|
||||
if (detail.internal_external2 == "ภายนอกมหาวิทยาลัย")
|
||||
{
|
||||
detail.text2 = "ภายนอกมหาวิทยาลัย";
|
||||
detail.area_province2 = out1 + detail.area_province2;
|
||||
detail.location2 = in2 + detail.location2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.eighteenth != null)
|
||||
{
|
||||
foreach (var v in project.eighteenth)
|
||||
@@ -124,13 +162,13 @@ namespace rmutr_report.Controllers
|
||||
// {
|
||||
// vv.clause4 = vv.clause4;
|
||||
// }
|
||||
if (vv.count_quantitative != null )
|
||||
if (vv.count_quantitative != null)
|
||||
{
|
||||
|
||||
string na = " หน่วยนับ";
|
||||
vv.khrang1 = na;
|
||||
}
|
||||
if (vv.count_unit != null )
|
||||
|
||||
if (vv.count_unit != null)
|
||||
{
|
||||
string na = "ผู้เข้าร่วมโครงการ ";
|
||||
string na1 = " จำนวน ";
|
||||
@@ -140,17 +178,17 @@ namespace rmutr_report.Controllers
|
||||
vv.nuai_nap = na2;
|
||||
}
|
||||
|
||||
if (vv.count_project != null )
|
||||
if (vv.count_project != null)
|
||||
{
|
||||
vv.clause1 = "21.1 เชิงปริมาณ";
|
||||
string na = "จำนวนครั้งที่ดำเนินโครงการ ";
|
||||
string na2 = " ครั้ง";
|
||||
vv.text2 = na ;
|
||||
vv.khrang2 = na2 ;
|
||||
vv.text2 = na;
|
||||
vv.khrang2 = na2;
|
||||
vv.text12 = "หน่วยนับ";
|
||||
}
|
||||
|
||||
if (vv.count_training != null )
|
||||
if (vv.count_training != null)
|
||||
{
|
||||
string na = "จำนวนการจัดอบรมและสัมมนา ";
|
||||
string na2 = " เรื่อง";
|
||||
@@ -166,18 +204,18 @@ namespace rmutr_report.Controllers
|
||||
vv.khrang3 = na2;
|
||||
}
|
||||
|
||||
if (vv.project_start_date!=null )
|
||||
if (vv.project_start_date != null)
|
||||
{
|
||||
vv.clause2 = "21.2 เชิงเวลา";
|
||||
string na3 = "วัน/เดือน/ปี ที่จะดำเนินโครงการ ";
|
||||
string na4 = " ถึง ";
|
||||
vv.range = na4 ;
|
||||
vv.text5 = na3 ;
|
||||
vv.range = na4;
|
||||
vv.text5 = na3;
|
||||
string na5 = "โครงการแล้วเสร็จตามเวลาที่กำหนด (ร้อยละ) ";
|
||||
vv.text6 = na5 ;
|
||||
vv.text6 = na5;
|
||||
}
|
||||
|
||||
if (vv.percentage1!=null || vv.percentage2!=null)
|
||||
|
||||
if (vv.percentage1 != null || vv.percentage2 != null)
|
||||
{
|
||||
vv.clause3 = "21.3 เชิงคุณภาพ";
|
||||
string na = "ผู้เข้าร่วมโครงการมีความรู้ความเข้าใจเพิ่มขึ้น (ร้อยละ) ";
|
||||
@@ -185,18 +223,17 @@ namespace rmutr_report.Controllers
|
||||
vv.text7 = na;
|
||||
vv.text8 = na1;
|
||||
vv.text9 = "ผู้เข้าร่วมโครงการสามารถนำความรู้ที่ได้รับไปบูรณาการอย่างไรบ้าง";
|
||||
//vv.text10 = "รายละเอียด";
|
||||
vv.text10 = "รายละเอียด";
|
||||
}
|
||||
if (vv.expenses!=null)
|
||||
|
||||
if (vv.expenses != null)
|
||||
{
|
||||
vv.clause4 = "21.4 เชิงค่าใช้จ่าย";
|
||||
vv.bath = " บาท";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (project.twenty_four != null)
|
||||
{
|
||||
|
||||
@@ -14,9 +14,9 @@ using Swashbuckle.AspNetCore.Annotations;
|
||||
namespace rmutr_report.Controllers
|
||||
{
|
||||
[SwaggerTag("สำหรับรายงานคำขอโครงการ Thailand 4.0 (ง.5-2.2)")]
|
||||
public class project_request_thailand: Controller
|
||||
public class project_request_thailand : Controller
|
||||
{
|
||||
readonly Setting _setting;
|
||||
readonly Setting _setting;
|
||||
|
||||
public project_request_thailand(Setting setting)
|
||||
{
|
||||
@@ -28,7 +28,6 @@ namespace rmutr_report.Controllers
|
||||
public IActionResult GetRequestProjectReport([FromRoute] string type,
|
||||
[FromBody] project_principle_rationale project)
|
||||
{
|
||||
|
||||
// foreach (var v in project.five)
|
||||
// {
|
||||
// string na = "ประเด็นยุทธศาสตร์ที่ " ;
|
||||
@@ -47,7 +46,7 @@ namespace rmutr_report.Controllers
|
||||
// }
|
||||
if (project != null)
|
||||
{
|
||||
// var total = project.activity.Count;
|
||||
// var total = project.activity.Count;
|
||||
// if (project.activity != null)
|
||||
// {
|
||||
// foreach (var v in project.activity)
|
||||
@@ -64,7 +63,7 @@ namespace rmutr_report.Controllers
|
||||
// }
|
||||
// }
|
||||
|
||||
if (project.ninth!=null)
|
||||
if (project.ninth != null)
|
||||
{
|
||||
foreach (var vv in project.ninth)
|
||||
{
|
||||
@@ -72,25 +71,32 @@ namespace rmutr_report.Controllers
|
||||
{
|
||||
vv.clause = "11.1 ตัวชี้วัดผลสัมฤทธิ์";
|
||||
}
|
||||
|
||||
if (vv.clause == "9.2 ตัวชี้วัดเชิงนโยบาย")
|
||||
{
|
||||
vv.clause = "11.2 ตัวชี้วัดเชิงนโยบาย";
|
||||
}
|
||||
if (vv.ninths==null)
|
||||
{
|
||||
vv.ninths.Add(new ninth_data_detail()
|
||||
{
|
||||
detail = ""
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (vv.ninths.Any())
|
||||
{
|
||||
if (vv.ninths == null)
|
||||
{
|
||||
foreach (var detail6 in vv.ninths)
|
||||
{
|
||||
detail6.detail = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vv.ninths.Add(new ninth_data_detail()
|
||||
{
|
||||
detail = ""
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (project.sixteenths != null)
|
||||
{
|
||||
@@ -106,16 +112,19 @@ namespace rmutr_report.Controllers
|
||||
sixteenthData.klai_kangwon_total = sum4;
|
||||
}
|
||||
}
|
||||
|
||||
if (project.seventeenth != null)
|
||||
{
|
||||
foreach (var v in project.seventeenth)
|
||||
{
|
||||
int t = 1;
|
||||
string a = "กิจกรรมที่ ";
|
||||
v.activity = a + v.activity;
|
||||
foreach (var vv in v.seventeenths)
|
||||
{
|
||||
string na = "ครั้งที่ ";
|
||||
vv.the_time = na + vv.the_time;
|
||||
vv.the_time = na + t;
|
||||
t++;
|
||||
foreach (var detail in vv.seventeenths2)
|
||||
{
|
||||
string in1 = "พื้นที่ (ภายในมหาวิทยาลัย) ";
|
||||
@@ -128,9 +137,10 @@ namespace rmutr_report.Controllers
|
||||
detail.area_province1 = in1 + detail.area_province1;
|
||||
detail.location1 = in2 + detail.location1;
|
||||
}
|
||||
|
||||
if (detail.internal_external2 == "ภายนอกมหาวิทยาลัย")
|
||||
{
|
||||
detail.text2 = "ภายนอกมหาวิทยาลัย";
|
||||
detail.text2 = "ภายนอกมหาวิทยาลัย";
|
||||
detail.area_province2 = out1 + detail.area_province2;
|
||||
detail.location2 = in2 + detail.location2;
|
||||
}
|
||||
@@ -138,6 +148,7 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.eighteenth != null)
|
||||
{
|
||||
foreach (var v in project.eighteenth)
|
||||
@@ -179,7 +190,6 @@ namespace rmutr_report.Controllers
|
||||
{
|
||||
if (vv.count_quantitative != null)
|
||||
{
|
||||
|
||||
string na = " หน่วยนับ";
|
||||
vv.khrang1 = na;
|
||||
}
|
||||
@@ -253,47 +263,44 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var _project = new List<project_principle_rationale>() { project };
|
||||
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "project_request_thailands.frx");
|
||||
report.RegisterData(_project, "project_principle_rationale");
|
||||
report.Prepare();
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "project_request_thailands.frx");
|
||||
report.RegisterData(_project, "project_principle_rationale");
|
||||
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");
|
||||
break;
|
||||
case "xls":
|
||||
Excel2007Export excel = new Excel2007Export();
|
||||
report.Export(excel, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "application/vnd.ms-excel");
|
||||
break;
|
||||
case "xlsx":
|
||||
Excel2007Export excel1 = new Excel2007Export();
|
||||
report.Export(excel1, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
break;
|
||||
case "doc":
|
||||
case "docx":
|
||||
Word2007Export word = new Word2007Export();
|
||||
report.Export(word, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "appllication/vnd.ms-word");
|
||||
break;
|
||||
}
|
||||
|
||||
return Ok();
|
||||
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");
|
||||
break;
|
||||
case "xls":
|
||||
Excel2007Export excel = new Excel2007Export();
|
||||
report.Export(excel, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "application/vnd.ms-excel");
|
||||
break;
|
||||
case "xlsx":
|
||||
Excel2007Export excel1 = new Excel2007Export();
|
||||
report.Export(excel1, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
break;
|
||||
case "doc":
|
||||
case "docx":
|
||||
Word2007Export word = new Word2007Export();
|
||||
report.Export(word, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "appllication/vnd.ms-word");
|
||||
break;
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user