diff --git a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs index cbe645cc..257299e0 100644 --- a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs @@ -107,14 +107,22 @@ namespace BMA.EHR.Application.Repositories.Reports var results = responseTask.Result; var json = results.Content.ReadAsStringAsync().Result; List profiles = JsonConvert.DeserializeObject>(json); - profiles = profiles.OrderBy(x => x.order).ToList(); + if (retireHistorys.TypeReport != null) + { + retireHistorys.Total = profiles.Where(x => x.remove == retireHistorys.TypeReport).Count(); + profiles = profiles.Where(x => x.remove == retireHistorys.TypeReport).OrderBy(x => x.order).ToList(); + } + else + { + profiles = profiles.OrderBy(x => x.order).ToList(); + } return new { retireHistorys.Detail, retireHistorys.Id, retireHistorys.CreatedAt, Year = retireHistorys.Year.ToThaiYear().ToString().ToThaiNumber(), retireHistorys.Round, retireHistorys.Type, retireHistorys.TypeReport, Total = retireHistorys.Total.ToString().ToThaiNumber(), profile = profiles}; } } else { var profile_retire = await _dbContext.Set() - .Where(x => x.RetirementPeriod == retire) + .Where(x => x.RetirementPeriod == retire && (retire.TypeReport == null || retire.TypeReport == x.Remove)) .OrderBy(x => x.Order) .Select(x => new { diff --git a/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj b/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj index 71b09ca1..514aba34 100644 --- a/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj +++ b/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj @@ -265,6 +265,15 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs index 9d56912b..3e639eec 100644 --- a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs @@ -71,8 +71,27 @@ namespace BMA.EHR.Report.Service.Controllers } break; case "EMPLOYEE": - reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ.trdp"; - returnfile = $"ประกาศเกษียณลูกจ้าง.{exportType}"; + //reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ.trdp"; + //returnfile = $"ประกาศเกษียณลูกจ้าง.{exportType}"; + if (string.IsNullOrEmpty(retire.GetType().GetProperty("TypeReport").GetValue(retire))) + { + reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-1.trdp"; + returnfile = $"ประกาศเกษียณลูกจ้างประจำ.{exportType}"; + } + else if (retire.GetType().GetProperty("TypeReport").GetValue(retire) == "ADD" || retire.GetType().GetProperty("TypeReport").GetValue(retire) == "EDIT") + { + reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-2.trdp"; + returnfile = $"แก้ไขประกาศเกษียณลูกจ้างประจำ.{exportType}"; + } + else if (retire.GetType().GetProperty("TypeReport").GetValue(retire) == "REMOVE") + { + reportfile = $"32-ประกาศเกษียณลูกจ้างประจำ-3.trdp"; + returnfile = $"ยกเลิกประกาศเกษียณลูกจ้างประจำ.{exportType}"; + } + else + { + return Error(retire.GetType().GetProperty("TypeReport").GetValue(retire)); + } break; default: return Error(retire.GetType().GetProperty("Type").GetValue(retire)); @@ -89,15 +108,17 @@ namespace BMA.EHR.Report.Service.Controllers ////Add Parameter //report.ReportParameters["Year"].Value = retire.GetType().GetProperty("Year").GetValue(retire); //report.ReportParameters["Total"].Value = retire.GetType().GetProperty("Total").GetValue(retire); + report.ReportParameters["Type"].Value = returnfile != "ยกเลิกประกาศเกษียณข้าราชการ.pdf" && returnfile != "แก้ไขประกาศเกษียณข้าราชการ.pdf" ? "1" : "0"; var _profileList = new List(); foreach (var profile in retire.GetType().GetProperty("profile").GetValue(retire)) { - string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString() + "."; - thaiOrder = thaiOrder.ToThaiNumber(); + string thaiOrder = profile.GetType().GetProperty("order").GetValue(profile).ToString(); + thaiOrder = $"ลำดับที่ {thaiOrder.ToThaiNumber()}"; _profileList.Add(new - { + { + no = $"{(_profileList.Count() + 1).ToString().ToThaiNumber()}.", order = thaiOrder, fullName = profile.GetType().GetProperty("fullName").GetValue(profile).ToString(), position = profile.GetType().GetProperty("position").GetValue(profile).ToString(), diff --git a/BMA.EHR.Report.Service/Reports/14-แบบบันทึกผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้ดูแล-1.trdp b/BMA.EHR.Report.Service/Reports/14-แบบบันทึกผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้ดูแล-1.trdp index b9668284..0cb2acd4 100644 Binary files a/BMA.EHR.Report.Service/Reports/14-แบบบันทึกผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้ดูแล-1.trdp and b/BMA.EHR.Report.Service/Reports/14-แบบบันทึกผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้ดูแล-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp b/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp index 5866bef1..30e66f1e 100644 Binary files a/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp and b/BMA.EHR.Report.Service/Reports/16-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับผู้บังคับบัญชา-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp b/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp index c80209a3..2f9797ee 100644 Binary files a/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp and b/BMA.EHR.Report.Service/Reports/17-แบบประเมินผลการทดลองปฏิบัติหน้าที่ราชการ สำหรับคณะกรรมการ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp index 75a2286d..d35970a9 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp index 132a00da..9cf3c25a 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-2.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp index 2919650d..5af6be59 100644 Binary files a/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp and b/BMA.EHR.Report.Service/Reports/31-ประกาศเกษียณข้าราชการ-3.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp similarity index 92% rename from BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp rename to BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp index 5799b202..d0cbb473 100644 Binary files a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-2.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-2.trdp new file mode 100644 index 00000000..e10230c2 Binary files /dev/null and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-2.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-3.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-3.trdp new file mode 100644 index 00000000..d55cfd2d Binary files /dev/null and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ-3.trdp differ