บันทึกสรุปผลวินัย

This commit is contained in:
Kittapath 2023-12-19 21:40:32 +07:00
parent 7c2a4c0280
commit 6b7a5bfa06
15 changed files with 24038 additions and 0 deletions

View file

@ -113,6 +113,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
PersonId = p.PersonId,
PosNo = p.PosNo,
Organization = p.Organization,
IsSend = p.IsReport,
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
ConsideredAgency = x.ConsideredAgency,//หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง
@ -193,11 +194,13 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
data.LastUpdateFullName = FullName ?? "System Administrator";
data.LastUpdateUserId = UserId ?? "";
data.LastUpdatedAt = DateTime.Now;
var hisprofile = data.DisciplineDisciplinary_ProfileComplaintInvestigates;
_context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates);
if (data.RespondentType.Trim().ToUpper() == "PERSON")
{
foreach (var item in req.persons)
{
var isReport = hisprofile.Where(x => x.PersonId == item.personId).FirstOrDefault();
data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add(
new DisciplineDisciplinary_ProfileComplaintInvestigate
{
@ -212,6 +215,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
PersonId = item.personId,
PosNo = item.posNo,
Status = "NEW",
IsReport = isReport == null ? false : isReport.IsReport,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
CreatedAt = DateTime.Now,
@ -454,6 +458,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
PersonId = p.PersonId,
PosNo = p.PosNo,
Organization = p.Organization,
IsSend = p.IsReport,
Report = p.DisciplineReport_Profiles.Count() > 0 ? true : false,
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
@ -651,11 +656,13 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
}
data.Organization = req.organizationId;
data.RespondentType = req.respondentType;
var hisprofile = data.DisciplineDisciplinary_ProfileComplaintInvestigates;
_context.DisciplineDisciplinary_ProfileComplaintInvestigates.RemoveRange(data.DisciplineDisciplinary_ProfileComplaintInvestigates);
if (data.RespondentType.Trim().ToUpper() == "PERSON")
{
foreach (var item in req.persons)
{
var isReport = hisprofile.Where(x => x.PersonId == item.personId).FirstOrDefault();
data.DisciplineDisciplinary_ProfileComplaintInvestigates.Add(
new DisciplineDisciplinary_ProfileComplaintInvestigate
{
@ -670,6 +677,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
PersonId = item.personId,
PosNo = item.posNo,
Status = "NEW",
IsReport = isReport == null ? false : isReport.IsReport,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
CreatedAt = DateTime.Now,
@ -1528,5 +1536,35 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
.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")]
// [HttpPut("report/{commandTypeId:length(36)}")]
public async Task<ActionResult<ResponseObject>> PostToReport([FromBody] DisciplineProfileRequest req)
{
foreach (var item in req.Id)
{
var uppdated = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates
.FirstOrDefaultAsync(x => x.Id == item);
if (uppdated == null)
continue;
// uppdated.CommandTypeId = commandTypeId;
uppdated.IsReport = true;
uppdated.LastUpdateFullName = FullName ?? "System Administrator";
uppdated.LastUpdateUserId = UserId ?? "";
uppdated.LastUpdatedAt = DateTime.Now;
}
await _context.SaveChangesAsync();
return Success();
}
}
}