ออกคำสั่งวินัย

This commit is contained in:
Kittapath 2024-01-06 03:00:04 +07:00
parent 7556a6c400
commit be98975ce0
10 changed files with 17496 additions and 68 deletions

View file

@ -319,7 +319,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => x.Status == "REPORT")
.Select(x => new
{
Id = x.PersonId,
PersonId = x.PersonId,
Id = x.Id,
CommandId = x.CommandTypeId,
})
.ToListAsync();
@ -341,7 +342,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => x.StatusDiscard == "REPORT")
.Select(x => new
{
Id = x.PersonId,
PersonId = x.PersonId,
Id = x.Id,
CommandId = x.CommandTypeDiscardId,
})
.ToListAsync();
@ -363,14 +365,16 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => x.IsReport == "REPORT")
.Select(x => new
{
Id = x.PersonId,
PersonId = x.PersonId,
Id = x.Id,
})
.ToListAsync();
var data2 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => x.IsReport == "REPORT")
.Select(x => new
{
Id = x.PersonId,
PersonId = x.PersonId,
Id = x.Id,
})
.ToListAsync();
@ -396,12 +400,115 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.Where(x => x.Status == "REPORT")
.Select(x => new
{
Id = x.PersonId,
PersonId = x.PersonId,
Id = x.Id,
CommandId = x.CommandTypeId,
})
.ToListAsync();
return Success(data);
}
/// <summary>
/// รายชื่อออกคำสั่งลงโทษ
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("report/up/resume")]
public async Task<ActionResult<ResponseObject>> GetPersonReportUpResume([FromBody] PassDisciplineResponse req)
{
foreach (var d in req.result)
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => x.Status == "REPORT")
.Where(x => x.Id == d.id)
.FirstOrDefaultAsync();
if (data != null)
data.Status = "NEW";
await _context.SaveChangesAsync();
}
return Success();
}
/// <summary>
/// รายชื่อออกคำสั่งงด/ลดโทษ
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("report/down/resume")]
public async Task<ActionResult<ResponseObject>> GetPersonReportDownResume([FromBody] PassDisciplineResponse req)
{
foreach (var d in req.result)
{
var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => x.StatusDiscard == "REPORT")
.Where(x => x.Id == d.id)
.FirstOrDefaultAsync();
if (data != null)
data.StatusDiscard = "NEW";
await _context.SaveChangesAsync();
}
return Success();
}
/// <summary>
/// รายชื่อออกคำสั่งยุติ
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("report/reject/resume")]
public async Task<ActionResult<ResponseObject>> GetPersonReportRejectResume([FromBody] PassDisciplineResponse req)
{
foreach (var d in req.result)
{
var data1 = await _context.DisciplineInvestigate_ProfileComplaints
.Where(x => x.IsReport == "REPORT")
.Where(x => x.Id == d.id)
.FirstOrDefaultAsync();
if (data1 != null)
data1.IsReport = "NEW";
var data2 = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.Where(x => x.IsReport == "REPORT")
.Where(x => x.Id == d.id)
.FirstOrDefaultAsync();
if (data2 != null)
data2.IsReport = "NEW";
await _context.SaveChangesAsync();
}
return Success();
}
/// <summary>
/// รายชื่อออกคำสั่งพักราชการ
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("report/stop/resume")]
public async Task<ActionResult<ResponseObject>> GetPersonReportStopResume([FromBody] PassDisciplineResponse req)
{
foreach (var d in req.result)
{
var data = await _context.DisciplineReport_Profiles
.Where(x => x.Status == "REPORT")
.Where(x => x.Id == d.id)
.FirstOrDefaultAsync();
if (data != null)
data.Status = "NEW";
await _context.SaveChangesAsync();
}
return Success();
}
}
}