no message
This commit is contained in:
parent
1374757bf2
commit
9567181117
5 changed files with 528 additions and 6 deletions
|
|
@ -6741,5 +6741,410 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-25
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command25/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand25Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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/stop/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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-26
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command26/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand26Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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/stop/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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-27
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command27/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand27Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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 = data });
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-28
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command28/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand28Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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 = data });
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-29
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command29/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand29Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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 = data });
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-30
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command30/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand30Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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 = data });
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-31
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command31/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand31Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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 = data });
|
||||
var result = await res.Content.ReadAsStringAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-32
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command32/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCommand32Execute([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
var data = 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/reject/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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-33
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command33/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-34
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command34/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-35
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command35/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-36
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command36/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-37
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("command37/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -517,7 +517,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
|
||||
{
|
||||
profileId = d.personId,
|
||||
profileId = data.PersonId,
|
||||
date = d.commandAffectDate,
|
||||
detail = data.DisciplineDisciplinary.Title,
|
||||
level = data.DisciplineDisciplinary.DisciplinaryFaultLevel,
|
||||
|
|
@ -564,7 +564,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
|
||||
{
|
||||
profileId = d.personId,
|
||||
profileId = data.PersonId,
|
||||
date = d.commandAffectDate,
|
||||
detail = data.DisciplineDisciplinary.Title,
|
||||
level = data.DisciplineDisciplinary.DisciplinaryFaultLevel,
|
||||
|
|
@ -610,7 +610,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
|
||||
{
|
||||
profileId = d.personId,
|
||||
profileId = data1.PersonId,
|
||||
date = d.commandAffectDate,
|
||||
detail = data1.DisciplineInvestigate.Title,
|
||||
level = "",
|
||||
|
|
@ -638,7 +638,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
|
||||
{
|
||||
profileId = d.personId,
|
||||
profileId = data2.PersonId,
|
||||
date = d.commandAffectDate,
|
||||
detail = data2.DisciplineDisciplinary.Title,
|
||||
level = data2.DisciplineDisciplinary.DisciplinaryFaultLevel,
|
||||
|
|
@ -684,7 +684,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
|
|||
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
|
||||
{
|
||||
profileId = d.personId,
|
||||
profileId = data.PersonId,
|
||||
date = d.commandAffectDate,
|
||||
detail = data.DisciplineDisciplinary.Title,
|
||||
level = data.DisciplineDisciplinary.DisciplinaryFaultLevel,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace BMA.EHR.Discipline.Service.Requests
|
|||
public class DisciplineDataResponse
|
||||
{
|
||||
public Guid id { get; set; } = Guid.Empty;
|
||||
public Guid personId { get; set; } = Guid.Empty;
|
||||
// public Guid personId { get; set; } = Guid.Empty;
|
||||
public Guid? commandId { get; set; } = Guid.Empty;
|
||||
|
||||
public DateTime? commandAffectDate { get; set; }
|
||||
|
|
|
|||
|
|
@ -1293,5 +1293,77 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-24
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[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
|
||||
.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 _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())
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
data.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1699,5 +1699,50 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
|
|||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-23
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("employee/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteEmployee([FromBody] ReportExecuteRequest req)
|
||||
{
|
||||
// create new profile
|
||||
foreach (var recv in req.refIds)
|
||||
{
|
||||
var data = await _context.RetirementResigns
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(recv.refId));
|
||||
|
||||
if (data == null)
|
||||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
|
||||
var baseAPI = _configuration["API"];
|
||||
var apiUrl = $"{baseAPI}/org/profile-employee/salary/{data.profileId}";
|
||||
|
||||
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.Put, apiUrl);
|
||||
var _res = await client.PutAsJsonAsync(apiUrl, new
|
||||
{
|
||||
isLeave = true,
|
||||
leaveReason = "ลาออกจากราชการ",
|
||||
dateLeave = recv.commandAffectDate,
|
||||
});
|
||||
var _result = await _res.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
// update placementstatus
|
||||
data.Status = "DONE";
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue