Linear Flow (PlacementService) #224
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m55s

This commit is contained in:
harid 2026-06-18 18:32:06 +07:00
parent 35179d8cfc
commit e926866918
5 changed files with 319 additions and 244 deletions

View file

@ -1041,24 +1041,32 @@ namespace BMA.EHR.Placement.Service.Controllers
remark = r.remark,
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
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();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
// 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
// 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);
}
/// <summary>
@ -1257,24 +1265,32 @@ namespace BMA.EHR.Placement.Service.Controllers
remark = r.remark,
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
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();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
// 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
// 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);
}
/// <summary>
@ -1457,24 +1473,32 @@ namespace BMA.EHR.Placement.Service.Controllers
remark = r.remark,
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-current";
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();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-current";
// 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
// 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);
}
/// <summary>
@ -1662,24 +1686,32 @@ namespace BMA.EHR.Placement.Service.Controllers
remark = r.remark,
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-current";
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();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-current";
// 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
// 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);
}
/// <summary>
@ -1890,24 +1922,32 @@ namespace BMA.EHR.Placement.Service.Controllers
remark = r.remark,
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
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();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
// 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
// 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);
}
/// <summary>
@ -2053,24 +2093,32 @@ namespace BMA.EHR.Placement.Service.Controllers
remark = r.remark,
}).ToList();
var baseAPIOrg = _configuration["API"];
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
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();
#region Old: Circular Flow
// var baseAPIOrg = _configuration["API"];
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
// 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
// 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);
}
}
}