no message
This commit is contained in:
parent
4cf3f15fb8
commit
a2bc5f116b
3 changed files with 1322 additions and 3 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1222,6 +1222,85 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-22
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("employee-appoint/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAppoint([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.type == "EMPLOYEE")
|
||||
.ToListAsync();
|
||||
foreach (var placementProfile in placementProfiles)
|
||||
{
|
||||
// update placementstatus
|
||||
placementProfile.Status = "REPORT";
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// เอกสารแนบท้าย C-PM-22
|
||||
/// </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-appoint/report/attachment")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAppointAttachment([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var report_data = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.type == "EMPLOYEE")
|
||||
.Select(p => new
|
||||
{
|
||||
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Seq = "",
|
||||
FullName = "",
|
||||
Organization = p.rootOld,
|
||||
OldOrganization = p.OrganizationOld,
|
||||
OldPositionName = p.positionOld,
|
||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
|
||||
OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.ToThaiNumber(),
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = p.root == null ? "" : p.root,
|
||||
NewPositionName = p.position == null ? "" : p.position,
|
||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName.ToThaiNumber(),
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
//NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewSalary = "",
|
||||
Reason = p.Reason == null ? "-" : p.Reason
|
||||
})
|
||||
.ToListAsync();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-22
|
||||
/// </summary>
|
||||
|
|
@ -1294,6 +1373,86 @@ 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")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeMove([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.type == "EMPLOYEE")
|
||||
.ToListAsync();
|
||||
foreach (var placementProfile in placementProfiles)
|
||||
{
|
||||
// update placementstatus
|
||||
placementProfile.Status = "REPORT";
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// เอกสารแนบท้าย C-PM-24
|
||||
/// </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-move/report/attachment")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeMoveAttachment([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var report_data = await _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Where(x => x.type == "EMPLOYEE")
|
||||
.Select(p => new
|
||||
{
|
||||
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Seq = "",
|
||||
FullName = "",
|
||||
Organization = p.OrganizationPositionOld,
|
||||
OldOrganization = p.OrganizationOld,
|
||||
OldPositionName = p.positionOld,
|
||||
OldPositionLevel = p.PositionLevelOld,
|
||||
OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.ToThaiNumber(),
|
||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewOc = p.root == null ? "" : p.root,
|
||||
NewPositionName = p.position == null ? "" : p.position,
|
||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||
//NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
NewSalary = "",
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
|
||||
})
|
||||
.ToListAsync();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-24
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1809,6 +1809,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("leave-cancel/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportLeaveCancel([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("leave-cancel/report/attachment")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportLeaveCancelAttachment([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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue