diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs index 21be29f0..2bdbc8ea 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineInvestigateController.cs @@ -889,6 +889,10 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers RespondentType = data.RespondentType.Trim().ToUpper(), Organization = data.Organization, RootDnaId = data.RootDnaId, + Child1DnaId = data.Child1DnaId, + Child2DnaId = data.Child2DnaId, + Child3DnaId = data.Child3DnaId, + Child4DnaId = data.Child4DnaId, ConsideredAgency = data.ConsideredAgency, OrganizationId = data.OrganizationId, ConsideredAgencyId = data.ConsideredAgencyId, diff --git a/BMA.EHR.Discipline.Service/Program.cs b/BMA.EHR.Discipline.Service/Program.cs index 5a1f99c4..b1f821ed 100644 --- a/BMA.EHR.Discipline.Service/Program.cs +++ b/BMA.EHR.Discipline.Service/Program.cs @@ -121,7 +121,7 @@ var builder = WebApplication.CreateBuilder(args); DashboardJobListLimit = 50000, TransactionTimeout = TimeSpan.FromMinutes(1), InvisibilityTimeout = TimeSpan.FromHours(3), - TablesPrefix = "Hangfire" + TablesPrefix = "Hangfire_Discipline" }))); builder.Services.AddHangfireServer(); } 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) { diff --git a/BMA.EHR.Leave/Services/NotificationService.cs b/BMA.EHR.Leave/Services/NotificationService.cs index 3ada008e..7ea4837c 100644 --- a/BMA.EHR.Leave/Services/NotificationService.cs +++ b/BMA.EHR.Leave/Services/NotificationService.cs @@ -11,15 +11,22 @@ public class NotificationService private readonly ILogger _logger; private readonly IConfiguration _configuration; - private const string NotifyEndpoint = "https://hrmsbkk.case-collection.com/api/v1/org/through-socket/notify-from-token"; + private string _notifyEndpoint; public NotificationService(IHttpClientFactory httpClientFactory, ILogger logger, IConfiguration configuration) { _httpClientFactory = httpClientFactory; _logger = logger; _configuration = configuration; + _notifyEndpoint = $"{_configuration["API"]}/org/through-socket/notify-from-token"; } + /// + /// SendNotificationAsync + /// + /// + /// + /// public async Task SendNotificationAsync(string? token, bool error, string message) { if (string.IsNullOrEmpty(token)) @@ -42,7 +49,7 @@ public class NotificationService var json = JsonConvert.SerializeObject(payload); var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await client.PostAsync(NotifyEndpoint, content); + var response = await client.PostAsync(_notifyEndpoint, content); if (!response.IsSuccessStatusCode) { diff --git a/BMA.EHR.Placement.Service/Program.cs b/BMA.EHR.Placement.Service/Program.cs index 897d16ca..5db2aa84 100644 --- a/BMA.EHR.Placement.Service/Program.cs +++ b/BMA.EHR.Placement.Service/Program.cs @@ -121,7 +121,7 @@ var builder = WebApplication.CreateBuilder(args); PrepareSchemaIfNecessary = true, DashboardJobListLimit = 50000, TransactionTimeout = TimeSpan.FromMinutes(1), - TablesPrefix = "Hangfire" + TablesPrefix = "Hangfire_Placement" }))); builder.Services.AddHangfireServer(); } diff --git a/BMA.EHR.Retirement.Service/Program.cs b/BMA.EHR.Retirement.Service/Program.cs index a55f9674..6f7a6352 100644 --- a/BMA.EHR.Retirement.Service/Program.cs +++ b/BMA.EHR.Retirement.Service/Program.cs @@ -130,7 +130,7 @@ var builder = WebApplication.CreateBuilder(args); DashboardJobListLimit = 50000, TransactionTimeout = TimeSpan.FromMinutes(1), InvisibilityTimeout = TimeSpan.FromHours(3), - TablesPrefix = "Hangfire" + TablesPrefix = "Hangfire_Retirement" }))); builder.Services.AddHealthChecks(); }