Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
This commit is contained in:
commit
139969b324
2 changed files with 509 additions and 45 deletions
|
|
@ -754,22 +754,79 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
[HttpPost("appoint/report")]
|
[HttpPost("appoint/report")]
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportAppoint([FromBody] ReportPersonRequest req)
|
public async Task<ActionResult<ResponseObject>> PostReportAppoint([FromBody] ReportPersonRequest req)
|
||||||
{
|
{
|
||||||
var placementProfiles = await _context.PlacementProfiles
|
var placementProfiles = await _context.PlacementAppointments
|
||||||
.Include(x => x.Placement)
|
|
||||||
.ThenInclude(x => x.PlacementType)
|
|
||||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
.Where(x => x.Placement!.PlacementType!.Name == "คำสั่งแต่งตั้ง")
|
|
||||||
.Where(x => x.typeCommand.Trim().ToUpper() == "REPORT")
|
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
foreach (var placementProfile in placementProfiles)
|
foreach (var placementProfile in placementProfiles)
|
||||||
{
|
{
|
||||||
// update placementstatus
|
// update placementstatus
|
||||||
placementProfile.PlacementStatus = "PREPARE-CONTAIN";
|
placementProfile.Status = "REPORT";
|
||||||
}
|
}
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// เอกสารแนบท้าย C-PM-5
|
||||||
|
/// </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("appoint/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportAppointAttachment([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = await _context.PlacementAppointments
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
.Select(p => new
|
||||||
|
{
|
||||||
|
Education = p.EducationOld == null ? "-" : p.EducationOld,
|
||||||
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Seq = "",
|
||||||
|
CitizenId = "",
|
||||||
|
FullName = "",
|
||||||
|
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||||
|
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||||
|
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||||
|
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||||
|
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
NewOc = p.root == null ? "" : p.root,
|
||||||
|
NewPositionName = p.position == null ? "" : p.position,
|
||||||
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
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 = "",
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
Reason = p.Reason == null ? "-" : p.Reason
|
||||||
|
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-05
|
/// ออกคำสั่ง C-PM-05
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -858,22 +915,79 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
[HttpPost("slip/report")]
|
[HttpPost("slip/report")]
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportSlip([FromBody] ReportPersonRequest req)
|
public async Task<ActionResult<ResponseObject>> PostReportSlip([FromBody] ReportPersonRequest req)
|
||||||
{
|
{
|
||||||
var placementProfiles = await _context.PlacementProfiles
|
var placementProfiles = await _context.PlacementAppointments
|
||||||
.Include(x => x.Placement)
|
|
||||||
.ThenInclude(x => x.PlacementType)
|
|
||||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
.Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ")
|
|
||||||
.Where(x => x.typeCommand.Trim().ToUpper() == "REPORT")
|
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
foreach (var placementProfile in placementProfiles)
|
foreach (var placementProfile in placementProfiles)
|
||||||
{
|
{
|
||||||
// update placementstatus
|
// update placementstatus
|
||||||
placementProfile.PlacementStatus = "PREPARE-CONTAIN";
|
placementProfile.Status = "REPORT";
|
||||||
}
|
}
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// เอกสารแนบท้าย C-PM-6
|
||||||
|
/// </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("slip/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReporSlipAttachment([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = await _context.PlacementAppointments
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
.Select(p => new
|
||||||
|
{
|
||||||
|
Education = p.EducationOld == null ? "-" : p.EducationOld,
|
||||||
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Seq = "",
|
||||||
|
CitizenId = "",
|
||||||
|
FullName = "",
|
||||||
|
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||||
|
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||||
|
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||||
|
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||||
|
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
NewOc = p.root == null ? "" : p.root,
|
||||||
|
NewPositionName = p.position == null ? "" : p.position,
|
||||||
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
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 = "",
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
Reason = p.Reason == null ? "-" : p.Reason
|
||||||
|
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-06
|
/// ออกคำสั่ง C-PM-06
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -951,6 +1065,89 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ส่งรายชื่อออกคำสั่ง C-PM-07
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("move/report")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportMove([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
var placementProfiles = await _context.PlacementAppointments
|
||||||
|
.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-7
|
||||||
|
/// </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("move/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReporMoveAttachment([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = await _context.PlacementAppointments
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
.Select(p => new
|
||||||
|
{
|
||||||
|
Education = p.EducationOld == null ? "-" : p.EducationOld,
|
||||||
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Seq = "",
|
||||||
|
CitizenId = "",
|
||||||
|
FullName = "",
|
||||||
|
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||||
|
OldPositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||||
|
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||||
|
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||||
|
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
OldSalaryDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
NewOc = p.root == null ? "" : p.root,
|
||||||
|
NewPositionName = p.position == null ? "" : p.position,
|
||||||
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
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 = "",
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
Reason = p.Reason == null ? "-" : p.Reason
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-07
|
/// ออกคำสั่ง C-PM-07
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1487,7 +1487,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpGet("recruit/report/attachment")]
|
[HttpPost("recruit/report/attachment")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
|
@ -1496,38 +1496,40 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var report_data = "null";
|
var report_data = await _context.PlacementProfiles
|
||||||
// var report_data = (from r in req.refIds
|
.Include(x => x.Placement)
|
||||||
// join p in _dbContext.Set<PlacementProfile>()
|
.ThenInclude(x => x.PlacementType)
|
||||||
// .Include(x => x.PlacementEducations)
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
// .Include(x => x.Placement)
|
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
|
||||||
// on r equals p.Id
|
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
|
||||||
// orderby r.Sequence
|
.Select(p => new
|
||||||
// select new CommandType01Response
|
{
|
||||||
// {
|
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
||||||
// Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
p.PlacementEducations.FirstOrDefault().Degree,
|
||||||
// p.PlacementEducations.FirstOrDefault().Degree,
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
// Seq = r.Sequence.ToString().ToThaiNumber(),
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
// CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
// FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
Seq = "",
|
||||||
// Oc = p.root == null ? "" : p.root,
|
CitizenId = "",
|
||||||
// PositionName = p.positionName == null ? "" : p.positionName,
|
FullName = "",
|
||||||
// PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
Oc = p.root == null ? "" : p.root,
|
||||||
// PositionType = p.posTypeName == null ? "" : p.posTypeName,
|
PositionName = p.positionName == null ? "" : p.positionName,
|
||||||
// PositionNumber = p.posMasterNo == null ? "" :
|
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
// p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
PositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
// p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
PositionNumber = p.posMasterNo == null ? "" :
|
||||||
// p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
// p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
// p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
// Salary = p.Amount == null ? "0" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
|
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
// AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||||
// ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
|
Salary = p.Amount == null ? "0" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
|
||||||
// PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
// RemarkHorizontal = p.RemarkHorizontal,
|
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
|
||||||
// RemarkVertical = p.RemarkVertical,
|
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
|
||||||
// }).ToList();
|
RemarkHorizontal = p.RemarkHorizontal,
|
||||||
|
RemarkVertical = p.RemarkVertical,
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
return Success(report_data);
|
return Success(report_data);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
@ -1753,6 +1755,66 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// เอกสารแนบท้าย C-PM-02
|
||||||
|
/// </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("candidate/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportCandidateAttachment([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = await _context.PlacementProfiles
|
||||||
|
.Include(x => x.Placement)
|
||||||
|
.ThenInclude(x => x.PlacementType)
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
|
||||||
|
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
|
||||||
|
.Select(p => new
|
||||||
|
{
|
||||||
|
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
||||||
|
p.PlacementEducations.FirstOrDefault().Degree,
|
||||||
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Seq = "",
|
||||||
|
CitizenId = "",
|
||||||
|
FullName = "",
|
||||||
|
Oc = p.root == null ? "" : p.root,
|
||||||
|
PositionName = p.positionName == null ? "" : p.positionName,
|
||||||
|
PositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
PositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
PositionNumber = 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() : "",
|
||||||
|
Salary = p.Amount == null ? "0" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(),
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
ExamNumber = p.ExamNumber == null ? "0" : p.ExamNumber.Value.ToString().ToThaiNumber(),
|
||||||
|
PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}",
|
||||||
|
RemarkHorizontal = p.RemarkHorizontal,
|
||||||
|
RemarkVertical = p.RemarkVertical,
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-02
|
/// ออกคำสั่ง C-PM-02
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1969,6 +2031,77 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// เอกสารแนบท้าย C-PM-03
|
||||||
|
/// </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("appoint/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportAppointAttachment([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = await _context.PlacementProfiles
|
||||||
|
.Include(x => x.Placement)
|
||||||
|
.ThenInclude(x => x.PlacementType)
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
.Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ")
|
||||||
|
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOIN")
|
||||||
|
.Select(p => new
|
||||||
|
{
|
||||||
|
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
||||||
|
p.PlacementEducations.FirstOrDefault().Degree,
|
||||||
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Seq = "",
|
||||||
|
CitizenId = "",
|
||||||
|
FullName = "",
|
||||||
|
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||||
|
Probation = "",
|
||||||
|
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
|
||||||
|
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
||||||
|
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
||||||
|
OldPositionNumber = p.posMasterNoOld == null ? "" :
|
||||||
|
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
|
||||||
|
NewOc = p.root == null ? "" : p.root,
|
||||||
|
NewPositionName = p.positionName == null ? "" : p.positionName,
|
||||||
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
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 = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
RemarkHorizontal = p.RemarkHorizontal,
|
||||||
|
RemarkVertical = p.RemarkVertical
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-03
|
/// ออกคำสั่ง C-PM-03
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2071,6 +2204,73 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// เอกสารแนบท้าย C-PM-04
|
||||||
|
/// </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("move/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportMoveAttachment([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = await _context.PlacementProfiles
|
||||||
|
.Include(x => x.Placement)
|
||||||
|
.ThenInclude(x => x.PlacementType)
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
.Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ")
|
||||||
|
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOIN")
|
||||||
|
.Select(p => new
|
||||||
|
{
|
||||||
|
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "":
|
||||||
|
p.PlacementEducations.FirstOrDefault().Degree,
|
||||||
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Seq = "",
|
||||||
|
CitizenId = "",
|
||||||
|
FullName = "",
|
||||||
|
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||||
|
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
|
||||||
|
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
||||||
|
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
||||||
|
OldPositionNumber = p.posMasterNoOld == null ? "" :
|
||||||
|
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
NewOc = p.root == null ? "" : p.root,
|
||||||
|
NewPositionName = p.positionName == null ? "" : p.positionName,
|
||||||
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
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 = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber()
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-04
|
/// ออกคำสั่ง C-PM-04
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -2173,6 +2373,73 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// เอกสารแนบท้าย C-PM-39
|
||||||
|
/// </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("slip/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportSlipAttachment([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = await _context.PlacementProfiles
|
||||||
|
.Include(x => x.Placement)
|
||||||
|
.ThenInclude(x => x.PlacementType)
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
.Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ")
|
||||||
|
.Where(x => x.typeCommand.Trim().ToUpper() == "SLIP")
|
||||||
|
.Select(p => new
|
||||||
|
{
|
||||||
|
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
||||||
|
p.PlacementEducations.FirstOrDefault().Degree,
|
||||||
|
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||||
|
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Seq = "",
|
||||||
|
CitizenId = "",
|
||||||
|
FullName = "",
|
||||||
|
OldOc = p.rootOld == null ? "" : p.rootOld,
|
||||||
|
OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld,
|
||||||
|
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
||||||
|
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
||||||
|
OldPositionNumber = p.posMasterNoOld == null ? "" :
|
||||||
|
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
|
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
NewOc = p.root == null ? "" : p.root,
|
||||||
|
NewPositionName = p.positionName == null ? "" : p.positionName,
|
||||||
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
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 = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber()
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-39
|
/// ออกคำสั่ง C-PM-39
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue