fix ออกคำสั่ง
This commit is contained in:
parent
38259fdea5
commit
111b638d9e
3 changed files with 185 additions and 184 deletions
|
|
@ -902,164 +902,6 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ส่งรายชื่อออกคำสั่ง C-PM-06
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200"></response>
|
|
||||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpPost("slip/report")]
|
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportSlip([FromBody] ReportPersonRequest req)
|
|
||||||
{
|
|
||||||
var placementProfiles = await _context.PlacementAppointments
|
|
||||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
|
||||||
.ToListAsync();
|
|
||||||
placementProfiles.ForEach(profile => profile.Status = "REPORT");
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
return Success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ลบรายชื่อออกคำสั่ง C-PM-06
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200"></response>
|
|
||||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpPost("slip/report/delete")]
|
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportDeleteSlip([FromBody] ReportPersonRequest req)
|
|
||||||
{
|
|
||||||
var placementProfiles = await _context.PlacementAppointments
|
|
||||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
|
||||||
// .Where(x => x.Status.ToUpper() == "REPORT")
|
|
||||||
.ToListAsync();
|
|
||||||
placementProfiles.ForEach(profile => profile.Status = "PENDING");
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
return Success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// เอกสารแนบท้าย C-PM-06
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id">Record Id ของคำสั่ง</param>
|
|
||||||
/// <param name="exportType">pdf, docx หรือ xlsx</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpPost("slip/report/attachment")]
|
|
||||||
[AllowAnonymous]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
|
||||||
public async Task<ActionResult<ResponseObject>> PostReporSlipAttachment([FromBody] ReportAttachmentRequest req)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
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
|
|
||||||
{
|
|
||||||
No = r.Sequence.ToString().ToThaiNumber(),
|
|
||||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
|
||||||
Education = p.EducationOld == null ? "-" : p.EducationOld,
|
|
||||||
OldOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
|
|
||||||
OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
|
||||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
|
||||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
|
||||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
|
||||||
LeaveDate = "",
|
|
||||||
NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root),
|
|
||||||
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
|
||||||
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(),
|
|
||||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
|
||||||
RemarkHorizontal = r.RemarkHorizontal,
|
|
||||||
RemarkVertical = r.RemarkVertical,
|
|
||||||
}).ToList();
|
|
||||||
return Success(report_data);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ออกคำสั่ง C-PM-06 เลื่อนข้าราชการ
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <response code="200"></response>
|
|
||||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
|
||||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
|
||||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
|
||||||
[HttpPost("slip/report/excecute")]
|
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportExecuteSlip([FromBody] ReportExecuteRequest req)
|
|
||||||
{
|
|
||||||
var data = await _context.PlacementAppointments
|
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
|
||||||
.ToListAsync();
|
|
||||||
var resultData = (from p in data
|
|
||||||
join r in req.refIds
|
|
||||||
on p.Id.ToString() equals r.refId
|
|
||||||
select new
|
|
||||||
{
|
|
||||||
profileId = p.profileId,
|
|
||||||
date = r.commandAffectDate,
|
|
||||||
amount = r.amount,
|
|
||||||
positionSalaryAmount = r.positionSalaryAmount,
|
|
||||||
mouthSalaryAmount = r.mouthSalaryAmount,
|
|
||||||
posNo = p.posMasterNo == null ? "" :
|
|
||||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
|
||||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
|
||||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
|
||||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
|
||||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
|
||||||
position = p.position,
|
|
||||||
positionLine = "",
|
|
||||||
positionPathSide = "",
|
|
||||||
positionExecutive = "",
|
|
||||||
positionType = p.posTypeName,
|
|
||||||
positionLevel = p.posLevelName,
|
|
||||||
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
|
||||||
templateDoc = r.templateDoc,
|
|
||||||
posmasterId = p.posmasterId,
|
|
||||||
positionId = p.positionId,
|
|
||||||
}).ToList();
|
|
||||||
|
|
||||||
var baseAPIOrg = _configuration["API"];
|
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
|
||||||
using (var client = new HttpClient())
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
|
||||||
{
|
|
||||||
data = resultData,
|
|
||||||
});
|
|
||||||
var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
if (_res.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
data.ForEach(profile => profile.Status = "DONE");
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ส่งรายชื่อออกคำสั่ง C-PM-07
|
/// ส่งรายชื่อออกคำสั่ง C-PM-07
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1521,5 +1363,170 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ส่งรายชื่อออกคำสั่ง C-PM-39
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("slip/report")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteSlip([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
var placementProfiles = await _context.PlacementAppointments
|
||||||
|
// .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")
|
||||||
|
.ToListAsync();
|
||||||
|
placementProfiles.ForEach(profile => profile.Status = "REPORT");
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ลบรายชื่อออกคำสั่ง C-PM-39
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("slip/report/delete")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteDeleteSlip([FromBody] ReportPersonRequest req)
|
||||||
|
{
|
||||||
|
var placementProfiles = await _context.PlacementAppointments
|
||||||
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
|
// .Where(x => x.PlacementStatus.ToUpper() == "REPORT")
|
||||||
|
.ToListAsync();
|
||||||
|
placementProfiles.ForEach(profile => profile.Status = "PREPARE-CONTAIN");
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// เอกสารแนบท้าย C-PM-39
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">Record Id ของคำสั่ง</param>
|
||||||
|
/// <param name="exportType">pdf, docx หรือ xlsx</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("slip/report/attachment")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportExecuteSlipAttachment([FromBody] ReportAttachmentRequest req)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var report_data = (from p in _context.PlacementAppointments
|
||||||
|
//.Include(x => x.PlacementEducation)
|
||||||
|
// .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
|
||||||
|
{
|
||||||
|
No = r.Sequence.ToString().ToThaiNumber(),
|
||||||
|
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
|
Education = p.EducationOld == null ? "" : p.EducationOld,
|
||||||
|
OldOc = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
|
||||||
|
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
||||||
|
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
||||||
|
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||||
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root),
|
||||||
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
|
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(),
|
||||||
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
|
RemarkHorizontal = r.RemarkHorizontal,
|
||||||
|
RemarkVertical = r.RemarkVertical,
|
||||||
|
}).ToList();
|
||||||
|
return Success(report_data);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ออกคำสั่ง C-PM-39 เลื่อนข้าราชการ
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200"></response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("slip/report/excecute")]
|
||||||
|
public async Task<ActionResult<ResponseObject>> PostReportSlipExecute([FromBody] ReportExecuteRequest req)
|
||||||
|
{
|
||||||
|
var data = await _context.PlacementAppointments
|
||||||
|
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
||||||
|
.ToListAsync();
|
||||||
|
var resultData = (from p in data
|
||||||
|
join r in req.refIds
|
||||||
|
on p.Id.ToString() equals r.refId
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
profileId = p.profileId,
|
||||||
|
date = r.commandAffectDate,
|
||||||
|
amount = r.amount,
|
||||||
|
positionSalaryAmount = r.positionSalaryAmount,
|
||||||
|
mouthSalaryAmount = r.mouthSalaryAmount,
|
||||||
|
posNo = p.posMasterNo == null ? "" :
|
||||||
|
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}" :
|
||||||
|
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}" : "",
|
||||||
|
position = p.position,
|
||||||
|
positionLine = "",
|
||||||
|
positionPathSide = "",
|
||||||
|
positionExecutive = "",
|
||||||
|
positionType = p.posTypeName,
|
||||||
|
positionLevel = p.posLevelName,
|
||||||
|
refCommandNo = $"{r.commandNo}/{r.commandYear.ToThaiYear()}",
|
||||||
|
templateDoc = r.templateDoc,
|
||||||
|
posmasterId = p.posmasterId,
|
||||||
|
positionId = p.positionId,
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
var baseAPIOrg = _configuration["API"];
|
||||||
|
var apiUrlOrg = $"{baseAPIOrg}/org/command/excexute/salary-current";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
data = resultData,
|
||||||
|
});
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
data.ForEach(profile => profile.Status = "DONE");
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2329,7 +2329,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ส่งรายชื่อออกคำสั่ง C-PM-39
|
/// ส่งรายชื่อออกคำสั่ง C-PM-06
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
|
|
@ -2340,11 +2340,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportSlip([FromBody] ReportPersonRequest req)
|
public async Task<ActionResult<ResponseObject>> PostReportSlip([FromBody] ReportPersonRequest req)
|
||||||
{
|
{
|
||||||
var placementProfiles = await _context.PlacementProfiles
|
var placementProfiles = await _context.PlacementProfiles
|
||||||
// .Include(x => x.Placement)
|
|
||||||
// .ThenInclude(x => x.PlacementType)
|
|
||||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
// .Where(x => x.Placement!.PlacementType!.Name == "เลื่อนข้าราชการ")
|
|
||||||
// .Where(x => x.typeCommand.Trim().ToUpper() == "SLIP")
|
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT");
|
placementProfiles.ForEach(profile => profile.PlacementStatus = "REPORT");
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
@ -2352,7 +2348,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ลบรายชื่อออกคำสั่ง C-PM-39
|
/// ลบรายชื่อออกคำสั่ง C-PM-06
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
|
|
@ -2364,15 +2360,15 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
{
|
{
|
||||||
var placementProfiles = await _context.PlacementProfiles
|
var placementProfiles = await _context.PlacementProfiles
|
||||||
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
.Where(x => req.refIds.Contains(x.Id.ToString()))
|
||||||
// .Where(x => x.PlacementStatus.ToUpper() == "REPORT")
|
// .Where(x => x.Status.ToUpper() == "REPORT")
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
placementProfiles.ForEach(profile => profile.PlacementStatus = "PREPARE-CONTAIN");
|
placementProfiles.ForEach(profile => profile.PlacementStatus = "PENDING");
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// เอกสารแนบท้าย C-PM-39
|
/// เอกสารแนบท้าย C-PM-06
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">Record Id ของคำสั่ง</param>
|
/// <param name="id">Record Id ของคำสั่ง</param>
|
||||||
/// <param name="exportType">pdf, docx หรือ xlsx</param>
|
/// <param name="exportType">pdf, docx หรือ xlsx</param>
|
||||||
|
|
@ -2385,16 +2381,13 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
public async Task<ActionResult<ResponseObject>> PostReportSlipAttachment([FromBody] ReportAttachmentRequest req)
|
public async Task<ActionResult<ResponseObject>> PostReporSlipAttachment([FromBody] ReportAttachmentRequest req)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var report_data = (from p in _context.PlacementProfiles
|
var report_data = (from p in _context.PlacementProfiles
|
||||||
.Include(x => x.PlacementEducations)
|
.Include(x => x.PlacementEducations)
|
||||||
// .ThenInclude(x => x.PlacementType)
|
|
||||||
.Where(x => req.refIds.Select(x => x.refId).Contains(x.Id.ToString()))
|
.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()
|
.ToList()
|
||||||
join r in req.refIds
|
join r in req.refIds
|
||||||
on p.Id.ToString() equals r.refId
|
on p.Id.ToString() equals r.refId
|
||||||
|
|
@ -2404,26 +2397,27 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
No = r.Sequence.ToString().ToThaiNumber(),
|
No = r.Sequence.ToString().ToThaiNumber(),
|
||||||
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" :
|
||||||
p.PlacementEducations.FirstOrDefault().Degree,
|
p.PlacementEducations.FirstOrDefault().Degree,
|
||||||
OldOc = (p.positionNameOld == null ? "" : p.positionNameOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
|
OldOc = (p.positionNameOld == null ? "" : p.positionNameOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
|
||||||
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld,
|
||||||
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld,
|
||||||
OldPositionNumber = p.posMasterNoOld == null ? "" :
|
OldPositionNumber = p.posMasterNoOld == null ? "" :
|
||||||
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() :
|
||||||
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
|
p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "",
|
||||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
|
LeaveDate = "",
|
||||||
NewOc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root),
|
NewOc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root),
|
||||||
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
NewPositionType = p.posTypeName == null ? "" : p.posTypeName,
|
||||||
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName,
|
||||||
NewPositionNumber = p.posMasterNo == null ? "" :
|
NewPositionNumber = p.posMasterNo == null ? "" :
|
||||||
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() :
|
||||||
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "",
|
||||||
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
RemarkHorizontal = r.RemarkHorizontal,
|
RemarkHorizontal = r.RemarkHorizontal,
|
||||||
|
|
@ -2438,7 +2432,7 @@ namespace BMA.EHR.Placement.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ออกคำสั่ง C-PM-39 เลื่อนข้าราชการ
|
/// ออกคำสั่ง C-PM-06 เลื่อนข้าราชการ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <response code="200"></response>
|
/// <response code="200"></response>
|
||||||
|
|
|
||||||
|
|
@ -849,7 +849,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld,
|
||||||
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(),
|
||||||
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
|
||||||
LeaveDate = "",
|
LeaveDate = p.LeaveDate == null ? "-" : p.LeaveDate.ToString(),
|
||||||
MilitaryDate = p.MilitaryDate == null ? "" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
MilitaryDate = p.MilitaryDate == null ? "" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(),
|
||||||
NewOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
|
NewOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld),
|
||||||
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue