Linear Flow (PlacementService) #224
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s
This commit is contained in:
parent
35179d8cfc
commit
e926866918
5 changed files with 319 additions and 244 deletions
|
|
@ -623,9 +623,6 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
var data = await _context.PlacementRepatriations
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
// Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
string? _null = null;
|
||||
var resultData = (from p in data
|
||||
|
|
@ -668,25 +665,32 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
commandName = r.commandName,
|
||||
remark = r.remark,
|
||||
}).ToList();
|
||||
#region Old: Circular Flow
|
||||
// var baseAPIOrg = _configuration["API"];
|
||||
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary";
|
||||
// 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");
|
||||
// // // await _context.SaveChangesAsync();
|
||||
// // // }
|
||||
// }
|
||||
#endregion
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary";
|
||||
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");
|
||||
// // await _context.SaveChangesAsync();
|
||||
// // }
|
||||
}
|
||||
return Success();
|
||||
// New: Linear Flow - Task #224ปรับให้เป็น process ที่ควรบันทึกตามลำดับ
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
// Return resultData for Node to process directly (Linear Flow)
|
||||
return Success(resultData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue