ออกคำสั่ง
This commit is contained in:
parent
604b234c4b
commit
1290da7211
14 changed files with 1979 additions and 2004 deletions
|
|
@ -824,7 +824,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-05
|
||||
/// ออกคำสั่ง C-PM-05 คำสั่งแต่งตั้ง
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -834,68 +834,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("appoint/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteAppoint([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var placementProfile = await _context.PlacementAppointments
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
if (placementProfile == null)
|
||||
continue;
|
||||
|
||||
if (placementProfile == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = placementProfile.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = placementProfile.posMasterNo == null ? "" :
|
||||
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||
position = placementProfile.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = placementProfile.posTypeName,
|
||||
positionLevel = placementProfile.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = placementProfile.posmasterId,
|
||||
positionId = placementProfile.positionId,
|
||||
profileId = placementProfile.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
placementProfile.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -981,7 +966,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-06
|
||||
/// ออกคำสั่ง C-PM-06 เลื่อนข้าราชการ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -991,68 +976,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("slip/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteSlip([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var placementProfile = await _context.PlacementAppointments
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
if (placementProfile == null)
|
||||
continue;
|
||||
|
||||
if (placementProfile == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = placementProfile.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = placementProfile.posMasterNo == null ? "" :
|
||||
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||
position = placementProfile.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = placementProfile.posTypeName,
|
||||
positionLevel = placementProfile.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = placementProfile.posmasterId,
|
||||
positionId = placementProfile.positionId,
|
||||
profileId = placementProfile.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
placementProfile.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1138,7 +1108,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-07
|
||||
/// ออกคำสั่ง C-PM-07 ย้ายข้าราชการ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -1148,65 +1118,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("move/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteMove([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var placementProfile = await _context.PlacementAppointments
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
if (placementProfile == null)
|
||||
continue;
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = placementProfile.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = placementProfile.posMasterNo == null ? "" :
|
||||
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||
position = placementProfile.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = placementProfile.posTypeName,
|
||||
positionLevel = placementProfile.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = placementProfile.posmasterId,
|
||||
positionId = placementProfile.positionId,
|
||||
profileId = placementProfile.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
placementProfile.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1289,7 +1247,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-22
|
||||
/// ออกคำสั่ง C-PM-22 คำสั่งปรับระดับชั้นงาน
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -1299,63 +1257,50 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("employee-appoint/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteEmployeeAppoint([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.position,
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var data = await _context.PlacementAppointments
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
if (data == null)
|
||||
continue;
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile-employee/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileEmployeeId = data.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = data.posMasterNo == null ? "" :
|
||||
data.node == 4 ? $"{data.child4ShortName}{data.posMasterNo}" :
|
||||
data.node == 3 ? $"{data.child3ShortName}{data.posMasterNo}" :
|
||||
data.node == 2 ? $"{data.child2ShortName}{data.posMasterNo}" :
|
||||
data.node == 1 ? $"{data.child1ShortName}{data.posMasterNo}" :
|
||||
data.node == 0 ? $"{data.rootShortName}{data.posMasterNo}" : "",
|
||||
position = data.position,
|
||||
positionType = data.posTypeName,
|
||||
positionLevel = data.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/employee/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = data.posmasterId,
|
||||
positionId = data.positionId,
|
||||
profileId = data.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
data.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -1438,7 +1383,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-24
|
||||
/// ออกคำสั่ง C-PM-24 คำสั่งย้ายลูกจ้างประจำ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -1448,63 +1393,50 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("employee-move/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteEmployeeMove([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.position,
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-employee-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var data = await _context.PlacementAppointments
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
|
||||
if (data == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile-employee/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileEmployeeId = data.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = data.posMasterNo == null ? "" :
|
||||
data.node == 4 ? $"{data.child4ShortName}{data.posMasterNo}" :
|
||||
data.node == 3 ? $"{data.child3ShortName}{data.posMasterNo}" :
|
||||
data.node == 2 ? $"{data.child2ShortName}{data.posMasterNo}" :
|
||||
data.node == 1 ? $"{data.child1ShortName}{data.posMasterNo}" :
|
||||
data.node == 0 ? $"{data.rootShortName}{data.posMasterNo}" : "",
|
||||
position = data.position,
|
||||
positionType = data.posTypeName,
|
||||
positionLevel = data.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/employee/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = data.posmasterId,
|
||||
positionId = data.positionId,
|
||||
profileId = data.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
data.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1545,7 +1545,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-01
|
||||
/// ออกคำสั่ง C-PM-01 บรรจุและแต่งตั้งผู้สอบแข่งขันได้
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -1818,7 +1818,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-02
|
||||
/// ออกคำสั่ง C-PM-02 บรรจุและแต่งตั้งผู้ได้รับคัดเลือก
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -2101,7 +2101,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-03
|
||||
/// ออกคำสั่ง C-PM-03 แต่งตั้งข้าราชการ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -2111,66 +2111,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("appoint/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteAppoint([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.positionName,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var placementProfile = await _context.PlacementProfiles
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
if (placementProfile == null)
|
||||
continue;
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = placementProfile.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = placementProfile.posMasterNo == null ? "" :
|
||||
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||
position = placementProfile.positionName,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = placementProfile.posTypeName,
|
||||
positionLevel = placementProfile.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = placementProfile.posmasterId,
|
||||
positionId = placementProfile.positionId,
|
||||
profileId = placementProfile.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.PlacementStatus = "CONTAIN");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
placementProfile.PlacementStatus = "CONTAIN";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2268,7 +2255,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-04
|
||||
/// ออกคำสั่ง C-PM-04 ย้ายข้าราชการ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -2278,66 +2265,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("move/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteMove([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.positionName,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var placementProfile = await _context.PlacementProfiles
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
if (placementProfile == null)
|
||||
continue;
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = placementProfile.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = placementProfile.posMasterNo == null ? "" :
|
||||
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||
position = placementProfile.positionName,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = placementProfile.posTypeName,
|
||||
positionLevel = placementProfile.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = placementProfile.posmasterId,
|
||||
positionId = placementProfile.positionId,
|
||||
profileId = placementProfile.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.PlacementStatus = "CONTAIN");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
placementProfile.PlacementStatus = "CONTAIN";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -2435,7 +2409,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-39
|
||||
/// ออกคำสั่ง C-PM-39 เลื่อนข้าราชการ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -2445,66 +2419,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("slip/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteSlip([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementProfiles
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.positionName,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var placementProfile = await _context.PlacementProfiles
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
if (placementProfile == null)
|
||||
continue;
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = placementProfile.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = placementProfile.posMasterNo == null ? "" :
|
||||
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||
position = placementProfile.positionName,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = placementProfile.posTypeName,
|
||||
positionLevel = placementProfile.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = placementProfile.posmasterId,
|
||||
positionId = placementProfile.positionId,
|
||||
profileId = placementProfile.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.PlacementStatus = "CONTAIN");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
placementProfile.PlacementStatus = "CONTAIN";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-15
|
||||
/// ออกคำสั่ง C-PM-15 คำสั่งให้ช่วยราชการ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -644,46 +644,46 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("command/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementOfficers
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.PositionNumberOld,
|
||||
position = p.PositionOld,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.PositionTypeOld,
|
||||
positionLevel = p.PositionLevelOld,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var data = await _context.PlacementOfficers
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
|
||||
if (data == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = data.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = data.PositionNumberOld,
|
||||
position = data.PositionOld,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = data.PositionTypeOld,
|
||||
positionLevel = data.PositionLevelOld,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
data.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -960,7 +960,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-14
|
||||
/// ออกคำสั่ง C-PM-14 คำสั่งรับโอนข้าราชการกรุงเทพมหานครสามัญ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -970,68 +970,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("command/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementReceives
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||
position = p.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.posTypeName,
|
||||
positionLevel = p.posLevelName,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
posmasterId = p.posmasterId,
|
||||
positionId = p.positionId,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
// query placement Profile
|
||||
var placementProfile = await _context.PlacementReceives
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
|
||||
if (placementProfile == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = placementProfile.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = placementProfile.posMasterNo == null ? "" :
|
||||
placementProfile.node == 4 ? $"{placementProfile.child4ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 3 ? $"{placementProfile.child3ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 2 ? $"{placementProfile.child2ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 1 ? $"{placementProfile.child1ShortName}{placementProfile.posMasterNo}" :
|
||||
placementProfile.node == 0 ? $"{placementProfile.rootShortName}{placementProfile.posMasterNo}" : "",
|
||||
position = placementProfile.position,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = placementProfile.posTypeName,
|
||||
positionLevel = placementProfile.posLevelName,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/pos/report/current";
|
||||
using (var client = new HttpClient())
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
{
|
||||
posmasterId = placementProfile.posmasterId,
|
||||
positionId = placementProfile.positionId,
|
||||
profileId = placementProfile.profileId,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
placementProfile.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-16
|
||||
/// ออกคำสั่ง C-PM-16 คำสั่งส่งตัวกลับ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -506,46 +506,46 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("command/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementRepatriations
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.PositionNumberOld,
|
||||
position = p.PositionOld,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.PositionTypeOld,
|
||||
positionLevel = p.PositionLevelOld,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var data = await _context.PlacementRepatriations
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
|
||||
if (data == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = data.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = data.PositionNumberOld,
|
||||
position = data.PositionOld,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = data.PositionTypeOld,
|
||||
positionLevel = data.PositionLevelOld,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
data.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -827,7 +827,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-13
|
||||
/// ออกคำสั่ง C-PM-13 คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -837,46 +837,46 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[HttpPost("command/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
var data = await _context.PlacementTransfers
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
var resultData = (from p in data
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
select new
|
||||
{
|
||||
profileId = p.profileId,
|
||||
date = r.commandAffectDate,
|
||||
amount = r.amount,
|
||||
positionSalaryAmount = r.positionSalaryAmount,
|
||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||
posNo = p.PositionNumberOld,
|
||||
position = p.PositionOld,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = p.PositionTypeOld,
|
||||
positionLevel = p.PositionLevelOld,
|
||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||
templateDoc = r.templateDoc,
|
||||
}).ToList();
|
||||
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var data = await _context.PlacementTransfers
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
|
||||
if (data == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrlSalary = $"{baseAPI}/org/profile/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
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlSalary, new
|
||||
{
|
||||
profileId = data.profileId,
|
||||
date = recv.commandAffectDate,
|
||||
amount = recv.amount,
|
||||
positionSalaryAmount = recv.positionSalaryAmount,
|
||||
mouthSalaryAmount = recv.mouthSalaryAmount,
|
||||
posNo = data.PositionNumberOld,
|
||||
position = data.PositionOld,
|
||||
positionLine = "",
|
||||
positionPathSide = "",
|
||||
positionExecutive = "",
|
||||
positionType = data.PositionTypeOld,
|
||||
positionLevel = data.PositionLevelOld,
|
||||
refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
|
||||
templateDoc = recv.templateDoc,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
data = resultData,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
if (_res.IsSuccessStatusCode)
|
||||
{
|
||||
data.ForEach(profile => profile.Status = "DONE");
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
data.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue