bug fixed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kamonwan taengsuk
2023-11-16 17:56:47 +07:00
parent c5370d5128
commit af9a9c8af5
12 changed files with 452 additions and 353 deletions

View File

@@ -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();
}
}
}