แก้ ออก คำ สั่ง
This commit is contained in:
parent
e862829246
commit
604b234c4b
15 changed files with 897 additions and 845 deletions
|
|
@ -763,7 +763,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// เอกสารแนบท้าย C-PM-5
|
||||
/// เอกสารแนบท้าย C-PM-05
|
||||
/// </summary>
|
||||
/// <param name="id">Record Id ของคำสั่ง</param>
|
||||
/// <param name="exportType">pdf, docx หรือ xlsx</param>
|
||||
|
|
@ -776,45 +776,45 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAppointAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAppointAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -920,7 +920,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// เอกสารแนบท้าย C-PM-6
|
||||
/// เอกสารแนบท้าย C-PM-06
|
||||
/// </summary>
|
||||
/// <param name="id">Record Id ของคำสั่ง</param>
|
||||
/// <param name="exportType">pdf, docx หรือ xlsx</param>
|
||||
|
|
@ -933,45 +933,45 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReporSlipAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReporSlipAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -1077,7 +1077,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// เอกสารแนบท้าย C-PM-7
|
||||
/// เอกสารแนบท้าย C-PM-07
|
||||
/// </summary>
|
||||
/// <param name="id">Record Id ของคำสั่ง</param>
|
||||
/// <param name="exportType">pdf, docx หรือ xlsx</param>
|
||||
|
|
@ -1090,44 +1090,45 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReporMoveAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReporMoveAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -1244,39 +1245,41 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAppointAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAppointAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.Where(x => x.type == "EMPLOYEE")
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select new
|
||||
{
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
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(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -1391,40 +1394,41 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeMoveAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeMoveAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementAppointments
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.Where(x => x.type == "EMPLOYEE")
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select new
|
||||
{
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
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(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
|
|
@ -1498,44 +1498,44 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportRecruitAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportRecruitAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementProfiles
|
||||
.Include(x => x.Placement)
|
||||
.ThenInclude(x => x.PlacementType)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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 = r.Amount == null ? "0" : r.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 = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -1771,44 +1771,44 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCandidateAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportCandidateAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementProfiles
|
||||
.Include(x => x.Placement)
|
||||
.ThenInclude(x => x.PlacementType)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.Where(x => x.Placement!.PlacementType!.Name != "สอบแข่งขัน")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOINTED")
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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 = r.Amount == null ? "0" : r.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 = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -2043,55 +2043,55 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAppointAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAppointAttachment([FromBody] ReportAttachmentRequest 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(),
|
||||
var report_data = (from p in _context.PlacementProfiles
|
||||
.Include(x => x.Placement)
|
||||
.ThenInclude(x => x.PlacementType)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOIN")
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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();
|
||||
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 = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -2212,51 +2212,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportMoveAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportMoveAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementProfiles
|
||||
.Include(x => x.Placement)
|
||||
.ThenInclude(x => x.PlacementType)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.Where(x => x.Placement!.PlacementType!.Name == "แต่งตั้งข้าราชการ")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "APPOIN")
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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 = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -2377,51 +2379,53 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportSlipAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportSlipAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementProfiles
|
||||
.Include(x => x.Placement)
|
||||
.ThenInclude(x => x.PlacementType)
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ")
|
||||
.Where(x => x.typeCommand.Trim().ToUpper() == "SLIP")
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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 = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.citizenId,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
p.lastName,
|
||||
|
|
@ -601,27 +602,29 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementOfficers
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select new
|
||||
{
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
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(),
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
|
|
@ -913,43 +913,44 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementReceives
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select 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}",
|
||||
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(),
|
||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Reason = p.Reason == null ? "-" : p.Reason,
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.citizenId,
|
||||
p.profileId,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.citizenId,
|
||||
p.profileId,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
|
|
@ -791,32 +792,32 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAttachment([FromBody] ReportAttachmentRequest 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();
|
||||
var report_data = (from p in _context.PlacementTransfers
|
||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||
.ToList()
|
||||
join r in req.refIds
|
||||
on p.Id.ToString() equals r.refId
|
||||
orderby r.Sequence
|
||||
select new
|
||||
{
|
||||
Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
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 ?? ""
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue