แก้ ออก คำ สั่ง
This commit is contained in:
parent
e862829246
commit
604b234c4b
15 changed files with 897 additions and 845 deletions
|
|
@ -182,6 +182,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
.Select(p => new
|
||||
{
|
||||
p.Id,
|
||||
p.citizenId,
|
||||
p.profileId,
|
||||
p.prefix,
|
||||
p.firstName,
|
||||
|
|
@ -1659,28 +1660,32 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
|
|||
[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.RetirementResigns
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Select(p => new
|
||||
{
|
||||
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
PositionName = p.PositionOld ?? "",
|
||||
Organization = p.OrganizationPositionOld ?? "",
|
||||
PositionLevel = p.PositionLevelOld ?? "",
|
||||
PositionType = p.PositionTypeOld ?? "",
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
ActiveDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
Remark = p.Reason ?? "",
|
||||
RemarkHorizontal = p.RemarkHorizontal,
|
||||
})
|
||||
.ToListAsync();
|
||||
var report_data = (from p in _context.RetirementResigns
|
||||
.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.PositionOld ?? "",
|
||||
Organization = p.OrganizationPositionOld ?? "",
|
||||
PositionLevel = p.PositionLevelOld ?? "",
|
||||
PositionType = p.PositionTypeOld ?? "",
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
ActiveDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
Remark = p.Reason ?? "",
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -1793,31 +1798,32 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportEmployeeAttachment([FromBody] ReportAttachmentRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var report_data = await _context.RetirementResigns
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Select(p => new
|
||||
{
|
||||
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Seq = "",
|
||||
CitizenId = "",
|
||||
FullName = "",
|
||||
Organization = p.OrganizationPositionOld ?? "",
|
||||
PositionName = p.PositionOld ?? "",
|
||||
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
|
||||
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld.ToThaiNumber(),
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
RetireDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
//CommandYear = r.Command.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
|
||||
CommandYear = ""
|
||||
})
|
||||
.ToListAsync();
|
||||
var report_data = (from p in _context.RetirementResigns
|
||||
.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 ?? "",
|
||||
PositionName = p.PositionOld ?? "",
|
||||
PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(),
|
||||
PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld.ToThaiNumber(),
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
RetireDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiFullDate3().ToThaiNumber(),
|
||||
CommandYear = r.CommandYear.ToThaiYear().ToString().ToThaiNumber(),
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
@ -1904,31 +1910,32 @@ $"คำขอลาออกของ {updated.prefix}{updated.firstName} {upda
|
|||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportLeaveCancelAttachment([FromBody] ReportPersonRequest req)
|
||||
public async Task<ActionResult<ResponseObject>> PostReportLeaveCancelAttachment([FromBody] ReportAttachmentRequest req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var report_data = await _context.RetirementResigns
|
||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||
.Select(p => new
|
||||
{
|
||||
//Seq = r.Sequence.ToString().ToThaiNumber(),
|
||||
//CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(),
|
||||
//FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||
Seq = "",
|
||||
CitizenId = "",
|
||||
FullName = "",
|
||||
PositionName = p.PositionOld ?? "",
|
||||
Organization = p.OrganizationPositionOld ?? "",
|
||||
PositionLevel = p.PositionLevelOld ?? "",
|
||||
PositionType = p.PositionTypeOld ?? "",
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
ActiveDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
Remark = p.Reason ?? "",
|
||||
RemarkHorizontal = p.RemarkHorizontal,
|
||||
})
|
||||
.ToListAsync();
|
||||
var report_data = (from p in _context.RetirementResigns
|
||||
.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.PositionOld ?? "",
|
||||
Organization = p.OrganizationPositionOld ?? "",
|
||||
PositionLevel = p.PositionLevelOld ?? "",
|
||||
PositionType = p.PositionTypeOld ?? "",
|
||||
PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||
ActiveDate = p.ActiveDate == null ? "" : p.ActiveDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||
Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||
Remark = p.Reason ?? "",
|
||||
RemarkHorizontal = r.RemarkHorizontal,
|
||||
RemarkVertical = r.RemarkVertical,
|
||||
}).ToList();
|
||||
return Success(report_data);
|
||||
}
|
||||
catch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue