Merge pull request #1744 from Frappet/task/1728-ออกคำสั่งลาออก

1728-ยกเลิกคำสั่ง
This commit is contained in:
Kittapath 2025-08-09 22:00:58 +07:00 committed by GitHub
commit b89f394f1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 17 deletions

View file

@ -1741,7 +1741,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel17/{updated.Id}"); var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel17/{updated.Id}");
} }
updated.Status = "CANCELING"; updated.Status = "CANCEL";
} }
else else
{ {
@ -3584,7 +3584,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
} }
var updated = await _context.RetirementResigns.AsQueryable() var updated = await _context.RetirementResigns.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == id); .FirstOrDefaultAsync(x => x.Id == id);
if (updated == null) if (updated == null)
return Error(GlobalMessages.RetirementResignNotFound, 404); return Error(GlobalMessages.RetirementResignNotFound, 404);
var ReasonResign = req.ReasonResign; var ReasonResign = req.ReasonResign;
@ -3605,8 +3605,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
updated.ReasonResign = !string.IsNullOrEmpty(ReasonResign) ? ReasonResign : updated.ReasonResign; updated.ReasonResign = !string.IsNullOrEmpty(ReasonResign) ? ReasonResign : updated.ReasonResign;
updated.Reason = req.ReasonResign; updated.Reason = req.ReasonResign;
updated.Remark = !string.IsNullOrEmpty(req.Remark) ? req.Remark : null; updated.Remark = !string.IsNullOrEmpty(req.Remark) ? req.Remark : null;
updated.SendDate = req.SendDate.HasValue ? req.SendDate : updated.SendDate; updated.SendDate = req.SendDate.HasValue ? req.SendDate : updated.SendDate;
updated.ActiveDate = req.ActiveDate.HasValue ? req.ActiveDate : updated.ActiveDate; updated.ActiveDate = req.ActiveDate.HasValue ? req.ActiveDate : updated.ActiveDate;
updated.LastUpdateFullName = FullName ?? "System Administrator"; updated.LastUpdateFullName = FullName ?? "System Administrator";
updated.LastUpdateUserId = UserId ?? ""; updated.LastUpdateUserId = UserId ?? "";
updated.LastUpdatedAt = DateTime.Now; updated.LastUpdatedAt = DateTime.Now;

View file

@ -1648,18 +1648,6 @@ namespace BMA.EHR.Retirement.Service.Controllers
} }
await _context.AddRangeAsync(addList); await _context.AddRangeAsync(addList);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
// 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($"{_configuration["API"]}/org/workflow/add-workflow", new
// {
// refId = retirementResignEmployeeCancel.Id,
// sysName = "RETIREMENT_CANCEL_EMP",
// posLevelName = retirementResignEmployeeCancel.PositionLevelOld,
// posTypeName = retirementResignEmployeeCancel.PositionTypeOld,
// });
// }
updated.IsCancel = true; updated.IsCancel = true;
updated.Status = "CANCELING"; updated.Status = "CANCELING";
} }
@ -1671,7 +1659,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel23/{updated.Id}"); var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel23/{updated.Id}");
} }
updated.Status = "CANCELING"; updated.Status = "CANCEL";
} }
else else
{ {