From 122f02ac97bd6ce64beea10211bcbea86a29bc88 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Mon, 20 Jul 2026 12:31:03 +0700 Subject: [PATCH] =?UTF-8?q?check=20=E0=B8=81=E0=B8=B2=E0=B8=A3=20reprocess?= =?UTF-8?q?=20=E0=B8=96=E0=B9=89=E0=B8=B2=20task=20=E0=B8=99=E0=B8=B1?= =?UTF-8?q?=E0=B9=89=E0=B8=99=E0=B9=84=E0=B8=A1=E0=B9=88=E0=B9=84=E0=B8=94?= =?UTF-8?q?=E0=B9=89=20pedning=20=E0=B9=81=E0=B8=A5=E0=B9=89=E0=B8=A7?= =?UTF-8?q?=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=A1?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=99=E0=B8=B1=E0=B9=89=E0=B8=99?= =?UTF-8?q?=E0=B9=84=E0=B8=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMA.EHR.Leave/Controllers/LeaveController.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BMA.EHR.Leave/Controllers/LeaveController.cs b/BMA.EHR.Leave/Controllers/LeaveController.cs index 1480affd..cfef0c83 100644 --- a/BMA.EHR.Leave/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveController.cs @@ -30,6 +30,7 @@ using RabbitMQ.Client.Events; using Swashbuckle.AspNetCore.Annotations; using System.ComponentModel.DataAnnotations; using System.Diagnostics; +using System.Reflection.Metadata.Ecma335; using System.Security.Claims; using System.Text; using System.Threading.Tasks; @@ -779,6 +780,16 @@ namespace BMA.EHR.Leave.Service.Controllers { try { + // var get current status + var task = await _checkInJobStatusRepository.GetByTaskIdAsync(job.TaskId); + + // return if stask status != "PENDING" + if (task is not null) + { + if (task.Status != "PENDING") + continue; + } + // อ่านข้อมูลเดิมจาก AdditionalData if (string.IsNullOrEmpty(job.AdditionalData)) { @@ -1075,6 +1086,9 @@ namespace BMA.EHR.Leave.Service.Controllers try { + + + // อัปเดตสถานะเป็น PROCESSING if (taskId != Guid.Empty) {