no message

This commit is contained in:
kittapath 2024-11-06 10:20:17 +07:00
parent b98b02ac98
commit e7728d71bd
8 changed files with 242 additions and 298 deletions

View file

@ -68,17 +68,26 @@ namespace BMA.EHR.Placement.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()]
// public async Task<ActionResult<ResponseObject>> GetListByAdmin(int page = 1, int pageSize = 10, string keyword = "")
public async Task<ActionResult<ResponseObject>> GetListByAdmin()
{
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_PROMOTION_OFFICER");
var getPermission = await _permission.GetPermissionOrgAPIAsync("LIST", "SYS_PROMOTION_OFFICER", UserId);
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
if (jsonData["status"]?.ToString() != "200")
{
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
}
// string?[] rootId = jsonData?.result?.rootId ?? null;
// string?[] child1Id = jsonData?.result?.child1Id ?? null;
// string?[] child2Id = jsonData?.result?.child2Id ?? null;
// string?[] child3Id = jsonData?.result?.child3Id ?? null;
// string?[] child4Id = jsonData?.result?.child4Id ?? null;
var placementAppointments = await _context.PlacementAppointments.AsQueryable()
.Where(x => x.type == "OFFICER")
// .Where(x => rootId == null ? true : rootId.Contains(x.rootOldId))
// .Where(x => child1Id == null ? true : child1Id.Contains(x.child1OldId))
// .Where(x => child2Id == null ? true : child2Id.Contains(x.child2OldId))
// .Where(x => child3Id == null ? true : child3Id.Contains(x.child3OldId))
// .Where(x => child4Id == null ? true : child4Id.Contains(x.child4OldId))
.OrderByDescending(x => x.CreatedAt)
.Select(p => new
{
@ -141,7 +150,6 @@ namespace BMA.EHR.Placement.Service.Controllers
p.Status,
p.Amount,
// p.RecruitDate,
p.ReportingDate,
p.IsActive,
@ -259,7 +267,6 @@ namespace BMA.EHR.Placement.Service.Controllers
p.AmountOld,
p.OrganizationOld,
p.positionOld,
// PlacementAppointmentDocs = p.PlacementAppointmentDocs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
p.typeCommand,
p.posmasterId,
})
@ -267,16 +274,6 @@ namespace BMA.EHR.Placement.Service.Controllers
if (data == null)
return Error(GlobalMessages.DataNotFound, 404);
// var placementAppointmentDocs = new List<dynamic>();
// foreach (var doc in data.PlacementAppointmentDocs)
// {
// var _doc = new
// {
// doc.FileName,
// PathName = await _documentService.ImagesPath(doc.Id)
// };
// placementAppointmentDocs.Add(_doc);
// }
var _data = new
{
data.Id,