แก้ ออก คำ สั่ง
This commit is contained in:
parent
e862829246
commit
604b234c4b
15 changed files with 897 additions and 845 deletions
|
|
@ -6797,11 +6797,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var placementProfile in placementProfiles)
|
||||
{
|
||||
// update placementstatus
|
||||
placementProfile.Status = "REPORT";
|
||||
}
|
||||
placementProfiles.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -6873,11 +6869,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var placementProfile in placementProfiles)
|
||||
{
|
||||
// update placementstatus
|
||||
placementProfile.Status = "REPORT";
|
||||
}
|
||||
placementProfiles.ForEach(profile => profile.Status = "REPORT");
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
|
@ -7120,21 +7112,13 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand25Attachment([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand25Attachment([FromBody] ReportAttachmentRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var raw_data = await _context.Set<CommandReceiver>()
|
||||
.Include(c => c.Command)
|
||||
.Where(c => req_.refIds.Contains(c.Id.ToString()))
|
||||
.ToListAsync();
|
||||
if (raw_data == null)
|
||||
foreach (var d in req.refIds)
|
||||
{
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
}
|
||||
foreach (var d in raw_data)
|
||||
{
|
||||
var apiUrl = $"{_configuration["API"]}/discipline/result/report/find/{d.RefDisciplineId}/{d.RefPlacementProfileId}";
|
||||
var apiUrl = $"{_configuration["API"]}/discipline/result/report/find/{d.refId}";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
|
|
@ -7148,7 +7132,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
continue;
|
||||
var receiver = new CommandType23Response
|
||||
{
|
||||
fullName = $"{org.result.prefix}{org.result.firstName} {org.result.lastName}",
|
||||
fullName = $"{d.Prefix}{d.FirstName} {d.LastName}",
|
||||
positionname = org.result.position,
|
||||
positionno = org.result.posNo == null ? null : org.result.posNo.ToThaiNumber(),
|
||||
organizationname = org.result.organization,
|
||||
|
|
@ -7164,7 +7148,7 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-25
|
||||
|
|
@ -8115,48 +8099,47 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command33/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand33([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand33([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
var baseAPI = _configuration["API"];
|
||||
// var resultData = new List<CommandReceiver>();
|
||||
// var baseAPI = _configuration["API"];
|
||||
|
||||
foreach (var id in req_.refIds)
|
||||
{
|
||||
var apiUrl = $"{baseAPI}/salary/report/command/33/{id}";
|
||||
// foreach (var id in req.refIds)
|
||||
// {
|
||||
// var apiUrl = $"{baseAPI}/salary/report/command/33/{id}";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
// var response = new PassSalaryResponse();
|
||||
// using (var client = new HttpClient())
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
// var res = await client.SendAsync(_req);
|
||||
// // var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
// // response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName,
|
||||
LastName = d.lastName,
|
||||
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
RefDisciplineId = d.id,
|
||||
};
|
||||
seq++;
|
||||
// // var seq = 1;
|
||||
// // foreach (var d in response!.result)
|
||||
// // {
|
||||
// // var receiver = new CommandReceiver
|
||||
// // {
|
||||
// // Sequence = seq,
|
||||
// // CitizenId = d.citizenId,
|
||||
// // Prefix = d.prefix == null ? "" : d.prefix,
|
||||
// // FirstName = d.firstName,
|
||||
// // LastName = d.lastName,
|
||||
// // RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
// // RefDisciplineId = d.id,
|
||||
// // };
|
||||
// // seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// // resultData.Add(receiver);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -8204,47 +8187,47 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command34/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand34([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand34([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
var baseAPI = _configuration["API"];
|
||||
// var resultData = new List<CommandReceiver>();
|
||||
// var baseAPI = _configuration["API"];
|
||||
|
||||
foreach (var id in req_.refIds)
|
||||
{
|
||||
var apiUrl = $"{baseAPI}/salary/report/command/34/{id}";
|
||||
// foreach (var id in req.refIds)
|
||||
// {
|
||||
// var apiUrl = $"{baseAPI}/salary/report/command/34/{id}";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
// var response = new PassSalaryResponse();
|
||||
// using (var client = new HttpClient())
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
// var res = await client.SendAsync(_req);
|
||||
// // var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
// // response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName,
|
||||
LastName = d.lastName,
|
||||
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
RefDisciplineId = d.id,
|
||||
};
|
||||
seq++;
|
||||
// // var seq = 1;
|
||||
// // foreach (var d in response!.result)
|
||||
// // {
|
||||
// // var receiver = new CommandReceiver
|
||||
// // {
|
||||
// // Sequence = seq,
|
||||
// // CitizenId = d.citizenId,
|
||||
// // Prefix = d.prefix == null ? "" : d.prefix,
|
||||
// // FirstName = d.firstName,
|
||||
// // LastName = d.lastName,
|
||||
// // RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
// // RefDisciplineId = d.id,
|
||||
// // };
|
||||
// // seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
// // resultData.Add(receiver);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -8292,47 +8275,47 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command35/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand35([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand35([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
var baseAPI = _configuration["API"];
|
||||
// var resultData = new List<CommandReceiver>();
|
||||
// var baseAPI = _configuration["API"];
|
||||
|
||||
foreach (var id in req_.refIds)
|
||||
{
|
||||
var apiUrl = $"{baseAPI}/salary/report/command/35/{id}";
|
||||
// foreach (var id in req.refIds)
|
||||
// {
|
||||
// var apiUrl = $"{baseAPI}/salary/report/command/35/{id}";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
// var response = new PassSalaryResponse();
|
||||
// using (var client = new HttpClient())
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
// var res = await client.SendAsync(_req);
|
||||
// // var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
// // response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName,
|
||||
LastName = d.lastName,
|
||||
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
RefDisciplineId = d.id,
|
||||
};
|
||||
seq++;
|
||||
// // var seq = 1;
|
||||
// // foreach (var d in response!.result)
|
||||
// // {
|
||||
// // var receiver = new CommandReceiver
|
||||
// // {
|
||||
// // Sequence = seq,
|
||||
// // CitizenId = d.citizenId,
|
||||
// // Prefix = d.prefix == null ? "" : d.prefix,
|
||||
// // FirstName = d.firstName,
|
||||
// // LastName = d.lastName,
|
||||
// // RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
// // RefDisciplineId = d.id,
|
||||
// // };
|
||||
// // seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
// // resultData.Add(receiver);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -8380,47 +8363,47 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command36/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand36([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand36([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
var baseAPI = _configuration["API"];
|
||||
// var resultData = new List<CommandReceiver>();
|
||||
// var baseAPI = _configuration["API"];
|
||||
|
||||
foreach (var id in req_.refIds)
|
||||
{
|
||||
var apiUrl = $"{baseAPI}/salary/report/command/36/{id}";
|
||||
// foreach (var id in req.refIds)
|
||||
// {
|
||||
// var apiUrl = $"{baseAPI}/salary/report/command/36/{id}";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
// var response = new PassSalaryResponse();
|
||||
// using (var client = new HttpClient())
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
// var res = await client.SendAsync(_req);
|
||||
// // var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
// // response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName,
|
||||
LastName = d.lastName,
|
||||
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
RefDisciplineId = d.id,
|
||||
};
|
||||
seq++;
|
||||
// // var seq = 1;
|
||||
// // foreach (var d in response!.result)
|
||||
// // {
|
||||
// // var receiver = new CommandReceiver
|
||||
// // {
|
||||
// // Sequence = seq,
|
||||
// // CitizenId = d.citizenId,
|
||||
// // Prefix = d.prefix == null ? "" : d.prefix,
|
||||
// // FirstName = d.firstName,
|
||||
// // LastName = d.lastName,
|
||||
// // RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
// // RefDisciplineId = d.id,
|
||||
// // };
|
||||
// // seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
// // resultData.Add(receiver);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -8468,47 +8451,47 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command37/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand37([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand37([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
var baseAPI = _configuration["API"];
|
||||
// var resultData = new List<CommandReceiver>();
|
||||
// var baseAPI = _configuration["API"];
|
||||
|
||||
foreach (var id in req_.refIds)
|
||||
{
|
||||
var apiUrl = $"{baseAPI}/salary/report/command/37/{id}";
|
||||
// foreach (var id in req.refIds)
|
||||
// {
|
||||
// var apiUrl = $"{baseAPI}/salary/report/command/37/{id}";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
// var response = new PassSalaryResponse();
|
||||
// using (var client = new HttpClient())
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
// var res = await client.SendAsync(_req);
|
||||
// // var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
// // response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName,
|
||||
LastName = d.lastName,
|
||||
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
RefDisciplineId = d.id,
|
||||
};
|
||||
seq++;
|
||||
// // var seq = 1;
|
||||
// // foreach (var d in response!.result)
|
||||
// // {
|
||||
// // var receiver = new CommandReceiver
|
||||
// // {
|
||||
// // Sequence = seq,
|
||||
// // CitizenId = d.citizenId,
|
||||
// // Prefix = d.prefix == null ? "" : d.prefix,
|
||||
// // FirstName = d.firstName,
|
||||
// // LastName = d.lastName,
|
||||
// // RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
// // RefDisciplineId = d.id,
|
||||
// // };
|
||||
// // seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
// // resultData.Add(receiver);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -8555,47 +8538,47 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command38/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand38([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand38([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
var baseAPI = _configuration["API"];
|
||||
// var resultData = new List<CommandReceiver>();
|
||||
// var baseAPI = _configuration["API"];
|
||||
|
||||
foreach (var id in req_.refIds)
|
||||
{
|
||||
var apiUrl = $"{baseAPI}/salary/report/command/38/{id}";
|
||||
// foreach (var id in req.refIds)
|
||||
// {
|
||||
// var apiUrl = $"{baseAPI}/salary/report/command/38/{id}";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
// var response = new PassSalaryResponse();
|
||||
// using (var client = new HttpClient())
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
// var res = await client.SendAsync(_req);
|
||||
// // var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
// // response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName,
|
||||
LastName = d.lastName,
|
||||
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
RefDisciplineId = d.id,
|
||||
};
|
||||
seq++;
|
||||
// // var seq = 1;
|
||||
// // foreach (var d in response!.result)
|
||||
// // {
|
||||
// // var receiver = new CommandReceiver
|
||||
// // {
|
||||
// // Sequence = seq,
|
||||
// // CitizenId = d.citizenId,
|
||||
// // Prefix = d.prefix == null ? "" : d.prefix,
|
||||
// // FirstName = d.firstName,
|
||||
// // LastName = d.lastName,
|
||||
// // RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
// // RefDisciplineId = d.id,
|
||||
// // };
|
||||
// // seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
// // resultData.Add(receiver);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -8627,43 +8610,43 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command40/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand40([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand40([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var resultData = new List<CommandReceiver>();
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrl = $"{baseAPI}/org/pos/act/profile";
|
||||
// var resultData = new List<CommandReceiver>();
|
||||
// var baseAPI = _configuration["API"];
|
||||
// var apiUrl = $"{baseAPI}/org/pos/act/profile";
|
||||
|
||||
var response = new PassSalaryResponse();
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
var res = await client.SendAsync(req);
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
// var response = new PassSalaryResponse();
|
||||
// using (var client = new HttpClient())
|
||||
// {
|
||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
// var res = await client.SendAsync(_req);
|
||||
// // var result = await res.Content.ReadAsStringAsync();
|
||||
|
||||
response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
// // response = JsonConvert.DeserializeObject<PassSalaryResponse>(result);
|
||||
|
||||
var seq = 1;
|
||||
foreach (var d in response!.result)
|
||||
{
|
||||
var receiver = new CommandReceiver
|
||||
{
|
||||
Sequence = seq,
|
||||
CitizenId = d.citizenId,
|
||||
Prefix = d.prefix == null ? "" : d.prefix,
|
||||
FirstName = d.firstName,
|
||||
LastName = d.lastName,
|
||||
RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
RefDisciplineId = d.id,
|
||||
};
|
||||
seq++;
|
||||
// // var seq = 1;
|
||||
// // foreach (var d in response!.result)
|
||||
// // {
|
||||
// // var receiver = new CommandReceiver
|
||||
// // {
|
||||
// // Sequence = seq,
|
||||
// // CitizenId = d.citizenId,
|
||||
// // Prefix = d.prefix == null ? "" : d.prefix,
|
||||
// // FirstName = d.firstName,
|
||||
// // LastName = d.lastName,
|
||||
// // RefPlacementProfileId = d.profileId == null ? null : Guid.Parse(d.profileId),
|
||||
// // RefDisciplineId = d.id,
|
||||
// // };
|
||||
// // seq++;
|
||||
|
||||
resultData.Add(receiver);
|
||||
}
|
||||
}
|
||||
// // resultData.Add(receiver);
|
||||
// // }
|
||||
// }
|
||||
return Success();
|
||||
}
|
||||
catch
|
||||
|
|
@ -8686,23 +8669,15 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand40Attachment([FromBody] ReportPersonRequest req_)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand40Attachment([FromBody] ReportAttachmentRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var raw_data = await _context.Set<CommandReceiver>()
|
||||
.Include(c => c.Command)
|
||||
.Where(c => req_.refIds.Contains(c.Id.ToString()))
|
||||
.ToListAsync();
|
||||
if (raw_data == null)
|
||||
{
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
}
|
||||
var data = new List<CommandType40Response>();
|
||||
var no = 1;
|
||||
foreach (var d in raw_data)
|
||||
foreach (var d in req.refIds)
|
||||
{
|
||||
var apiUrl = $"{_configuration["API"]}/org/pos/act/{d.RefDisciplineId}/{d.RefPlacementProfileId}";
|
||||
var apiUrl = $"{_configuration["API"]}/org/pos/act/{d.refId}";
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||
|
|
@ -8723,8 +8698,10 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
postype = org.result.postype,
|
||||
poslevel = org.result.poslevel,
|
||||
organizationNew = org.result.organizationNew,
|
||||
dateStart = d.Command.ActStartDate == null ? "-" : d.Command.ActStartDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
dateEnd = d.Command.ActEndDate == null ? "-" : d.Command.ActEndDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
// dateStart = d.Command.ActStartDate == null ? "-" : d.Command.ActStartDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
// dateEnd = d.Command.ActEndDate == null ? "-" : d.Command.ActEndDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
dateStart = "xxx",
|
||||
dateEnd = "xxx",
|
||||
order = org.result.order,
|
||||
};
|
||||
no = no + 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue