ออกคำสั่งเงินเดือน
This commit is contained in:
parent
b89c3301e3
commit
66c97a162b
14 changed files with 53814 additions and 1 deletions
|
|
@ -2499,6 +2499,8 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
var command = new
|
||||
{
|
||||
No = raw_data.CommandNo.ToThaiNumber(),
|
||||
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
|
||||
CommandNo = raw_data.CommandNo.ToThaiNumber(),
|
||||
Year = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
|
||||
Issuerorganizationname = raw_data.IssuerOrganizationName,
|
||||
ConclusionRegisterNo = raw_data.ConclusionRegisterNo == null ? "" : raw_data.ConclusionRegisterNo.ToThaiNumber(),
|
||||
|
|
@ -2539,6 +2541,67 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region " C-PM-33 "
|
||||
|
||||
private async Task<dynamic> GenerateCommandReportType33_Cover(Guid commandId, string exportType)
|
||||
{
|
||||
try
|
||||
{
|
||||
var raw_data = await _repository.GetByIdAsync(commandId);
|
||||
if (raw_data == null)
|
||||
{
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
}
|
||||
|
||||
// var raw_data_profile = await _commandReportRepository.GetCommandType25AttachmentAsync(commandId);
|
||||
|
||||
var command = new
|
||||
{
|
||||
No = raw_data.CommandNo.ToThaiNumber(),
|
||||
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
|
||||
CommandNo = raw_data.CommandNo.ToThaiNumber(),
|
||||
Year = raw_data.Year.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
|
||||
YearOld = (raw_data.Year.ToInteger() - 1).ToThaiYear().ToString().ToThaiNumber(),
|
||||
IssuerOrganizationName = raw_data.IssuerOrganizationName,
|
||||
ConclusionRegisterNo = raw_data.ConclusionRegisterNo == null ? "" : raw_data.ConclusionRegisterNo.ToThaiNumber(),
|
||||
ConclusionRegisterDate = raw_data.ConclusionRegisterDate == null ? "" : raw_data.ConclusionRegisterDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
ConclusionResultNo = raw_data.ConclusionResultNo == null ? "" : raw_data.ConclusionResultNo.ToThaiNumber(),
|
||||
ConclusionResultDate = raw_data.ConclusionResultDate == null ? "" : raw_data.ConclusionResultDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
PositionList = "",
|
||||
Count = raw_data.Receivers.Count.ToString().ToThaiNumber(),
|
||||
CommandAffectDate = raw_data.CommandAffectDate == null ? "" : raw_data.CommandAffectDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
AuthorizedUserFullName = raw_data.AuthorizedUserFullName,
|
||||
AuthorizedPosition = raw_data.AuthorizedPosition,
|
||||
ReceiveOrganizationName = raw_data.ReceiveOrganizationName,
|
||||
Title = $"{raw_data.CommandSubject}",
|
||||
|
||||
CaseFault = raw_data.CaseFault == null ? "" : raw_data.CaseFault.ToThaiNumber(),
|
||||
FaultLevel = raw_data.FaultLevel == null ? "" : raw_data.FaultLevel.ToThaiNumber(),
|
||||
RefRaw = raw_data.RefRaw == null ? "" : raw_data.RefRaw.ToThaiNumber(),
|
||||
Result = raw_data.Result == null ? "" : raw_data.Result.ToThaiNumber(),
|
||||
|
||||
// Fullname = raw_data_profile == null ? "" : raw_data_profile.FullName,
|
||||
// Positionname = raw_data_profile == null ? "" : raw_data_profile.Positionname,
|
||||
// Positionno = raw_data_profile == null || raw_data_profile.Positionno == null ? "" : raw_data_profile.Positionno.ToThaiNumber(),
|
||||
// Organizationname = raw_data_profile == null || raw_data_profile.Organizationname == null ? "" : raw_data_profile.Organizationname.ToThaiNumber(),
|
||||
// Salary = raw_data_profile == null || raw_data_profile.Salary == null ? "" : raw_data_profile.Salary.ToThaiNumber(),
|
||||
|
||||
OrderDate = raw_data.CommandAffectDate == null ? "" : raw_data.CommandAffectDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
SignatoryBy = raw_data.AuthorizedUserFullName,
|
||||
SignatoryPosition = raw_data.AuthorizedPosition,
|
||||
|
||||
CreatedAt = raw_data.CreatedAt.ToThaiFullDate3().ToThaiNumber(),
|
||||
};
|
||||
|
||||
return command;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
|
@ -4654,7 +4717,236 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
#region " C-PM-33 คำสั่งยุติเรื่อง "
|
||||
|
||||
/// <summary>
|
||||
/// คำสั่ง C-PM-33 คำสั่งยุติเรื่อง
|
||||
/// </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>
|
||||
[HttpGet("c-pm-33/cover/{exportType}/{id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetCommandType33CoverReport(Guid id, string exportType = "pdf")
|
||||
{
|
||||
try
|
||||
{
|
||||
var mimeType = "";
|
||||
switch (exportType.Trim().ToLower())
|
||||
{
|
||||
case "pdf": mimeType = "application/pdf"; break;
|
||||
case "docx": mimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; break;
|
||||
}
|
||||
|
||||
var cmd = await _repository.GetByIdAsync(id);
|
||||
if (cmd == null)
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
|
||||
var contentData = await GenerateCommandReportType33_Cover(id, exportType);
|
||||
var data = new
|
||||
{
|
||||
template = cmd.SalaryPeriod == "APR" ? "gov1-07" : "gov2-08",
|
||||
reportName = "docx-report",
|
||||
data = contentData
|
||||
};
|
||||
return Success(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region " C-PM-34 คำสั่งยุติเรื่อง "
|
||||
|
||||
/// <summary>
|
||||
/// คำสั่ง C-PM-34 คำสั่งยุติเรื่อง
|
||||
/// </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>
|
||||
[HttpGet("c-pm-34/cover/{exportType}/{id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetCommandType34CoverReport(Guid id, string exportType = "pdf")
|
||||
{
|
||||
try
|
||||
{
|
||||
var mimeType = "";
|
||||
switch (exportType.Trim().ToLower())
|
||||
{
|
||||
case "pdf": mimeType = "application/pdf"; break;
|
||||
case "docx": mimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; break;
|
||||
}
|
||||
|
||||
var cmd = await _repository.GetByIdAsync(id);
|
||||
if (cmd == null)
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
|
||||
var contentData = await GenerateCommandReportType33_Cover(id, exportType);
|
||||
var data = new
|
||||
{
|
||||
template = cmd.SalaryPeriod == "APR" ? "gov1-08" : "gov2-09",
|
||||
reportName = "docx-report",
|
||||
data = contentData
|
||||
};
|
||||
return Success(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region " C-PM-35 คำสั่งยุติเรื่อง "
|
||||
|
||||
/// <summary>
|
||||
/// คำสั่ง C-PM-35 คำสั่งยุติเรื่อง
|
||||
/// </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>
|
||||
[HttpGet("c-pm-35/cover/{exportType}/{id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetCommandType35CoverReport(Guid id, string exportType = "pdf")
|
||||
{
|
||||
try
|
||||
{
|
||||
var mimeType = "";
|
||||
switch (exportType.Trim().ToLower())
|
||||
{
|
||||
case "pdf": mimeType = "application/pdf"; break;
|
||||
case "docx": mimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; break;
|
||||
}
|
||||
|
||||
var cmd = await _repository.GetByIdAsync(id);
|
||||
if (cmd == null)
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
|
||||
var contentData = await GenerateCommandReportType33_Cover(id, exportType);
|
||||
var data = new
|
||||
{
|
||||
template = "gov2-07",
|
||||
reportName = "docx-report",
|
||||
data = contentData
|
||||
};
|
||||
return Success(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region " C-PM-36 คำสั่งยุติเรื่อง "
|
||||
|
||||
/// <summary>
|
||||
/// คำสั่ง C-PM-36 คำสั่งยุติเรื่อง
|
||||
/// </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>
|
||||
[HttpGet("c-pm-36/cover/{exportType}/{id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetCommandType36CoverReport(Guid id, string exportType = "pdf")
|
||||
{
|
||||
try
|
||||
{
|
||||
var mimeType = "";
|
||||
switch (exportType.Trim().ToLower())
|
||||
{
|
||||
case "pdf": mimeType = "application/pdf"; break;
|
||||
case "docx": mimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; break;
|
||||
}
|
||||
|
||||
var cmd = await _repository.GetByIdAsync(id);
|
||||
if (cmd == null)
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
|
||||
var contentData = await GenerateCommandReportType33_Cover(id, exportType);
|
||||
var data = new
|
||||
{
|
||||
template = cmd.SalaryPeriod == "APR" ? "emp1-11" : "emp2-12",
|
||||
reportName = "docx-report",
|
||||
data = contentData
|
||||
};
|
||||
return Success(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region " C-PM-37 คำสั่งยุติเรื่อง "
|
||||
|
||||
/// <summary>
|
||||
/// คำสั่ง C-PM-37 คำสั่งยุติเรื่อง
|
||||
/// </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>
|
||||
[HttpGet("c-pm-37/cover/{exportType}/{id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetCommandType37CoverReport(Guid id, string exportType = "pdf")
|
||||
{
|
||||
try
|
||||
{
|
||||
var mimeType = "";
|
||||
switch (exportType.Trim().ToLower())
|
||||
{
|
||||
case "pdf": mimeType = "application/pdf"; break;
|
||||
case "docx": mimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; break;
|
||||
}
|
||||
|
||||
var cmd = await _repository.GetByIdAsync(id);
|
||||
if (cmd == null)
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
|
||||
var contentData = await GenerateCommandReportType33_Cover(id, exportType);
|
||||
var data = new
|
||||
{
|
||||
template = cmd.SalaryPeriod == "APR" ? "emp1-14" : "emp2-16",
|
||||
reportName = "docx-report",
|
||||
data = contentData
|
||||
};
|
||||
return Success(data);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue