เพิ่ม workflow
This commit is contained in:
parent
f8f63e312f
commit
a583dc7c42
2 changed files with 35 additions and 16 deletions
|
|
@ -334,21 +334,6 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
// save to database
|
// save to database
|
||||||
await _leaveRequestRepository.AddAsync(leaveRequest);
|
await _leaveRequestRepository.AddAsync(leaveRequest);
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/add-workflow";
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
|
||||||
{
|
|
||||||
refId = leaveRequest.Id,
|
|
||||||
sysName = "LEAVE_LIST",
|
|
||||||
posLevelName = profile.PosLevel,
|
|
||||||
posTypeName = profile.PosType,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success(new { id = leaveRequest.Id });
|
return Success(new { id = leaveRequest.Id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1462,6 +1447,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
{
|
{
|
||||||
await _leaveRequestRepository.SendToOfficerAsync(id);
|
await _leaveRequestRepository.SendToOfficerAsync(id);
|
||||||
|
|
||||||
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
|
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(userId, AccessToken);
|
||||||
|
if (profile == null)
|
||||||
|
{
|
||||||
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
}
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/add-workflow";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
refId = id,
|
||||||
|
sysName = "LEAVE_LIST",
|
||||||
|
posLevelName = profile.PosLevel?.PosLevelName ?? "",
|
||||||
|
posTypeName = profile.PosType?.PosTypeName ?? "",
|
||||||
|
});
|
||||||
|
Console.WriteLine(_res);
|
||||||
|
}
|
||||||
|
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -508,7 +508,19 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
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 = retirementResign.Id,
|
||||||
|
sysName = "RETIREMENT_RESIFNATION",
|
||||||
|
posLevelName = retirementResign.PositionLevelOld,
|
||||||
|
posTypeName = retirementResign.PositionTypeOld,
|
||||||
|
});
|
||||||
|
Console.WriteLine(_res);
|
||||||
|
}
|
||||||
return Success(retirementResign);
|
return Success(retirementResign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue