ออกคำสั่งยกเลิก
This commit is contained in:
parent
f1540de911
commit
77eaca72b3
2 changed files with 83 additions and 34 deletions
|
|
@ -3050,27 +3050,51 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
var baseAPIOrg = _configuration["API"];
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave";
|
var reportDone = false;
|
||||||
using (var client = new HttpClient())
|
if (data.Where(profile => profile.Status == "DONE").Any())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
reportDone = true;
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
}
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
if (reportDone == true)
|
||||||
|
{
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave";
|
||||||
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
data = resultData,
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
});
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
if (_res.IsSuccessStatusCode)
|
{
|
||||||
{
|
data = resultData,
|
||||||
data.ForEach(profile => profile.Status = "DONE");
|
});
|
||||||
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
// var _data = await _context.RetirementResigns
|
if (_res.IsSuccessStatusCode)
|
||||||
// .Where(x => data.Select(x => x.RetirementResign.Id).Contains(x.Id))
|
{
|
||||||
// .ToListAsync();
|
data.ForEach(profile => profile.Status = "DONE");
|
||||||
// _data.ForEach(profile => profile.Status = "DONEREJECT");
|
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-leave";
|
||||||
|
// 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");
|
||||||
|
data.ForEach(profile => profile.RetirementResign.Status = "CANCEL");
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2545,27 +2545,52 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
var baseAPIOrg = _configuration["API"];
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-leave";
|
var reportDone = false;
|
||||||
using (var client = new HttpClient())
|
if (data.Where(profile => profile.Status == "DONE").Any())
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
reportDone = true;
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
}
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
|
||||||
|
if (reportDone == true)
|
||||||
|
{
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-leave";
|
||||||
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
data = resultData,
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
});
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
if (_res.IsSuccessStatusCode)
|
{
|
||||||
{
|
data = resultData,
|
||||||
data.ForEach(profile => profile.Status = "DONE");
|
});
|
||||||
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
// var _data = await _context.RetirementResignEmployees
|
if (_res.IsSuccessStatusCode)
|
||||||
// .Where(x => data.Select(x => x.RetirementResignEmployee.Id).Contains(x.Id))
|
{
|
||||||
// .ToListAsync();
|
data.ForEach(profile => profile.Status = "DONE");
|
||||||
// _data.ForEach(profile => profile.Status = "DONEREJECT");
|
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-leave";
|
||||||
|
// 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");
|
||||||
|
data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL");
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue