From b1df33dc209fbc9fa0796a6d6c1604da4b46fd2b Mon Sep 17 00:00:00 2001 From: harid Date: Wed, 11 Mar 2026 14:01:34 +0700 Subject: [PATCH] fix bug #2183 --- .../Controllers/RetirementResignController.cs | 56 +++++++++---------- .../RetirementResignEmployeeController.cs | 56 +++++++++---------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index a70e357d..7b8d27b1 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -3104,13 +3104,13 @@ namespace BMA.EHR.Retirement.Service.Controllers }).ToList(); var baseAPIOrg = _configuration["API"]; - var reportDone = false; - if (data.Where(profile => profile.Status == "DONE").Any()) - { - reportDone = true; - } - if (reportDone == true) - { + //var reportDone = false; + //if (data.Where(profile => profile.Status == "DONE").Any()) + //{ + // reportDone = true; + //} + //if (reportDone == true) + //{ var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave"; using (var client = new HttpClient()) { @@ -3128,27 +3128,27 @@ namespace BMA.EHR.Retirement.Service.Controllers await _context.SaveChangesAsync(); } } - } - else - { - 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 - { - resignId = resultData.Select(x => x.resignId).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(); - } - } - } + //} + //else + //{ + // 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 + // { + // resignId = resultData.Select(x => x.resignId).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 e42e2e6a..9b176503 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -2598,14 +2598,14 @@ namespace BMA.EHR.Retirement.Service.Controllers }).ToList(); var baseAPIOrg = _configuration["API"]; - var reportDone = false; - if (data.Where(profile => profile.Status == "DONE").Any()) - { - reportDone = true; - } + //var reportDone = false; + //if (data.Where(profile => profile.Status == "DONE").Any()) + //{ + // reportDone = true; + //} - if (reportDone == true) - { + //if (reportDone == true) + //{ var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-leave"; using (var client = new HttpClient()) { @@ -2623,27 +2623,27 @@ namespace BMA.EHR.Retirement.Service.Controllers await _context.SaveChangesAsync(); } } - } - else - { - 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 - { - resignId = resultData.Select(x => x.resignId).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(); - } - } - } + //} + //else + //{ + // 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 + // { + // resignId = resultData.Select(x => x.resignId).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(); }