แก้ออกคำสั่ง
This commit is contained in:
parent
ee2aa136b9
commit
6c09c68c5c
33 changed files with 18908 additions and 626 deletions
|
|
@ -90,7 +90,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
var org = JsonConvert.DeserializeObject<Requests.OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
|
|
@ -286,7 +286,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
var org = JsonConvert.DeserializeObject<Requests.OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
return Error("ไม่พบหน่วยงานของผู้ใช้งานคนนี้", 404);
|
||||
|
|
@ -320,6 +320,23 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
await _context.RetirementDeceaseds.AddAsync(retirementDeceased);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
var _baseAPI = _configuration["API"];
|
||||
var _apiUrl = $"{_baseAPI}/org/profile/leave/{req.ProfileId}";
|
||||
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
|
||||
var _res = await client.PostAsJsonAsync(_apiUrl, new
|
||||
{
|
||||
isLeave = true,
|
||||
leaveReason = "ถึงแก่กรรม",
|
||||
leaveDate = req.Date,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var _doc = new Domain.Models.Documents.Document();
|
||||
if (Request.Form.Files != null && Request.Form.Files.Count != 0)
|
||||
{
|
||||
|
|
@ -384,15 +401,15 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
// {
|
||||
retirementDeceased.RetirementDeceasedNotis.Add(new RetirementDeceasedNoti
|
||||
{
|
||||
CitizenId = retirementDeceased.citizenId,
|
||||
Prefix = retirementDeceased.prefix,
|
||||
FirstName = retirementDeceased.firstName,
|
||||
LastName = retirementDeceased.lastName,
|
||||
CitizenId = retirementDeceased.citizenId == null ? "" : retirementDeceased.citizenId,
|
||||
Prefix = retirementDeceased.prefix == null ? "" : retirementDeceased.prefix,
|
||||
FirstName = retirementDeceased.firstName == null ? "" : retirementDeceased.firstName,
|
||||
LastName = retirementDeceased.lastName == null ? "" : retirementDeceased.lastName,
|
||||
IsSendMail = true,
|
||||
IsSendInbox = true,
|
||||
IsSendNotification = true,
|
||||
// OrganizationName = retirementDeceased.OrganizationName,
|
||||
PositionName = retirementDeceased.position,
|
||||
PositionName = retirementDeceased.position == null ? "" : retirementDeceased.position,
|
||||
profileId = req.ProfileId,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
|
|
@ -557,7 +574,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
var _res = await client.SendAsync(_req);
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
|
||||
var org = JsonConvert.DeserializeObject<OrgRequest>(_result);
|
||||
var org = JsonConvert.DeserializeObject<Requests.OrgRequest>(_result);
|
||||
|
||||
if (org == null || org.result == null)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue