From ab4c5988e86b5c0913f81283bccb5adf1e98472e Mon Sep 17 00:00:00 2001 From: Kittapath Date: Sat, 23 Sep 2023 18:10:12 +0700 Subject: [PATCH] =?UTF-8?q?dashboard=20=E0=B8=88=E0=B8=B3=E0=B8=99?= =?UTF-8?q?=E0=B8=A7=E0=B8=99=E0=B8=84=E0=B8=99=E0=B8=A2=E0=B8=B7=E0=B8=99?= =?UTF-8?q?=E0=B8=A2=E0=B8=B1=E0=B8=99=E0=B8=AA=E0=B8=A1=E0=B8=B1=E0=B8=84?= =?UTF-8?q?=E0=B8=A3=E0=B8=AA=E0=B8=AD=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/PeriodExamService.cs | 66 ++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index 5f83062..883d867 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -1243,36 +1243,42 @@ namespace BMA.EHR.Recurit.Exam.Service.Services new DashboardResponseItem { Id = 2, + Name = "จำนวนผู้ยืนยันการสมัครคัดเลือก", + Count = periodExam.Candidate.Where(x=>x.Status!="register").Count() + }, + new DashboardResponseItem + { + Id = 3, Name = "จำนวนผู้มีสิทธิ์เข้ารับคัดเลือกทั้งหมด", Count = periodExam.Candidate.Where(x=>x.ExamIdenNumber != null).Count() }, new DashboardResponseItem { - Id = 3, + Id = 4, Name = "จำนวนผู้เข้ารับการคัดเลือกทั้งหมด", Count = periodExam.Candidate.Where(x=>x.SeatNumber != null).Count() }, new DashboardResponseItem { - Id = 4, + Id = 5, Name = "ผ่านการสอบ", Count = periodExam.Candidate.Where(x=>x.Pass=="ผ่าน" || x.Pass=="ได้").Count() }, new DashboardResponseItem { - Id = 5, + Id = 6, Name = "ไม่ผ่านการสอบ", Count = periodExam.Candidate.Where(x=>x.Pass!=null && x.Pass!="ผ่าน" && x.Pass!="ได้").Count() }, new DashboardResponseItem { - Id = 6, + Id = 7, Name = "เพศชาย", Count = periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName=="นาย").Count() }, new DashboardResponseItem { - Id = 7, + Id = 8, Name = "เพศหญิง", Count = periodExam.Candidate.Where(x=>x.PrefixName != null && (x.PrefixName=="นาง" || x.PrefixName=="นางสาว")).Count() }, @@ -1687,10 +1693,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.TabColor = System.Drawing.Color.Black; // summarySheet.DefaultRowHeight = 17; summarySheet.Column(1).Style.Font.Bold = true; - summarySheet.Row(4).Style.Font.Bold = true; + summarySheet.Row(5).Style.Font.Bold = true; + summarySheet.Row(6).Style.Font.Bold = true; summarySheet.Cells[1, 3].Style.Font.Bold = true; int rowName = 2; int rowCount = 2; + int fixMerge = 2; summarySheet.Cells[1, 1].Value = "ตั้งแต่"; summarySheet.Cells[1, 2].Value = item.DateStart.Date.ToThaiShortDate(); summarySheet.Cells[1, 3].Value = "ถึง"; @@ -1699,9 +1707,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services summarySheet.Cells[2, 2].Value = periodExam.Name; summarySheet.Cells[3, 1].Value = "ครั้งที่"; summarySheet.Cells[3, 2].Value = $"{periodExam.Round}/{periodExam.Year + 543}"; + summarySheet.Cells[4, 1].Value = "จำนวนผู้สมัคร"; + summarySheet.Cells[4, 2].Value = candidates.Count(); if (candidates.Count() > 0) { - summarySheet.Cells[5, 1].Value = "จำนวน"; + summarySheet.Cells[7, 1].Value = "จำนวน"; // summarySheet.Cells[1, 6].Value = "คะแนนภาค ข"; // summarySheet.Cells[1, 7].Value = "ผลสอบภาค ข"; // summarySheet.Cells[1, 8].Value = "คะแนนเต็มภาค ค"; @@ -1723,11 +1733,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services foreach (var education in educations) { - summarySheet.Cells[4, rowName].Value = education.Name; - summarySheet.Cells[5, rowCount].Value = education.Count; + summarySheet.Cells[6, rowName].Value = education.Name; + summarySheet.Cells[7, rowCount].Value = education.Count; rowName++; rowCount++; } + summarySheet.Cells[5, fixMerge, 5, rowName].Value = "วุฒิการศึกษา"; + summarySheet.Cells[5, fixMerge, 5, rowName].Merge = true; + fixMerge = rowCount; var careers = await _context.Careers .AsQueryable() .Where(x => x.Candidate.PeriodExam == periodExam) @@ -1742,39 +1755,44 @@ namespace BMA.EHR.Recurit.Exam.Service.Services .ToListAsync(); foreach (var career in careers) { - summarySheet.Cells[4, rowName].Value = career.Name; - summarySheet.Cells[5, rowCount].Value = career.Count; + summarySheet.Cells[6, rowName].Value = career.Name; + summarySheet.Cells[7, rowCount].Value = career.Count; rowName++; rowCount++; } - summarySheet.Cells[4, rowName].Value = "อายุ 1-20 ปี"; - summarySheet.Cells[5, rowCount].Value = candidates.Where(x => x.Age >= 1 && x.Age <= 20).Count(); + summarySheet.Cells[5, fixMerge, 5, rowName].Value = "สถานที่ทำงาน/ฝึกงาน"; + summarySheet.Cells[5, fixMerge, 5, rowName].Merge = true; + fixMerge = rowCount; + summarySheet.Cells[6, rowName].Value = "อายุ 1-20 ปี"; + summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 1 && x.Age <= 20).Count(); rowName++; rowCount++; - summarySheet.Cells[4, rowName].Value = "อายุ 21-45 ปี"; - summarySheet.Cells[5, rowCount].Value = candidates.Where(x => x.Age >= 21 && x.Age <= 45).Count(); + summarySheet.Cells[6, rowName].Value = "อายุ 21-45 ปี"; + summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 21 && x.Age <= 45).Count(); rowName++; rowCount++; - summarySheet.Cells[4, rowName].Value = "อายุ 46-60 ปี"; - summarySheet.Cells[5, rowCount].Value = candidates.Where(x => x.Age >= 46 && x.Age <= 60).Count(); + summarySheet.Cells[6, rowName].Value = "อายุ 46-60 ปี"; + summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 46 && x.Age <= 60).Count(); rowName++; rowCount++; - summarySheet.Cells[4, rowName].Value = "อายุ 61-70 ปี"; - summarySheet.Cells[5, rowCount].Value = candidates.Where(x => x.Age >= 61 && x.Age <= 70).Count(); + summarySheet.Cells[6, rowName].Value = "อายุ 61-70 ปี"; + summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 61 && x.Age <= 70).Count(); rowName++; rowCount++; - summarySheet.Cells[4, rowName].Value = "อายุ 71-80 ปี"; - summarySheet.Cells[5, rowCount].Value = candidates.Where(x => x.Age >= 71 && x.Age <= 80).Count(); + summarySheet.Cells[6, rowName].Value = "อายุ 71-80 ปี"; + summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 71 && x.Age <= 80).Count(); rowName++; rowCount++; - summarySheet.Cells[4, rowName].Value = "อายุ 80 ปีขึ้นไป"; - summarySheet.Cells[5, rowCount].Value = candidates.Where(x => x.Age >= 81).Count(); + summarySheet.Cells[6, rowName].Value = "อายุ 80 ปีขึ้นไป"; + summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 81).Count(); rowName++; rowCount++; + summarySheet.Cells[5, fixMerge, 5, rowName].Value = "ช่วงอายุ"; + summarySheet.Cells[5, fixMerge, 5, rowName].Merge = true; } else { - summarySheet.Cells[5, 1].Value = "ไม่มีผู้สมัครสอบในช่วงเวลานี้"; + summarySheet.Cells[7, 1].Value = "ไม่มีผู้สมัครสอบในช่วงเวลานี้"; } summarySheet.Cells[summarySheet.Dimension.Address].AutoFitColumns(); package.Save();