From 081260a83b84dcaefb542863af5c37423d84340c Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 25 Sep 2025 18:18:01 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A2=E0=B8=81=E0=B9=80=E0=B8=A5=E0=B8=B4?= =?UTF-8?q?=E0=B8=81=E0=B8=A5=E0=B8=B2=E0=B8=AD=E0=B8=AD=E0=B8=81=20?= =?UTF-8?q?=E0=B8=A2=E0=B8=B4=E0=B8=87=E0=B8=81=E0=B8=A5=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B9=84=E0=B8=9B=E0=B8=97=E0=B8=B5=E0=B9=88=20command=20?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B8=A5=E0=B8=B5=E0=B9=88=E0=B8=A2=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B9=87=E0=B8=99=20cancel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/RetirementResignController.cs | 34 +++++++++---------- .../RetirementResignEmployeeController.cs | 34 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index d8f2adf0..13fe465a 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -3077,23 +3077,23 @@ namespace BMA.EHR.Retirement.Service.Controllers } else { - // var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave"; - // using (var client = new HttpClient()) - // { - // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - // client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - // var _res = await client.PostAsJsonAsync(apiUrlOrg, new - // { - // data = resultData, - // }); - // var _result = await _res.Content.ReadAsStringAsync(); - // if (_res.IsSuccessStatusCode) - // { - data.ForEach(profile => profile.Status = "DONE"); - data.ForEach(profile => profile.RetirementResign.Status = "CANCEL"); - await _context.SaveChangesAsync(); - // } - // } + var apiUrlOrg = $"{baseAPIOrg}/org/command/cancel-resign"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _res = await client.PostAsJsonAsync(apiUrlOrg, new + { + commandId = resultData.Select(x => x.commandId).ToList(), + }); + var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => profile.RetirementResign.Status = "CANCEL"); + await _context.SaveChangesAsync(); + } + } } return Success(); } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index 8600ed2e..68ed109b 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -2573,23 +2573,23 @@ namespace BMA.EHR.Retirement.Service.Controllers } else { - // var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-leave"; - // using (var client = new HttpClient()) - // { - // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - // client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - // var _res = await client.PostAsJsonAsync(apiUrlOrg, new - // { - // data = resultData, - // }); - // var _result = await _res.Content.ReadAsStringAsync(); - // if (_res.IsSuccessStatusCode) - // { - data.ForEach(profile => profile.Status = "DONE"); - data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL"); - await _context.SaveChangesAsync(); - // } - // } + var apiUrlOrg = $"{baseAPIOrg}/org/command/cancel-resign"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _res = await client.PostAsJsonAsync(apiUrlOrg, new + { + commandId = resultData.Select(x => x.commandId).ToList(), + }); + var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL"); + await _context.SaveChangesAsync(); + } + } } return Success(); }