เพิ่มลูกจ้างวินัย #874
Some checks failed
release-dev / release-dev (push) Failing after 10s

This commit is contained in:
Bright 2024-12-18 11:02:24 +07:00
parent 72a7a73673
commit b042f471b4
8 changed files with 54 additions and 28 deletions

View file

@ -171,7 +171,9 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
{ {
Id = x.Id,//id ข้อมูลเรื่องร้องเรียน Id = x.Id,//id ข้อมูลเรื่องร้องเรียน
RespondentType = x.RespondentType,//ผู้ถูกร้องเรียน RespondentType = x.RespondentType,//ผู้ถูกร้องเรียน
Persons = x.DisciplineComplaint_Profiles.Select(p => new Persons = x.DisciplineComplaint_Profiles
.OrderByDescending(p => p.CreatedAt)
.Select(p => new
{ {
Id = p.Id, Id = p.Id,
Idcard = p.CitizenId, Idcard = p.CitizenId,
@ -207,6 +209,8 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
posTypeName = p.posTypeName, posTypeName = p.posTypeName,
posLevelId = p.posLevelId, posLevelId = p.posLevelId,
posLevelName = p.posLevelName, posLevelName = p.posLevelName,
profileType = p.profileType,
CreatedAt = p.CreatedAt
}),//รายการข้อมูลบุคลผู้ถูกร้องเรียน }),//รายการข้อมูลบุคลผู้ถูกร้องเรียน
Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
ConsideredAgency = x.ConsideredAgency,//หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง ConsideredAgency = x.ConsideredAgency,//หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง
@ -343,7 +347,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
posTypeName = item.posTypeName, posTypeName = item.posTypeName,
posLevelId = item.posLevelId, posLevelId = item.posLevelId,
posLevelName = item.posLevelName, posLevelName = item.posLevelName,
profileType = item.profileType,
Salary = item.salary, Salary = item.salary,
PosNo = item.posNo, PosNo = item.posNo,
Position = item.position, Position = item.position,
@ -452,7 +456,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
posTypeName = item.posTypeName, posTypeName = item.posTypeName,
posLevelId = item.posLevelId, posLevelId = item.posLevelId,
posLevelName = item.posLevelName, posLevelName = item.posLevelName,
profileType = item.profileType,
PosNo = item.posNo, PosNo = item.posNo,
CreatedFullName = FullName ?? "System Administrator", CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "", CreatedUserId = UserId ?? "",
@ -625,7 +629,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
posTypeName = item.posTypeName, posTypeName = item.posTypeName,
posLevelId = item.posLevelId, posLevelId = item.posLevelId,
posLevelName = item.posLevelName, posLevelName = item.posLevelName,
profileType = item.profileType,
Salary = item.Salary, Salary = item.Salary,
PosNo = item.PosNo, PosNo = item.PosNo,
Position = item.Position, Position = item.Position,

View file

@ -480,7 +480,9 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
// Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(), // Total = d.DisciplineDirector.DisciplineDisciplinary_DirectorInvestigates.Count(),
}).ToList(), }).ToList(),
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(p => new Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates
.OrderByDescending(p => p.CreatedAt)
.Select(p => new
{ {
Id = p.Id, Id = p.Id,
Idcard = p.CitizenId, Idcard = p.CitizenId,
@ -516,11 +518,13 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
posTypeName = p.posTypeName, posTypeName = p.posTypeName,
posLevelId = p.posLevelId, posLevelId = p.posLevelId,
posLevelName = p.posLevelName, posLevelName = p.posLevelName,
IsSend = p.IsReport, IsSend = p.IsReport,
IsSuspend = p.IsSuspend, IsSuspend = p.IsSuspend,
Status = p.Status, Status = p.Status,
StatusDiscard = p.StatusDiscard, StatusDiscard = p.StatusDiscard,
profileType = p.profileType,
CreatedAt = p.CreatedAt,
// Report = p.DisciplineReport_Profiles.Count() > 0 ? true : false, // Report = p.DisciplineReport_Profiles.Count() > 0 ? true : false,
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน }),//รายการข้อมูลบุคลผู้ถูกสืบสวน
Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
@ -775,7 +779,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
posTypeName = item.posTypeName, posTypeName = item.posTypeName,
posLevelId = item.posLevelId, posLevelId = item.posLevelId,
posLevelName = item.posLevelName, posLevelName = item.posLevelName,
profileType = item.profileType,
PosNo = item.posNo, PosNo = item.posNo,
Status = isReport == null ? "NEW" : isReport.Status, Status = isReport == null ? "NEW" : isReport.Status,
StatusDiscard = isReport == null ? "NEW" : isReport.StatusDiscard, StatusDiscard = isReport == null ? "NEW" : isReport.StatusDiscard,
@ -1766,7 +1770,7 @@ namespace BMA.EHR.DisciplineDisciplinary.Service.Controllers
posTypeName = item.posTypeName, posTypeName = item.posTypeName,
posLevelId = item.posLevelId, posLevelId = item.posLevelId,
posLevelName = item.posLevelName, posLevelName = item.posLevelName,
profileType = item.profileType,
Salary = item.Salary, Salary = item.Salary,
PosNo = item.PosNo, PosNo = item.PosNo,
Position = item.Position, Position = item.Position,

View file

@ -313,7 +313,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
// Total = d.DisciplineDirector.DisciplineInvestigate_Directors.Count(), // Total = d.DisciplineDirector.DisciplineInvestigate_Directors.Count(),
}).ToList(), }).ToList(),
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
Persons = x.DisciplineInvestigate_ProfileComplaints.Select(p => new Persons = x.DisciplineInvestigate_ProfileComplaints
.OrderByDescending(p => p.CreatedAt)
.Select(p => new
{ {
Id = p.Id, Id = p.Id,
Idcard = p.CitizenId, Idcard = p.CitizenId,
@ -349,9 +351,11 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
posTypeName = p.posTypeName, posTypeName = p.posTypeName,
posLevelId = p.posLevelId, posLevelId = p.posLevelId,
posLevelName = p.posLevelName, posLevelName = p.posLevelName,
IsSend = p.IsReport, IsSend = p.IsReport,
IsDisciplinary = p.IsDisciplinary, IsDisciplinary = p.IsDisciplinary,
profileType = p.profileType,
CreatedAt = p.CreatedAt,
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน }),//รายการข้อมูลบุคลผู้ถูกสืบสวน
Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
OrganizationId = x.OrganizationId,//id หน่วยงานกรณี type เป็นหน่วยงาน OrganizationId = x.OrganizationId,//id หน่วยงานกรณี type เป็นหน่วยงาน
@ -545,7 +549,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
posTypeName = item.posTypeName, posTypeName = item.posTypeName,
posLevelId = item.posLevelId, posLevelId = item.posLevelId,
posLevelName = item.posLevelName, posLevelName = item.posLevelName,
profileType = item.profileType,
PosNo = item.posNo, PosNo = item.posNo,
IsDisciplinary = isReport == null ? false : isReport.IsDisciplinary, IsDisciplinary = isReport == null ? false : isReport.IsDisciplinary,
IsReport = isReport == null ? "NEW" : isReport.IsReport, IsReport = isReport == null ? "NEW" : isReport.IsReport,
@ -705,7 +709,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
posTypeName = item.posTypeName, posTypeName = item.posTypeName,
posLevelId = item.posLevelId, posLevelId = item.posLevelId,
posLevelName = item.posLevelName, posLevelName = item.posLevelName,
profileType = item.profileType,
Salary = item.Salary, Salary = item.Salary,
PosNo = item.PosNo, PosNo = item.PosNo,
Position = item.Position, Position = item.Position,

View file

@ -147,7 +147,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน IdInvestigate = x.DisciplineInvestigate.Id,//id ข้อมูลเรื่องสืบสวน
IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน IdComplaint = x.DisciplineInvestigate.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.IsReport == "NEW").Select(p => new Persons = x.DisciplineDisciplinary_ProfileComplaintInvestigates.Where(x => x.IsReport == "NEW")
.OrderByDescending(p => p.CreatedAt)
.Select(p => new
{ {
Id = p.Id, Id = p.Id,
Idcard = p.CitizenId, Idcard = p.CitizenId,
@ -184,6 +186,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
posLevelName = p.posLevelName, posLevelName = p.posLevelName,
Status = p.Status, Status = p.Status,
StatusDiscard = p.StatusDiscard, StatusDiscard = p.StatusDiscard,
profileType = p.profileType,
CreatedAt = p.CreatedAt
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน }),//รายการข้อมูลบุคลผู้ถูกสืบสวน
Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน Organization = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
OrganizationId = x.OrganizationId,//id หน่วยงานกรณี type เป็นหน่วยงาน OrganizationId = x.OrganizationId,//id หน่วยงานกรณี type เป็นหน่วยงาน

View file

@ -58,7 +58,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
/// <response code="401">ไม่ได้ Login เข้าระบบ</response> /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response> /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()] [HttpGet()]
public async Task<ActionResult<ResponseObject>> GetDisciplineSuspend(int page = 1, int pageSize = 25, string keyword = "") public async Task<ActionResult<ResponseObject>> GetDisciplineSuspend(int page = 1, int pageSize = 25, string keyword = "", string profileType = "")
{ {
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_DISCIPLINE_SUSPENDED"); var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_DISCIPLINE_SUSPENDED");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission); var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -67,18 +67,22 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden); return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
} }
var data_search = (from x in _context.DisciplineReport_Profiles.Include(x => x.DisciplineDisciplinary) var data_search = (from x in _context.DisciplineReport_Profiles.Include(x => x.DisciplineDisciplinary)
where (x.CitizenId == null ? false : x.CitizenId.Contains(keyword)) || where
//(x.Prefix == null ? false : x.Prefix.Contains(keyword)) || (
//(x.FirstName == null ? false : x.FirstName.Contains(keyword)) || (x.CitizenId != null && x.CitizenId.Contains(keyword)) ||
//(x.LastName == null ? false : x.LastName.Contains(keyword)) || ((x.Prefix ?? "") + (x.FirstName ?? "") + " " + (x.LastName ?? "")).Contains(keyword) ||
((x.Prefix ?? "") + (x.FirstName ?? "") + " " + (x.LastName ?? "")).Contains(keyword) || (x.Organization != null && x.Organization.Contains(keyword)) ||
(x.Organization == null ? false : x.Organization.Contains(keyword)) || (x.Position != null && x.Position.Contains(keyword)) ||
(x.Position == null ? false : x.Position.Contains(keyword)) || (x.PosNo != null && x.PosNo.Contains(keyword)) ||
(x.PosNo == null ? false : x.PosNo.Contains(keyword)) || ((x.posTypeName ?? "") + " (" + (x.posLevelName ?? "") + ")").Contains(keyword) ||
//(x.posTypeName == null ? false : x.posTypeName.Contains(keyword)) || (x.Title != null && x.Title.Contains(keyword))
//(x.posLevelName == null ? false : x.posLevelName.Contains(keyword)) || )
((x.posTypeName ?? "") + " (" + (x.posLevelName ?? "") + ")").Contains(keyword) || &&
(x.Title == null ? false : x.Title.Contains(keyword)) (
string.IsNullOrEmpty(profileType) ||
(profileType.ToUpper() == "OFFICER" && x.profileType == "OFFICER") ||
(profileType.ToUpper() == "EMPLOYEE" && x.profileType == "EMPLOYEE")
)
select x).ToList(); select x).ToList();
var data = data_search var data = data_search
.Select(x => new .Select(x => new
@ -110,7 +114,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
posTypeName = x.posTypeName, posTypeName = x.posTypeName,
posLevelId = x.posLevelId, posLevelId = x.posLevelId,
posLevelName = x.posLevelName, posLevelName = x.posLevelName,
Position = x.Position, Position = x.Position,
PosNo = x.PosNo, PosNo = x.PosNo,
PositionLevel = x.PositionLevel == null ? "" : x.PositionLevel, PositionLevel = x.PositionLevel == null ? "" : x.PositionLevel,
@ -124,8 +128,11 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers
OffenseDetails = x.DisciplineDisciplinary.OffenseDetails,//ลักษณะความผิด OffenseDetails = x.DisciplineDisciplinary.OffenseDetails,//ลักษณะความผิด
DisciplinaryFaultLevel = x.DisciplineDisciplinary.DisciplinaryFaultLevel,//ระดับโทษความผิด DisciplinaryFaultLevel = x.DisciplineDisciplinary.DisciplinaryFaultLevel,//ระดับโทษความผิด
DisciplinaryCaseFault = x.DisciplineDisciplinary.DisciplinaryCaseFault,//กรณีความผิด DisciplinaryCaseFault = x.DisciplineDisciplinary.DisciplinaryCaseFault,//กรณีความผิด
profileType = x.profileType,
CreatedAt = x.CreatedAt,
}) })
.OrderByDescending(x => x.CitizenId) .OrderByDescending(x => x.CreatedAt)
.ThenByDescending(x => x.CitizenId)
.Skip((page - 1) * pageSize) .Skip((page - 1) * pageSize)
.Take(pageSize) .Take(pageSize)
.ToList(); .ToList();

View file

@ -56,5 +56,6 @@ namespace BMA.EHR.Discipline.Service.Requests
public string? posTypeName { get; set; } public string? posTypeName { get; set; }
public string? posLevelId { get; set; } public string? posLevelId { get; set; }
public string? posLevelName { get; set; } public string? posLevelName { get; set; }
public string? profileType { get; set; }
} }
} }

View file

@ -42,5 +42,6 @@ namespace BMA.EHR.Discipline.Service.Requests
public string? posTypeName { get; set; } public string? posTypeName { get; set; }
public string? posLevelId { get; set; } public string? posLevelId { get; set; }
public string? posLevelName { get; set; } public string? posLevelName { get; set; }
public string? profileType { get; set; }
} }
} }

View file

@ -42,5 +42,6 @@ namespace BMA.EHR.Discipline.Service.Requests
public string? posTypeName { get; set; } public string? posTypeName { get; set; }
public string? posLevelId { get; set; } public string? posLevelId { get; set; }
public string? posLevelName { get; set; } public string? posLevelName { get; set; }
public string? profileType { get; set; }
} }
} }