From 8ae822d05baace38fa1cc232211d66c9f098b90a Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Fri, 29 May 2026 15:46:29 +0700 Subject: [PATCH] leave report #2524 --- .../Controllers/LeaveReportController.cs | 50 ++++++++++++++++--- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/BMA.EHR.Leave/Controllers/LeaveReportController.cs b/BMA.EHR.Leave/Controllers/LeaveReportController.cs index abdf5f2b..cfc84ef0 100644 --- a/BMA.EHR.Leave/Controllers/LeaveReportController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveReportController.cs @@ -2444,6 +2444,15 @@ namespace BMA.EHR.Leave.Service.Controllers var workTotal = 0; var seminarTotal = 0; + var wfaTotal = 0; //ปฏิบัติงานนอกสถานที่ + var outOfficeTotal = 0; //ขออนุญาติิิออกนอกสถานที่ + var oneStopSrvrTotal = 0; //จุดบริการด่วนมหานคร + var otherTotal = 0; //อื่นๆ + + + + + var defaultRound = await _dutyTimeRepository.GetDefaultAsync(); if (defaultRound == null) { @@ -2627,10 +2636,18 @@ namespace BMA.EHR.Leave.Service.Controllers workTotal += 1; if (!timeStamps.IsLocationCheckIn) { - if (timeStamps.CheckInLocationName == "ปฏิบัติงานที่บ้าน") + if (timeStamps.CheckInLocationName!.Contains("ปฏิบัติงานที่บ้าน")) wfhTotal += 1; else if (timeStamps.CheckInLocationName == "ไปประชุม / อบรม / สัมมนา") seminarTotal += 1; + else if (timeStamps.CheckInLocationName.Contains("ปฏิบัติงานนอกสถานที่")) + wfaTotal += 1; + else if (timeStamps.CheckInLocationName.Contains("ขออนุญาตออกนอกสถานที่")) + outOfficeTotal += 1; + else if (timeStamps.CheckInLocationName.Contains("ปฏิบัติงานในจุดบริการด่วนมหานคร")) + oneStopSrvrTotal += 1; + else if (timeStamps.CheckInLocationName.Contains("อื่นๆ")) + otherTotal += 1; } } @@ -2781,19 +2798,36 @@ namespace BMA.EHR.Leave.Service.Controllers worksheet.Cells[lastRow + 2, 8].Value = "อบรม ประชุม สัมมนาฯ"; worksheet.Cells[lastRow + 2, 9].Value = seminarTotal; worksheet.Cells[lastRow + 2, 10].Value = "คน"; + worksheet.Cells[lastRow + 3, 8].Value = "ปฎิบัติงานนอกสถานที่"; + worksheet.Cells[lastRow + 3, 9].Value = wfaTotal; + worksheet.Cells[lastRow + 3, 10].Value = "คน"; + worksheet.Cells[lastRow + 4, 8].Value = "ขออนุญาตออกนอกสถานที่"; + worksheet.Cells[lastRow + 4, 9].Value = outOfficeTotal; + worksheet.Cells[lastRow + 4, 10].Value = "คน"; + worksheet.Cells[lastRow + 5, 8].Value = "ปฎิบัติงานในจุดบริการด่วนมหานคร"; + worksheet.Cells[lastRow + 5, 9].Value = oneStopSrvrTotal; + worksheet.Cells[lastRow + 5, 10].Value = "คน"; + worksheet.Cells[lastRow + 6, 8].Value = "อื่นๆ"; + worksheet.Cells[lastRow + 6, 9].Value = otherTotal; + worksheet.Cells[lastRow + 6, 10].Value = "คน"; + + + + + worksheet.Cells[lastRow + 3, 2].Value = "ลาป่วย/ลากิจ"; worksheet.Cells[lastRow + 3, 5].Value = sickTotal; worksheet.Cells[lastRow + 3, 6].Value = "คน"; worksheet.Cells[lastRow + 4, 2].Value = "มาสาย"; worksheet.Cells[lastRow + 4, 5].Value = lateTotal; worksheet.Cells[lastRow + 4, 6].Value = "คน"; - worksheet.Cells[lastRow + 6, 2].Value = "เรียน"; - worksheet.Cells[lastRow + 7, 2].Value = "เพื่อโปรดทราบ"; - worksheet.Cells[lastRow + 7, 9].Value = "ทราบ"; - worksheet.Cells[lastRow + 7, 9].Style.Font.Bold = true; - worksheet.Cells[lastRow + 7, 9].Style.Font.Size = 22; - worksheet.Cells[lastRow + 8, 2].Value = "................................"; - worksheet.Cells[lastRow + 8, 9].Value = "................................"; + worksheet.Cells[lastRow + 8, 2].Value = "เรียน"; + worksheet.Cells[lastRow + 9, 2].Value = "เพื่อโปรดทราบ"; + worksheet.Cells[lastRow + 9, 9].Value = "ทราบ"; + worksheet.Cells[lastRow + 9, 9].Style.Font.Bold = true; + worksheet.Cells[lastRow + 9, 9].Style.Font.Size = 22; + worksheet.Cells[lastRow + 10, 2].Value = "................................"; + worksheet.Cells[lastRow + 10, 9].Value = "................................"; worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns(); var fileBytes = package.GetAsByteArray(); return File(fileBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "TimeStampRecords.xlsx");