From cec878cb94f2de5879e6d773a40175471dbe1447 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Wed, 29 Jan 2025 14:49:42 +0700 Subject: [PATCH] =?UTF-8?q?fix=20issue=20:=20SIT=20=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=9A=E0=B8=9A=E0=B8=9A=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B6?= =?UTF-8?q?=E0=B8=81=E0=B9=80=E0=B8=A7=E0=B8=A5=E0=B8=B2=E0=B8=9B=E0=B8=8F?= =?UTF-8?q?=E0=B8=B4=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=87=E0=B8=B2?= =?UTF-8?q?=E0=B8=99>>=E0=B8=A5=E0=B8=87=E0=B9=80=E0=B8=A7=E0=B8=A5?= =?UTF-8?q?=E0=B8=B2=E0=B9=80=E0=B8=82=E0=B9=89=E0=B8=B2-=E0=B8=AD?= =?UTF-8?q?=E0=B8=AD=E0=B8=81=E0=B8=87=E0=B8=B2=E0=B8=99=20(=E0=B8=81?= =?UTF-8?q?=E0=B8=A3=E0=B8=93=E0=B8=B5=E0=B8=A5=E0=B8=87=E0=B9=80=E0=B8=A7?= =?UTF-8?q?=E0=B8=A5=E0=B8=B2=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=AD=E0=B8=B5?= =?UTF-8?q?=E0=B8=81=E0=B8=A7=E0=B8=B1=E0=B8=99)=20#921=20=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=9A=E0=B8=9A=E0=B8=A5=E0=B8=87=E0=B9=80=E0=B8=A7?= =?UTF-8?q?=E0=B8=A5=E0=B8=B2=E0=B8=95=E0=B9=89=E0=B8=AD=E0=B8=87=E0=B8=A1?= =?UTF-8?q?=E0=B8=B5=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=8A=E0=B9=87?= =?UTF-8?q?=E0=B8=84=E0=B8=AA=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=B0=E0=B9=83?= =?UTF-8?q?=E0=B8=99=20rabbitMQ=20=E0=B8=94=E0=B9=89=E0=B8=A7=E0=B8=A2?= =?UTF-8?q?=E0=B8=A7=E0=B9=88=E0=B8=B2=E0=B8=A1=E0=B8=B5=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=A3=E0=B8=AD=E0=B8=A3=E0=B8=B1=E0=B8=99=E0=B8=AD?= =?UTF-8?q?=E0=B8=A2=E0=B8=B9=E0=B9=88=E0=B9=84=E0=B8=AB=E0=B8=A1=20?= =?UTF-8?q?=E0=B8=A5=E0=B8=87=E0=B9=80=E0=B8=A7=E0=B8=A5=E0=B8=B2=E0=B9=80?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=B2/=E0=B8=AD=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=20#894?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMA.EHR.Leave/Controllers/LeaveController.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BMA.EHR.Leave/Controllers/LeaveController.cs b/BMA.EHR.Leave/Controllers/LeaveController.cs index 388f8f97..28c11dc3 100644 --- a/BMA.EHR.Leave/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveController.cs @@ -538,14 +538,14 @@ namespace BMA.EHR.Leave.Service.Controllers string taskId = Guid.NewGuid().ToString(); var properties = channel.CreateBasicProperties(); properties.Persistent = true; - properties.MessageId = taskId; // แนบ Message ID เพื่อใช้ตรวจสอบ + properties.MessageId = userId.ToString("D");// ระบบลงเวลาต้องมีการเช็คสถานะใน rabbitMQ ด้วยว่ามีการรอรันอยู่ไหม ลงเวลาเข้า/ออกงาน #894 channel.BasicPublish(exchange: "", routingKey: queue, basicProperties: properties, body: body); - return Success(new { date = currentDate, taskId = taskId }); + return Success(new { date = currentDate, taskId = taskId, keycloakId = userId }); } finally { @@ -908,10 +908,12 @@ namespace BMA.EHR.Leave.Service.Controllers { return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound); } - + // fix issue : SIT ระบบบันทึกเวลาปฏิบัติงาน>>ลงเวลาเข้า-ออกงาน (กรณีลงเวลาออกอีกวัน) #921 var checkOutStatus = DateTime.Parse(currentDate.ToString("yyyy-MM-dd HH:mm")) < DateTime.Parse($"{currentDate.ToString("yyyy-MM-dd")} {duty.EndTimeAfternoon}") ? - "ABSENT" : + // "ABSENT" : + checkout.CheckIn.Date < currentDate.Date ? "NORMAL" : + "ABSENT" : DateTime.Parse(currentDate.ToString("yyyy-MM-dd HH:mm")) < DateTime.Parse($"{currentDate.ToString("yyyy-MM-dd")} {duty.EndTimeMorning}") ? "ABSENT" :