แก้ report เกษียณ

This commit is contained in:
Kittapath 2023-10-12 04:46:44 +07:00
parent fb6e71c60c
commit 21aabd2ec3
9 changed files with 33 additions and 14 deletions

View file

@ -39,6 +39,7 @@ namespace BMA.EHR.Report.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet("{exportType}/{Id}")]
[AllowAnonymous]
public async Task<ActionResult<ResponseObject>> GetProfileRetirement([FromRoute] Guid Id, string exportType = "pdf")
{
var retire = await _service.GetProfileRetirementdAsync(Id);
@ -104,7 +105,7 @@ namespace BMA.EHR.Report.Service.Controllers
}
report.ReportParameters["Type"].Value = (returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.docx") && (returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.docx") && (returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "ยกเลิกประกาศเกษียณลูกจ้างประจำ.docx") && (returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.pdf" && returnfile != "แก้ไขประกาศเกษียณลูกจ้างประจำ.docx") ? "1" : "0";
var _profileList = new List<dynamic>();
var _count=0;
var _count = 0;
var tmpOc1 = string.Empty;
foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire))
{
@ -121,7 +122,7 @@ namespace BMA.EHR.Report.Service.Controllers
string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString();
thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}";
_profileList.Add(new
{
{
count = $"{_count.ToString().ToThaiNumber()}.",
no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.",
order = thaiOrder,
@ -130,10 +131,12 @@ namespace BMA.EHR.Report.Service.Controllers
position = string.IsNullOrEmpty(profile.GetType().GetProperty("position").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("position").GetValue(profile),
posNo = string.IsNullOrEmpty(profile.GetType().GetProperty("posNo").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNo").GetValue(profile),
organizationOrganization = string.IsNullOrEmpty(profile.GetType().GetProperty("organizationOrganization").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("organizationOrganization").GetValue(profile),
positionEmployeePosition = string.IsNullOrEmpty(profile.GetType().GetProperty("positionEmployeePosition").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("positionEmployeePosition").GetValue(profile),
posNoEmployee = string.IsNullOrEmpty(profile.GetType().GetProperty("posNoEmployee").GetValue(profile)) ? string.Empty : profile.GetType().GetProperty("posNoEmployee").GetValue(profile),
});
}
//Binding Data
if(report.ReportParameters["Type"].Value == "1")
if (report.ReportParameters["Type"].Value == "1")
{
report.ReportParameters["Year"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Year").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Year").GetValue(retire);
report.ReportParameters["Total"].Value = string.IsNullOrEmpty(retire.GetType().GetProperty("Total").GetValue(retire)) ? string.Empty : retire.GetType().GetProperty("Total").GetValue(retire);