diff --git a/BMA.EHR.Command.Service/Controllers/OrderController.cs b/BMA.EHR.Command.Service/Controllers/OrderController.cs
index 17d5b9a5..16867ddf 100644
--- a/BMA.EHR.Command.Service/Controllers/OrderController.cs
+++ b/BMA.EHR.Command.Service/Controllers/OrderController.cs
@@ -6575,507 +6575,5 @@ namespace BMA.EHR.Command.Service.Controllers
}
#endregion
-
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-11
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command11/report")]
- public async Task> PostReportCommand11([FromBody] ReportPersonRequest req_)
- {
- try
- {
- var resultData = new List();
-
- var baseAPI = _configuration["Node:API"];
- var apiUrl = $"{baseAPI}/report/pass";
-
- var response = new PassProbationResponse();
- 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(result);
-
- var seq = 1;
- foreach (var d in response!.data)
- {
- var _baseAPI = _configuration["API"];
- var _apiUrl = $"{_baseAPI}/org/profile/profileid/position/{d.person.id}";
- 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 org = JsonConvert.DeserializeObject(_result);
-
- if (org == null || org.result == null)
- continue;
-
- var receiver = new CommandReceiver
- {
- Sequence = seq,
- CitizenId = org.result.citizenId == null ? "" : org.result.citizenId,
- Prefix = org.result.prefix == null ? "" : org.result.prefix,
- FirstName = org.result.firstName == null ? "" : org.result.firstName,
- LastName = org.result.lastName == null ? "" : org.result.lastName,
- RefPlacementProfileId = org.result.profileId == null ? null : Guid.Parse(org.result.profileId),
- };
- seq++;
- resultData.Add(receiver);
- }
- }
- }
- return Success();
- }
- catch
- {
- throw;
- }
-
- }
-
- ///
- /// ออกคำสั่ง C-PM-11 คำสั่งให้ข้าราชการที่มีผลการทดลองปฏิบัติหน้าที่ราชการไม่ต่ำกว่ามาตรฐานที่กำหนดรับราชการต่อไป
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command11/report/excecute")]
- public async Task> PostReportCommand11Execute([FromBody] ReportExecuteRequest req)
- {
- // create new profile
- foreach (var recv in req.refIds)
- {
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/org/profile/command11/{recv.refId}";
- 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(apiUrl, new
- {
- profileId = recv.refId,
- date = recv.commandAffectDate,
- refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
- salaryRef = recv.templateDoc,
- });
- var _result = await _res.Content.ReadAsStringAsync();
- }
- }
- return Success();
- }
-
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-12
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command12/report")]
- public async Task> PostReportCommand12([FromBody] ReportPersonRequest req_)
- {
- try
- {
- var resultData = new List();
-
- var baseAPI = _configuration["Node:API"];
- var apiUrl = $"{baseAPI}/report/not-pass";
-
- var response = new PassProbationResponse();
- 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(result);
-
- var seq = 1;
- foreach (var d in response!.data)
- {
- var _baseAPI = _configuration["API"];
- var _apiUrl = $"{_baseAPI}/org/profile/profileid/position/{d.person.id}";
- using (var _client = new HttpClient())
- {
- _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
- _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 org = JsonConvert.DeserializeObject(_result);
-
- if (org == null || org.result == null)
- continue;
-
- var receiver = new CommandReceiver
- {
- Sequence = seq,
- CitizenId = org.result.citizenId == null ? "" : org.result.citizenId,
- Prefix = org.result.prefix == null ? "" : org.result.prefix,
- FirstName = org.result.firstName == null ? "" : org.result.firstName,
- LastName = org.result.lastName == null ? "" : org.result.lastName,
- RefPlacementProfileId = org.result.profileId == null ? null : Guid.Parse(org.result.profileId),
- };
- seq++;
- resultData.Add(receiver);
- }
- }
- }
-
- return Success();
- }
- catch
- {
- throw;
- }
- }
-
- ///
- /// ออกคำสั่ง C-PM-12 คำสั่งให้ข้าราชการออกจากราชการเพราะผลการทดลองปฏิบัติหน้าที่ราชการต่ำกว่ามาตรฐานที่กำหนด
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command12/report/excecute")]
- public async Task> PostReportCommand12Execute([FromBody] ReportExecuteRequest req)
- {
- // create new profile
- foreach (var recv in req.refIds)
- {
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/org/profile/command12/{recv.refId}";
- 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(apiUrl, new
- {
- profileId = recv.refId,
- date = recv.commandAffectDate,
- refCommandNo = $"{recv.commandNo}/{recv.commandYear.ToThaiYear()}",
- salaryRef = recv.templateDoc,
- });
- var _result = await _res.Content.ReadAsStringAsync();
- }
- }
- return Success();
- }
-
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-21
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command21/report")]
- public async Task> PostReportcommand21([FromBody] ReportPersonRequest req_)
- {
- try
- {
- var resultData = new List();
-
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/org/profile-employee/report-temp";
-
- 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(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 == null ? "" : d.firstName,
- LastName = d.lastName == null ? "" : d.lastName,
- RefPlacementProfileId = d.id,
- RefDisciplineId = d.id,
- Organization = d.organization,
- PositionName = d.positionName,
- PositionLevel = d.positionLevel,
- PositionType = d.positionType,
- PositionNumber = d.positionNumber,
- BirthDate = d.birthDate,
- };
- seq++;
-
- resultData.Add(receiver);
- }
- }
-
- return Success();
- }
- catch
- {
- throw;
- }
- }
-
- ///
- /// ออกคำสั่ง C-PM-21 คำสั่งแต่งตั้งลูกจ้างชั่วคราวเป็นลูกจ้างประจำ
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command21/report/excecute")]
- public async Task> PostReportCommand21Execute([FromBody] ReportExecuteRequest req)
- {
- var data = req.refIds.Select(x => new
- {
- id = x.refId,
- amount = x.amount,
- positionSalaryAmount = x.positionSalaryAmount,
- mouthSalaryAmount = x.mouthSalaryAmount,
- refCommandNo = $"{x.commandNo}/{x.commandYear.ToThaiYear()}",
- templateDoc = x.templateDoc,
- });
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/org/profile-employee/report/resume";
- using (var client = new HttpClient())
- {
- client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
- client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
- var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
- var result = await res.Content.ReadAsStringAsync();
- }
- return Success();
- }
-
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-38
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command38/report")]
- public async Task> PostReportCommand38([FromBody] ReportPersonRequest req)
- {
- try
- {
- // var resultData = new List();
- // var baseAPI = _configuration["API"];
-
- // 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();
-
- // // response = JsonConvert.DeserializeObject(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++;
-
- // // resultData.Add(receiver);
- // // }
- // }
- // }
- return Success();
- }
- catch
- {
- throw;
- }
- }
-
- ///
- /// ออกคำสั่ง C-PM-38 แต่งตั้งข้าราชการให้ดำรงตำแหน่ง
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command38/report/excecute")]
- public async Task> PostReportCommand38Execute([FromBody] ReportExecuteRequest req)
- {
- return Success();
- }
-
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-40
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command40/report")]
- public async Task> PostReportCommand40([FromBody] ReportPersonRequest req)
- {
- try
- {
- // var resultData = new List();
- // 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();
-
- // // response = JsonConvert.DeserializeObject(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++;
-
- // // resultData.Add(receiver);
- // // }
- // }
- return Success();
- }
- catch
- {
- throw;
- }
- }
-
- ///
- /// เอกสารแนบท้าย C-PM-40
- ///
- /// Record Id ของคำสั่ง
- /// pdf, docx หรือ xlsx
- ///
- /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command40/report/attachment")]
- [AllowAnonymous]
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status401Unauthorized)]
- [ProducesResponseType(StatusCodes.Status500InternalServerError)]
- public async Task> PostReportCommand40Attachment([FromBody] ReportAttachmentRequest req)
- {
- try
- {
- var data = new List();
- var no = 1;
- foreach (var d in req.refIds)
- {
- var apiUrl = $"{_configuration["API"]}/org/pos/act/{d.refId}";
- using (var client = new HttpClient())
- {
- client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
- var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
- var _res = await client.SendAsync(_req);
- var _result = await _res.Content.ReadAsStringAsync();
-
- var org = JsonConvert.DeserializeObject(_result);
-
- if (org == null || org.result == null)
- continue;
- var receiver = new CommandType40Response
- {
- no = no.ToString().ToThaiNumber(),
- fullName = $"{org.result.prefix}{org.result.firstName} {org.result.lastName}",
- organization = org.result.organization,
- position = org.result.position,
- 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 = "xxx",
- dateEnd = "xxx",
- order = org.result.order,
- };
- no = no + 1;
-
- data.Add(receiver);
- }
- }
- return Success(data);
- }
- catch
- {
- throw;
- }
- }
-
- ///
- /// ออกคำสั่ง C-PM-40 คำสั่งให้ข้าราชการรักษาการในตำแหน่ง
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command40/report/excecute")]
- public async Task> PostReportCommand40Execute([FromBody] ReportExecuteRequest req)
- {
- return Success();
- }
}
}
diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs
index f0a754d0..4d5998c4 100644
--- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs
+++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs
@@ -1501,12 +1501,12 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
try
{
var data1 = await _context.DisciplineInvestigate_ProfileComplaints
- .Where(x => req.refIds.Contains(x.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
+ .Where(x => req.refIds.Contains(x.Id.ToString()))
.ToListAsync();
data1.ForEach(profile => profile.IsReport = "REPORT");
var data2 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
- .Where(x => req.refIds.Contains(x.DisciplineDisciplinary.DisciplineInvestigate.DisciplineComplaint.Id.ToString()))
+ .Where(x => req.refIds.Contains(x.Id.ToString()))
.ToListAsync();
data2.ForEach(profile => profile.IsReport = "REPORT");