Merge branch 'develop' of github.com:Frappet/BMA-EHR-BackEnd into develop
This commit is contained in:
commit
a09a732ff1
8 changed files with 811 additions and 71 deletions
|
|
@ -568,6 +568,72 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-15
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("report/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReport([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.PlacementOfficers
|
||||
.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-15
|
||||
/// </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("report/report/attachment")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var report_data = await _context.PlacementOfficers
|
||||
.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 = "",
|
||||
PositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld,
|
||||
Organization = p.Organization == null ? "" : p.Organization,
|
||||
StartDate = p.DateStart == null ? "" : p.DateStart.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
EndDate = p.DateEnd == null ? "" : p.DateEnd.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Reason = p.Reason == null ? "" : p.Reason.ToThaiNumber()
|
||||
})
|
||||
.ToListAsync();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-15
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -880,6 +880,88 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success(position);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-14
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("report/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReport([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.PlacementReceives
|
||||
.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-14
|
||||
/// </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("report/report/attachment")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var report_data = await _context.PlacementReceives
|
||||
.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.OrganizationPositionOld ?? "",
|
||||
OldPositionName = p.OrganizationPositionOld ?? "",
|
||||
OldPositionLevel = p.PositionLevelOld ?? "",
|
||||
OldPositionType = p.PositionTypeOld ?? "",
|
||||
OldPositionNumber = p.PositionNumberOld == 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,
|
||||
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>
|
||||
/// ออกคำสั่ง C-PM-14
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -475,6 +475,29 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
// return Success();
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-16
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("report/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReport([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.PlacementRepatriations
|
||||
.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-16
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -758,6 +758,77 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ส่งรายชื่อออกคำสั่ง C-PM-13
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("report/report")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReport([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
var placementProfiles = await _context.PlacementTransfers
|
||||
.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-13
|
||||
/// </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("report/report/attachment")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportPersonRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var report_data = await _context.PlacementTransfers
|
||||
.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 == null ? "" : p.OrganizationPositionOld,
|
||||
PositionName = p.PositionOld == null ? "" : p.PositionOld,
|
||||
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
//ReceiveOrganizationName = r.Command!.ReceiveOrganizationName ?? "",
|
||||
ReceiveOrganizationName = "",
|
||||
Reason = p.Reason ?? ""
|
||||
})
|
||||
.ToListAsync();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-13
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue