fix SIT รายงานระบบบรรจุ แต่งตั้ง ย้าย โอน>>รายงานจำนวนลูกจ้างประจำ กทม. ที่ได้รับการจ้าง แต่งตั้งและย้าย (ข้อมูลไม่ถูกบันทึกลงรายงาน) #1085
Some checks failed
release-dev / release-dev (push) Failing after 11s
Some checks failed
release-dev / release-dev (push) Failing after 11s
This commit is contained in:
parent
74281c697c
commit
08c144066b
2 changed files with 59 additions and 2 deletions
|
|
@ -1815,5 +1815,46 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ออกคำสั่ง C-PM-21 คำสั่งแต่งตั้งลูกจ้างชั่วคราวเป็นลูกจ้างประจำ (ใช้สำหรับรายงานจำนวนลูกจ้างประจำ กทม. ที่ได้รับการจ้าง แต่งตั้งและย้าย)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("employee-appoint-21/report/excecute")]
|
||||
public async Task<ActionResult<ResponseObject>> PostReportAppointExecute([FromBody] ReportExecutePlacementAppointRequest req)
|
||||
{
|
||||
|
||||
if (req == null || req.profileEmps.Length == 0)
|
||||
return Error("ไม่พบรายชื่อรายการแต่งตั้งลูกจ้างชั่วคราวเป็นลูกจ้างประจำ", 404);
|
||||
|
||||
foreach (var profile in req.profileEmps)
|
||||
{
|
||||
var placementAppointEmployee = new PlacementAppointmentEmployee
|
||||
{
|
||||
profileId = profile.profileId,
|
||||
prefix = profile.prefix,
|
||||
firstName = profile.firstName,
|
||||
lastName = profile.lastName,
|
||||
citizenId = profile.citizenId,
|
||||
root = profile.root,
|
||||
rootId = profile.rootId,
|
||||
rootShortName = profile.rootShortName,
|
||||
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
await _context.PlacementAppointmentEmployee.AddAsync(placementAppointEmployee);
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3221,7 +3221,15 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
})
|
||||
.ToList();
|
||||
|
||||
var pa_appoint = placementAppointments.FirstOrDefault(x => x.TypeCommand == "APPOINTED")?.Count ?? 0;
|
||||
var pae_count = _context.PlacementAppointmentEmployee
|
||||
.Where(x =>
|
||||
x.CreatedAt.Date >= startDate &&
|
||||
x.CreatedAt.Date <= endDate &&
|
||||
x.rootId.Contains(item.rootId))
|
||||
.Count();
|
||||
|
||||
//var pa_appoint = placementAppointments.FirstOrDefault(x => x.TypeCommand == "APPOINTED")?.Count ?? 0;
|
||||
var pa_appoint = pae_count;
|
||||
var pa_slip = placementAppointments.FirstOrDefault(x => x.TypeCommand == "SLIP")?.Count ?? 0;
|
||||
var pa_move = placementAppointments.FirstOrDefault(x => x.TypeCommand == "MOVE")?.Count ?? 0;
|
||||
|
||||
|
|
@ -3254,7 +3262,15 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
})
|
||||
.ToList();
|
||||
|
||||
var pa_appoint = placementAppointments.FirstOrDefault(x => x.TypeCommand == "APPOINTED")?.Count ?? 0;
|
||||
var pae_count = _context.PlacementAppointmentEmployee
|
||||
.Where(x =>
|
||||
x.CreatedAt.Date >= startDate &&
|
||||
x.CreatedAt.Date <= endDate &&
|
||||
x.rootId.Contains(item.rootId))
|
||||
.Count();
|
||||
|
||||
//var pa_appoint = placementAppointments.FirstOrDefault(x => x.TypeCommand == "APPOINTED")?.Count ?? 0;
|
||||
var pa_appoint = pae_count;
|
||||
var pa_slip = placementAppointments.FirstOrDefault(x => x.TypeCommand == "SLIP")?.Count ?? 0;
|
||||
var pa_move = placementAppointments.FirstOrDefault(x => x.TypeCommand == "MOVE")?.Count ?? 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue