diff --git a/BMA.EHR.Command.Service/Controllers/OrderController.cs b/BMA.EHR.Command.Service/Controllers/OrderController.cs
index aec3d5f0..17d5b9a5 100644
--- a/BMA.EHR.Command.Service/Controllers/OrderController.cs
+++ b/BMA.EHR.Command.Service/Controllers/OrderController.cs
@@ -6782,150 +6782,6 @@ namespace BMA.EHR.Command.Service.Controllers
return Success();
}
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-19
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command19/report")]
- public async Task> PostReportCommand19([FromBody] ReportPersonRequest req)
- {
- var placementProfiles = await _context.RetirementDischarges.AsQueryable()
- .Where(x => req.refIds.Contains(x.Id.ToString()))
- .ToListAsync();
-
- placementProfiles.ForEach(profile => profile.Status = "REPORT");
- await _context.SaveChangesAsync();
- return Success();
- }
-
- ///
- /// ออกคำสั่ง C-PM-19 คำสั่งปลดออกจากราชการ
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command19/report/excecute")]
- public async Task> PostReportCommand19Execute([FromBody] ReportExecuteRequest req)
- {
- // create new profile
- foreach (var recv in req.refIds)
- {
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/org/profile/command19/{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();
- }
- }
-
- var dataSend = req.refIds.Select(x => new
- {
- Id = x.refId,
- CommandAffectDate = x.commandAffectDate,
- CommandNo = x.commandNo,
- CommandYear = x.commandYear.ToThaiYear(),
- Detail = "คำสั่งลงโทษ ปลดออกจากราชการ"
- });
-
- var _baseAPI = _configuration["API"];
- var _apiUrl = $"{_baseAPI}/discipline/result/report/up/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 = dataSend });
- var result = await res.Content.ReadAsStringAsync();
- }
- return Success();
- }
-
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-20
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command20/report")]
- public async Task> PostReportcommand20([FromBody] ReportPersonRequest req)
- {
- var placementProfiles = await _context.RetirementExpulsions.AsQueryable()
- .Where(x => req.refIds.Contains(x.Id.ToString()))
- .ToListAsync();
-
- placementProfiles.ForEach(profile => profile.Status = "REPORT");
- await _context.SaveChangesAsync();
- return Success();
- }
-
- ///
- /// ออกคำสั่ง C-PM-20 คำสั่งไล่ออกจากราชการ
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command20/report/excecute")]
- public async Task> PostReportCommand20Execute([FromBody] ReportExecuteRequest req)
- {
- // create new profile
- foreach (var recv in req.refIds)
- {
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/org/profile/command20/{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();
- }
- }
-
- var dataSend = req.refIds.Select(x => new
- {
- Id = x.refId,
- CommandAffectDate = x.commandAffectDate,
- CommandNo = x.commandNo,
- CommandYear = x.commandYear.ToThaiYear(),
- detail = "คำสั่งลงโทษ ไล่ออกจากราชการ"
- });
-
- var _baseAPI = _configuration["API"];
- var _apiUrl = $"{_baseAPI}/discipline/result/report/up/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 = dataSend });
- var result = await res.Content.ReadAsStringAsync();
- }
- return Success();
- }
-
///
/// ส่งรายชื่อออกคำสั่ง C-PM-21
///
@@ -7020,445 +6876,6 @@ namespace BMA.EHR.Command.Service.Controllers
return Success();
}
- ///
- /// ส่งรายชื่อออกคำสั่ง C-PM-33
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command33/report")]
- public async Task> PostReportCommand33([FromBody] ReportPersonRequest req)
- {
- try
- {
- // var resultData = new List();
- // var baseAPI = _configuration["API"];
-
- // 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();
-
- // // 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-33 เลื่อนเงินเดือนและให้ข้าราชการกรุงเทพมหานครสามัญ ได้รับเงินเดือนสูงกว่าขั้นสูงของตำแหน่งที่ได้รับแต่งตั้ง
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command33/report/excecute")]
- public async Task> PostReportCommand33Execute([FromBody] ReportExecuteRequest req)
- {
- var data = req.refIds.Select(x => new
- {
- Id = x.refId,
- refCommandNo = $"{x.commandNo}/{x.commandYear.ToThaiYear()}",
- templateDoc = x.templateDoc,
- });
-
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/salary/report/command/33/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-34
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command34/report")]
- public async Task> PostReportCommand34([FromBody] ReportPersonRequest req)
- {
- try
- {
- // var resultData = new List();
- // var baseAPI = _configuration["API"];
-
- // 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();
-
- // // 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-34 ให้ข้าราชการกรุงเทพมหานครสามัญได้รับค่าตอบแทนพิเศษ
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command34/report/excecute")]
- public async Task> PostReportCommand34Execute([FromBody] ReportExecuteRequest req)
- {
- var data = req.refIds.Select(x => new
- {
- Id = x.refId,
- refCommandNo = $"{x.commandNo}/{x.commandYear.ToThaiYear()}",
- templateDoc = x.templateDoc,
- });
-
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/salary/report/command/34/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-35
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command35/report")]
- public async Task> PostReportCommand35([FromBody] ReportPersonRequest req)
- {
- try
- {
- // var resultData = new List();
- // var baseAPI = _configuration["API"];
-
- // 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();
-
- // // 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-35 เลื่อนเงินเดือนและให้ข้าราชการกรุงเทพมหานครสามัญที่เกษียณอายุราชการ ในสิ้นปีงบประมาณ พ.ศ.……… ได้รับเงินเดือนสูงกว่าขั้นสูงของตำแหน่งที่ได้รับแต่งตั้ง
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command35/report/excecute")]
- public async Task> PostReportCommand35Execute([FromBody] ReportExecuteRequest req)
- {
- var data = req.refIds.Select(x => new
- {
- Id = x.refId,
- refCommandNo = $"{x.commandNo}/{x.commandYear.ToThaiYear()}",
- templateDoc = x.templateDoc,
- });
-
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/salary/report/command/35/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-36
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command36/report")]
- public async Task> PostReportCommand36([FromBody] ReportPersonRequest req)
- {
- try
- {
- // var resultData = new List();
- // var baseAPI = _configuration["API"];
-
- // 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();
-
- // // 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-36 เลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่าอัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command36/report/excecute")]
- public async Task> PostReportCommand36Execute([FromBody] ReportExecuteRequest req)
- {
- var data = req.refIds.Select(x => new
- {
- Id = x.refId,
- refCommandNo = $"{x.commandNo}/{x.commandYear.ToThaiYear()}",
- templateDoc = x.templateDoc,
- });
-
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/salary/report/command/36/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-37
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command37/report")]
- public async Task> PostReportCommand37([FromBody] ReportPersonRequest req)
- {
- try
- {
- // var resultData = new List();
- // var baseAPI = _configuration["API"];
-
- // 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();
-
- // // 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-37 ให้ลูกจ้างประจำกรุงเทพมหานครได้รับค่าตอบแทนพิเศษ
- ///
- ///
- ///
- /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง
- /// ไม่ได้ Login เข้าระบบ
- /// เมื่อเกิดข้อผิดพลาดในการทำงาน
- [HttpPost("command37/report/excecute")]
- public async Task> PostReportCommand37Execute([FromBody] ReportExecuteRequest req)
- {
- var data = req.refIds.Select(x => new
- {
- refCommandNo = $"{x.commandNo}/{x.commandYear.ToThaiYear()}",
- templateDoc = x.templateDoc,
- });
-
- var baseAPI = _configuration["API"];
- var apiUrl = $"{baseAPI}/salary/report/command/37/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
///