Refactor LeaveProcessJobStatusRepository to filter employee records by status and ensure proper task processing
This commit is contained in:
parent
47c0cfc62a
commit
29056ac85b
1 changed files with 3 additions and 3 deletions
|
|
@ -445,7 +445,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
var apiKey = _configuration["API_KEY"];
|
var apiKey = _configuration["API_KEY"];
|
||||||
var body = new
|
var body = new
|
||||||
{
|
{
|
||||||
records = employees
|
records = employees.Where(x => x.status == "ABSENT" || x.status == "LATE").ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
|
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
|
||||||
|
|
@ -729,7 +729,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
var apiKey = _configuration["API_KEY"];
|
var apiKey = _configuration["API_KEY"];
|
||||||
var body = new
|
var body = new
|
||||||
{
|
{
|
||||||
records = employees
|
records = employees.Where(x => x.status == "ABSENT" || x.status == "LATE").ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
|
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
|
||||||
|
|
@ -754,7 +754,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
||||||
|
|
||||||
// ทำงานที่ต้องการที่นี่ (เช่น เรียก API, ประมวลผลข้อมูล ฯลฯ)
|
// ทำงานที่ต้องการที่นี่ (เช่น เรียก API, ประมวลผลข้อมูล ฯลฯ)
|
||||||
await ProcessTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
|
await ProcessTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
|
||||||
//await ProcessEmpTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
|
await ProcessEmpTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
|
||||||
|
|
||||||
// อัปเดตสถานะเป็น Completed
|
// อัปเดตสถานะเป็น Completed
|
||||||
await UpdateToCompletedAsync(job.Id);
|
await UpdateToCompletedAsync(job.Id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue