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

This commit is contained in:
kamonwan taengsuk
2023-10-05 15:59:57 +07:00
parent 4c94c2e3a7
commit 93726110a4
29 changed files with 6306 additions and 498 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using ClosedXML.Excel; using ClosedXML.Excel;
using FastReport; using FastReport;
using FastReport.Export.Csv; using FastReport.Export.Csv;
@@ -21,72 +22,261 @@ namespace rmutr_report.Controllers
{ {
this._setting = setting; this._setting = setting;
} }
[HttpPost, Route("reports/project_request_thailand/{type}")]
[HttpPost, Route("reports/project_request_thailand/{type}")]
[ApiExplorerSettings(GroupName = "reports")] [ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetRequestProjectReport([FromRoute] string type, [FromBody] project_request_thai project) public IActionResult GetRequestProjectReport([FromRoute] string type,
[FromBody] project_principle_rationale project)
{ {
foreach (var v in project.five) // foreach (var v in project.five)
// {
// string na = "ประเด็นยุทธศาสตร์ที่ " ;
// v.strategic_issues = na + v.strategic_issues;
// string na2 = "กลยุทธ์ที่ " ;
// v.measure = na2 + v.measure;
// }
// foreach (var v in project.eleventh)
// {
// foreach (var vv in v.elevenths)
// {
// string na = "ครั้งที่ ";
// vv.the_time = na + vv.the_time;
//
// }
// }
if (project != null)
{ {
string na = "ประเด็นยุทธศาสตร์ที่ " ; var total = project.activity.Count;
v.strategic_issues = na + v.strategic_issues; if (project.activity != null)
string na2 = "กลยุทธ์ที่ " ;
v.measure = na2 + v.measure;
}
foreach (var v in project.eleventh)
{
foreach (var vv in v.elevenths)
{ {
string na = "ครั้งที่ "; foreach (var v in project.activity)
vv.the_time = na + vv.the_time; {
// string na2 = " จำนวน "; if (v.activity != null)
// // vv.count_day = na2 + vv.count_day + " วัน"; {
// // if (project.count_day != null) //var total = project.activity.Select(r => r.count).Sum(t => t.Value);
// // { project.together_with = "ประกอบด้วยกิจกรรมหรือโครงการย่อย " + total + " โครงการดังนี้คือ";
// // project.text3 = "จำนวน " + project.count_day + " วัน"; }
// // } else
{
project.together_with = null;
}
}
}
if (project.eighth != null)
{
foreach (var v in project.eighth)
{
string na = "ประเด็นยุทธศาสตร์ที่ ";
v.strategic_issues = na + v.strategic_issues;
string na2 = "กลยุทธ์ที่ ";
v.measure = na2 + v.measure;
}
}
if (project.fourteenth != null)
{
foreach (var vv in project.fourteenth)
{
// string na = "องค์ประกอบที่ " ;
// vv.component = na + vv.component;
string na2 = "ตัวบ่งชี้ที่ ";
vv.indicator = na2 + vv.indicator;
}
}
if (project.sixteenths != null)
{
foreach (var sixteenthData in project.sixteenths)
{
var sum1 = sixteenthData.sixteenths2.Sum(d => d.salaya);
var sum2 = sixteenthData.sixteenths2.Sum(d => d.bophitphimuk);
var sum3 = sixteenthData.sixteenths2.Sum(d => d.pohchang);
var sum4 = sixteenthData.sixteenths2.Sum(d => d.klai_kangwon);
sixteenthData.salaya_total = sum1;
sixteenthData.bophitphimuk_total = sum2;
sixteenthData.pohchang_total = sum3;
sixteenthData.klai_kangwon_total = sum4;
}
}
if (project.eighteenth != null)
{
foreach (var v in project.eighteenth)
{
foreach (var vv in v.eighteenths)
{
string na = "ครั้งที่ ";
vv.the_time = na + vv.the_time;
string na2 = " จำนวน ";
vv.count_day = na2 + vv.count_day + " วัน";
if (project.count_day != null)
{
project.text3 = "จำนวน " + project.count_day + " วัน";
}
}
}
}
if (project.total_target != null)
{
project.text1 = "ผลรวมกลุ่มเป้าหมาย " + project.total_target;
}
if (project.total_board != null)
{
project.text2 = "ผลรวมคณะกรรมการ " + project.total_board;
}
if (project.twenty_one != null)
{
foreach (var v in project.twenty_one)
{
if (v.activity != null || v.activity != "")
{
v.activity = v.activity;
}
foreach (var vv in v.twenty_ones)
{
// if (vv.clause1 != null || vv.clause1 != "")
// {
// vv.clause1 = vv.clause1;
// }
//
// if (vv.clause2 != null || vv.clause2 != "")
// {
// vv.clause2 = vv.clause2;
// }
//
// if (vv.clause3 != null || vv.clause3 != "")
// {
// vv.clause3 = vv.clause3;
// }
//
// if (vv.clause4 != null || vv.clause4 != "")
// {
// vv.clause4 = vv.clause4;
// }
if (vv.count_quantitative != null)
{
string na = " หน่วยนับ";
vv.khrang1 = na;
}
if (vv.count_unit != null)
{
string na = "ผู้เข้าร่วมโครงการ ";
string na1 = " จำนวน ";
string na2 = " คน";
vv.text1 = na;
vv.text11 = na1;
vv.nuai_nap = na2;
}
if (vv.count_project != null)
{
vv.clause1 = "16.1 เชิงปริมาณ";
string na = "จำนวนครั้งที่ดำเนินโครงการ ";
string na2 = " ครั้ง";
vv.text2 = na;
vv.khrang2 = na2;
}
if (vv.count_training != null)
{
string na = "จำนวนการจัดอบรมและสัมมนา ";
string na2 = " เรื่อง";
vv.text3 = na;
vv.rueang = na2;
}
if (vv.count_knowledge != null)
{
string na = "จำนวนเผยแพร่ความรู้บริการวิชาการ ";
string na2 = " ครั้ง";
vv.text4 = na;
vv.khrang3 = na2;
}
if (vv.project_start_date != null)
{
vv.clause2 = "16.2 เชิงเวลา";
string na3 = "วัน/เดือน/ปี ที่จะดำเนินโครงการ ";
string na4 = " ถึง ";
vv.range = na4;
vv.text5 = na3;
string na5 = "โครงการแล้วเสร็จตามเวลาที่กำหนด (ร้อยละ) ";
vv.text6 = na5;
}
if (vv.percentage1 != null || vv.percentage2 != null)
{
vv.clause3 = "16.3 เชิงคุณภาพ";
string na = "ผู้เข้าร่วมโครงการมีความรู้ความเข้าใจเพิ่มขึ้น (ร้อยละ) ";
string na1 = "ความพึงพอใจของผู้เข้ารับบริการในกระบวนการให้บริการ (ร้อยละ) ";
vv.text7 = na;
vv.text8 = na1;
vv.text9 = "ผู้เข้าร่วมโครงการสามารถนำความรู้ที่ได้รับไปบูรณาการอย่างไรบ้าง";
vv.text10 = "รายละเอียด";
}
if (vv.expenses != null)
{
vv.clause4 = "16.4 เชิงค่าใช้จ่าย";
vv.bath = " บาท";
}
}
}
} }
} }
var _project = new List<project_request_thai>() {project};
Report report = new Report();
report.Load(_setting.report_path + "project_request_thailands.frx");
report.RegisterData(_project, "project_request_thai");
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": var _project = new List<project_principle_rationale>() { project };
Excel2007Export excel = new Excel2007Export();
report.Export(excel, stream); Report report = new Report();
stream.Seek(0, SeekOrigin.Begin); report.Load(_setting.report_path + "project_request_thailands.frx");
return File(stream, "application/vnd.ms-excel"); report.RegisterData(_project, "project_principle_rationale");
break; report.Prepare();
case "mht":
MHTExport mht = new MHTExport(); MemoryStream stream = new MemoryStream();
report.Export(mht, stream); switch (type)
stream.Seek(0, SeekOrigin.Begin); {
return File(stream, "multipart/related"); case "pdf":
break; PDFExport pdf = new PDFExport();
case "doc": case "docx": report.Export(pdf, stream);
Word2007Export word = new Word2007Export(); stream.Seek(0, SeekOrigin.Begin);
report.Export(word, stream); return File(stream, "application/pdf");
stream.Seek(0, SeekOrigin.Begin);
return File(stream, "appllication/vnd.ms-word"); case "xls":
break; case "xlsx":
Excel2007Export excel = new Excel2007Export();
report.Export(excel, stream);
stream.Seek(0, SeekOrigin.Begin);
return File(stream, "application/vnd.ms-excel");
break;
case "mht":
MHTExport mht = new MHTExport();
report.Export(mht, stream);
stream.Seek(0, SeekOrigin.Begin);
return File(stream, "multipart/related");
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();
} }
return Ok();
} }
}
}
}

View File

@@ -37,6 +37,8 @@ namespace rmutr_report.Models
public string strategic_issues_thirteenth { get; set; } //ข้อ 13 public string strategic_issues_thirteenth { get; set; } //ข้อ 13
public string subject_thirteenth { get; set; } //ข้อ 13 public string subject_thirteenth { get; set; } //ข้อ 13
public string strategy_thirteenth { get; set; } //ข้อ 13 public string strategy_thirteenth { get; set; } //ข้อ 13
public decimal? durable_articles { get; set; } //งบลงทุน
public decimal? land_building { get; set; } // ค่าที่ดินและสิ่งก่อสร้าง
public List<fourteenth_data> fourteenth { get; set; } //ข้อ 14 public List<fourteenth_data> fourteenth { get; set; } //ข้อ 14
public List<fifteenth_data> fifteenth { get; set; } //ข้อ 15 public List<fifteenth_data> fifteenth { get; set; } //ข้อ 15
public int? count_activity { get; set; } //ข้อ 16 public int? count_activity { get; set; } //ข้อ 16
@@ -53,6 +55,10 @@ namespace rmutr_report.Models
public List<eighteenth_data> eighteenth { get; set; } //ข้อ 18 public List<eighteenth_data> eighteenth { get; set; } //ข้อ 18
public List<nineteenth_data> nineteenth { get; set; } //ข้อ 19 public List<nineteenth_data> nineteenth { get; set; } //ข้อ 19
public List<nineteenth_data1> nineteenth1 { get; set; } //ข้อ 19 public List<nineteenth_data1> nineteenth1 { get; set; } //ข้อ 19
public List<seventeenth_datas> seventeenth_thai { get; set; } //ข้อ 17
public List<eighteenths_datas> eighteenth_thai { get; set; } //ข้อ 18
public List<eighteenths_datas> nineteenth_thai { get; set; } //ข้อ 19
public decimal? budget_amount { get; set; } //ข้อ 20 public decimal? budget_amount { get; set; } //ข้อ 20
public List<twentieth_data> twentieth { get; set; } //ข้อ 20 public List<twentieth_data> twentieth { get; set; } //ข้อ 20
public List<twenty_one_data> twenty_one { get; set; } //ข้อ 21 public List<twenty_one_data> twenty_one { get; set; } //ข้อ 21
@@ -327,7 +333,7 @@ namespace rmutr_report.Models
public decimal? count_person { get; set; } public decimal? count_person { get; set; }
public decimal? total_amount { get; set; } public decimal? total_amount { get; set; }
} }
// public class nineteenth2_data_details3 // public class nineteenth2_data_details3
// { // {

Binary file not shown.

Binary file not shown.

View File

@@ -172,3 +172,8 @@ C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\net5.0\rmutr_report.xml
C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\net5.0\rmutr_report.pdb C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\net5.0\rmutr_report.pdb
C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\net5.0\rmutr_report.genruntimeconfig.cache C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\net5.0\rmutr_report.genruntimeconfig.cache
C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\net5.0\ref\rmutr_report.dll C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\net5.0\ref\rmutr_report.dll
C:\Users\USER\Documents\rmutr_report\obj\Debug\net5.0\staticwebassets\rmutr_report.StaticWebAssets.Pack.cache
C:\Users\USER\Documents\rmutr_report\obj\Debug\net5.0\staticwebassets\msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props
C:\Users\USER\Documents\rmutr_report\obj\Debug\net5.0\staticwebassets\msbuild.build.rmutr_report.props
C:\Users\USER\Documents\rmutr_report\obj\Debug\net5.0\staticwebassets\msbuild.buildMultiTargeting.rmutr_report.props
C:\Users\USER\Documents\rmutr_report\obj\Debug\net5.0\staticwebassets\msbuild.buildTransitive.rmutr_report.props

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
<Project>
<Import Project="Microsoft.AspNetCore.StaticWebAssets.props" />
</Project>

View File

@@ -0,0 +1,3 @@
<Project>
<Import Project="..\build\rmutr_report.props" />
</Project>

View File

@@ -0,0 +1,3 @@
<Project>
<Import Project="..\buildMultiTargeting\rmutr_report.props" />
</Project>

View File

@@ -0,0 +1 @@
30ffb1b917a7940f2113a9893d63f0242ae2ce84

View File

@@ -1 +1 @@
19cbe7ca27a40701bf27c16c63d4cc2288aaa77f e7bf80044d6fb9241039252a0030601ca4d59acf

View File

@@ -166,3 +166,8 @@ C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\netcoreapp3.1\rmutr_report.dl
C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\netcoreapp3.1\rmutr_report.xml C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\netcoreapp3.1\rmutr_report.xml
C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\netcoreapp3.1\rmutr_report.pdb C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\netcoreapp3.1\rmutr_report.pdb
C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\netcoreapp3.1\rmutr_report.genruntimeconfig.cache C:\Users\USER\RiderProjects\rmutr_report\obj\Debug\netcoreapp3.1\rmutr_report.genruntimeconfig.cache
C:\Users\USER\Documents\rmutr_report\obj\Debug\netcoreapp3.1\staticwebassets\rmutr_report.StaticWebAssets.Pack.cache
C:\Users\USER\Documents\rmutr_report\obj\Debug\netcoreapp3.1\staticwebassets\msbuild.rmutr_report.Microsoft.AspNetCore.StaticWebAssets.props
C:\Users\USER\Documents\rmutr_report\obj\Debug\netcoreapp3.1\staticwebassets\msbuild.build.rmutr_report.props
C:\Users\USER\Documents\rmutr_report\obj\Debug\netcoreapp3.1\staticwebassets\msbuild.buildMultiTargeting.rmutr_report.props
C:\Users\USER\Documents\rmutr_report\obj\Debug\netcoreapp3.1\staticwebassets\msbuild.buildTransitive.rmutr_report.props

View File

@@ -0,0 +1,3 @@
<Project>
<Import Project="Microsoft.AspNetCore.StaticWebAssets.props" />
</Project>

View File

@@ -0,0 +1,3 @@
<Project>
<Import Project="..\build\rmutr_report.props" />
</Project>

View File

@@ -0,0 +1,3 @@
<Project>
<Import Project="..\buildMultiTargeting\rmutr_report.props" />
</Project>

View File

@@ -0,0 +1 @@
30ffb1b917a7940f2113a9893d63f0242ae2ce84

View File

@@ -1 +1 @@
16963968833075202 16964958954067386

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="09/14/2021 15:20:39" ReportInfo.Modified="10/04/2023 18:54:57" ReportInfo.CreatorVersion="2021.1.0.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="09/14/2021 15:20:39" ReportInfo.Modified="10/05/2023 15:40:40" ReportInfo.CreatorVersion="2021.1.0.0">
<Dictionary> <Dictionary>
<BusinessObjectDataSource Name="summary_income_cooperative" ReferenceName="summary_income_cooperative" DataType="null" Enabled="true"> <BusinessObjectDataSource Name="summary_income_cooperative" ReferenceName="summary_income_cooperative" DataType="null" Enabled="true">
<Column Name="budget_year" DataType="System.String"/> <Column Name="budget_year" DataType="System.String"/>
@@ -46,8 +46,8 @@
<TextObject Name="Text84" Left="415.8" Top="75.6" Width="434.7" Height="37.8" Text="คณะ/วิทยาลัย [summary_income_cooperative.faculty_college]" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text84" Left="415.8" Top="75.6" Width="434.7" Height="37.8" Text="คณะ/วิทยาลัย [summary_income_cooperative.faculty_college]" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/>
<TextObject Name="Text85" Left="850.5" Top="75.6" Width="368.55" Height="37.8" Text="พื้นที่ [summary_income_cooperative.area]" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text85" Left="850.5" Top="75.6" Width="368.55" Height="37.8" Text="พื้นที่ [summary_income_cooperative.area]" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/>
</PageHeaderBand> </PageHeaderBand>
<DataBand Name="Data1" Top="262.56" Width="1436.4"> <DataBand Name="Data1" Top="260.63" Width="1436.4">
<DataBand Name="Data4" Top="269.96" Width="1436.4" Height="47.25" DataSource="data"> <DataBand Name="Data4" Top="266.11" Width="1436.4" Height="47.25" DataSource="data">
<TableObject Name="Table19" Width="1436.4" Height="47.25" Border.Lines="All"> <TableObject Name="Table19" Width="1436.4" Height="47.25" Border.Lines="All">
<TableColumn Name="Column161" Width="321.3"/> <TableColumn Name="Column161" Width="321.3"/>
<TableColumn Name="Column162" Width="189"/> <TableColumn Name="Column162" Width="189"/>
@@ -175,14 +175,17 @@
</TableObject> </TableObject>
</DataBand> </DataBand>
</DataBand> </DataBand>
<ReportSummaryBand Name="ReportSummary1" Top="324.62" Width="1436.4" Height="141.75"> <ReportSummaryBand Name="ReportSummary1" Top="318.84" Width="1436.4" Height="141.75">
<TextObject Name="Text114" Left="926.1" Top="28.35" Width="151.2" Height="37.8" Text="ลงชื่อ" HorzAlign="Right" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text114" Left="926.1" Top="28.35" Width="151.2" Height="37.8" Text="ลงชื่อ" HorzAlign="Right" VertAlign="Bottom" Font="TH Sarabun New, 16pt, style=Bold"/>
<TextObject Name="Text116" Left="1077.3" Top="28.35" Width="226.8" Height="37.8" Text="[summary_income_cooperative.maker]" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text116" Left="1077.3" Top="28.35" Width="226.8" Height="37.8" Text="[summary_income_cooperative.maker]" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/>
<TextObject Name="Text117" Left="1304.1" Top="28.35" Width="132.3" Height="37.8" Text="ผู้จัดทำ" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text117" Left="1304.1" Top="28.35" Width="132.3" Height="37.8" Text="ผู้จัดทำ" VertAlign="Bottom" Font="TH Sarabun New, 16pt, style=Bold"/>
<TextObject Name="Text118" Left="926.1" Top="66.15" Width="151.2" Height="37.8" Text="ตำแหน่ง" HorzAlign="Right" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text118" Left="926.1" Top="66.15" Width="151.2" Height="37.8" Text="ตำแหน่ง" HorzAlign="Right" VertAlign="Bottom" Font="TH Sarabun New, 16pt, style=Bold"/>
<TextObject Name="Text119" Left="1077.3" Top="66.15" Width="226.8" Height="37.8" Text="[summary_income_cooperative.position_maker]" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text119" Left="1077.3" Top="66.15" Width="226.8" Height="37.8" Text="[summary_income_cooperative.position_maker]" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/>
<TextObject Name="Text120" Left="1077.3" Top="103.95" Width="226.8" Height="37.8" Text="[summary_income_cooperative.maker_date]" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text120" Left="1077.3" Top="103.95" Width="226.8" Height="37.8" Text="[summary_income_cooperative.maker_date]" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/>
<TextObject Name="Text121" Left="926.1" Top="103.95" Width="151.2" Height="37.8" Text="เบอร์โทรติดต่อ" HorzAlign="Right" VertAlign="Center" Font="TH Sarabun New, 16pt, style=Bold"/> <TextObject Name="Text121" Left="926.1" Top="103.95" Width="151.2" Height="37.8" Text="เบอร์โทรติดต่อ" HorzAlign="Right" VertAlign="Bottom" Font="TH Sarabun New, 16pt, style=Bold"/>
<LineObject Name="Line1" Left="1077.3" Top="56.7" Width="226.8" Border.Style="Dot" Diagonal="true"/>
<LineObject Name="Line2" Left="1077.3" Top="94.5" Width="226.8" Border.Style="Dot" Diagonal="true"/>
<LineObject Name="Line3" Left="1077.3" Top="132.3" Width="226.8" Border.Style="Dot" Diagonal="true"/>
</ReportSummaryBand> </ReportSummaryBand>
</ReportPage> </ReportPage>
</Report> </Report>