Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop

# Conflicts:
#	BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs
This commit is contained in:
kittapath 2024-10-03 14:53:13 +07:00
commit 569f0f7fd9

View file

@ -1764,6 +1764,76 @@ $"คำขอลาออกของ {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")]
public async Task<ActionResult<ResponseObject>> PostReportEmployee([FromBody] ReportPersonRequest req)
{
var placementProfiles = await _context.RetirementResigns
.Where(x => req.refIds.Contains(x.Id.ToString()))
.ToListAsync();
foreach (var placementProfile in placementProfiles)
{
// update placementstatus
placementProfile.Status = "REPORT";
}
await _context.SaveChangesAsync();
return Success();
}
/// <summary>
/// เอกสารแนบท้าย C-PM-23
/// </summary>
/// <param name="id">Record Id ของคำสั่ง</param>
/// <param name="exportType">pdf, docx หรือ xlsx</param>
/// <returns></returns>
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpPost("employee/report/attachment")]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAttachment([FromBody] ReportPersonRequest req)
{
try
{
var report_data = await _context.RetirementResigns
.Where(x => req.refIds.Contains(x.Id.ToString()))
.Select(p => new
{
//Seq = r.Sequence.ToString().ToThaiNumber(),
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
Seq = "",
CitizenId = "",
FullName = "",
Organization = p.OrganizationPositionOld ?? "",
PositionName = p.PositionOld ?? "",
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld.ToThaiNumber(),
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
RetireDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiFullDate3().ToThaiNumber(),
//CommandYear = r.Command.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
CommandYear = ""
})
.ToListAsync();
return Success(report_data);
}
catch
{
throw;
}
}
/// <summary>
/// ออกคำสั่ง C-PM-23
/// </summary>
@ -1810,7 +1880,7 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
}
/// <summary>
/// ส่งรายชื่อออกคำสั่ง C-PM-23
/// ส่งรายชื่อออกคำสั่ง C-PM-41
/// </summary>
/// <returns></returns>
/// <response code="200"></response>
@ -1833,7 +1903,7 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
}
/// <summary>
/// เอกสารแนบท้าย C-PM-23
/// เอกสารแนบท้าย C-PM-41
/// </summary>
/// <param name="id">Record Id ของคำสั่ง</param>
/// <param name="exportType">pdf, docx หรือ xlsx</param>
@ -1860,15 +1930,15 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
Seq = "",
CitizenId = "",
FullName = "",
Organization = p.OrganizationPositionOld ?? "",
PositionName = p.PositionOld ?? "",
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld.ToThaiNumber(),
Organization = p.OrganizationPositionOld ?? "",
PositionLevel = p.PositionLevelOld ?? "",
PositionType = p.PositionTypeOld ?? "",
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
ActiveDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiShortDate2().ToThaiNumber(),
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
RetireDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiFullDate3().ToThaiNumber(),
//CommandYear = r.Command.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
CommandYear = ""
Remark = p.Reason ?? "",
RemarkHorizontal = p.RemarkHorizontal,
})
.ToListAsync();
return Success(report_data);
@ -1880,7 +1950,7 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
}
/// <summary>
/// ออกคำสั่ง C-PM-23
/// ออกคำสั่ง C-PM-41
/// </summary>
/// <returns></returns>
/// <response code="200"></response>