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" :