เตรียมไปออกคำสั่ง วินัย
This commit is contained in:
parent
3d8d65f21f
commit
536a94d907
12 changed files with 11865 additions and 2 deletions
|
|
@ -57,6 +57,8 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
{
|
||||
var data_search = (from x in _context.DisciplineDisciplinarys
|
||||
where x.Title.Contains(keyword) ||
|
||||
// x.DisciplinaryFaultLevel == null ? false : x.DisciplinaryFaultLevel.Contains(keyword) ||
|
||||
// x.DisciplinaryCaseFault == null ? false : x.DisciplinaryCaseFault.Contains(keyword)
|
||||
x.DisciplinaryFaultLevel.Contains(keyword) ||
|
||||
x.DisciplinaryCaseFault.Contains(keyword)
|
||||
select x).ToList();
|
||||
|
|
@ -1398,5 +1400,58 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
|
|||
return Error(new Exception("ไม่พบไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// สั่งรายชื่อไปออกคำสั่งให้ออกจากราชการไว้ก่อน
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("suspend/{id:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> PostToSuspend([FromBody] DisciplinePersonIdRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineDisciplinarys
|
||||
.Include(x => x.DisciplineReport_Profiles)
|
||||
.Include(x => x.DisciplineDisciplinary_ProfileComplaintInvestigates)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), StatusCodes.Status404NotFound);
|
||||
|
||||
var persons = data.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => req.persons.Contains(x.Id)).ToList();
|
||||
foreach (var item in persons)
|
||||
{
|
||||
data.DisciplineReport_Profiles.Add(
|
||||
new DisciplineReport_Profile
|
||||
{
|
||||
PersonId = item.PersonId,
|
||||
CitizenId = item.CitizenId,
|
||||
Prefix = item.Prefix,
|
||||
FirstName = item.FirstName,
|
||||
LastName = item.LastName,
|
||||
Organization = item.Organization,
|
||||
Salary = item.Salary,
|
||||
PosNo = item.PosNo,
|
||||
Position = item.Position,
|
||||
PositionLevel = item.PositionLevel,
|
||||
Status = "PENDING",
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
item.Status = "SUSPEND";
|
||||
item.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
item.LastUpdateUserId = UserId ?? "";
|
||||
item.LastUpdatedAt = DateTime.Now;
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue