Migrate เพิ่มฟิลด์สถานะคัดกรองคุณสมบัติ

This commit is contained in:
harid 2026-03-10 13:18:12 +07:00
parent c28a068185
commit bb0b296086
5 changed files with 3217 additions and 10 deletions

View file

@ -1612,7 +1612,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
// ใช้ dictionary lookup แทน query DB ทีละรอบ
if (!string.IsNullOrEmpty(r.ExamId) && recruitsDict.TryGetValue(r.ExamId, out var recruit))
{
r.CitizenId = workSheet?.Cells[row, 3]?.GetValue<string>();
r.CitizenId = workSheet?.Cells[row, 3]?.GetValue<string>()?.Trim();
// ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง
r.FullA = 200;
@ -1651,6 +1651,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
}
r.RemarkScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 15]?.GetValue<string>()) ? string.Empty : workSheet?.Cells[row, 15]?.GetValue<string>();
r.ExamAttribute = (workSheet?.Cells[row, 16]?.GetValue<string>()?.Trim() == "ผ่าน") ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ";
r.Major = workSheet.Name;
r.CreatedAt = DateTime.Now;
@ -2091,10 +2094,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
: "",
examScore = x.score == null ? 0.0 : x.score.TotalScore,
examResult = x.score == null ? "" : x.score.ExamStatus,
examAttribute = x.disable.Certificates.Any() && x.disable.Certificates.First().IssueDate != null
? _disableService.CheckValidCertificate(x.disable.Certificates.First().IssueDate, 5)
? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ"
: "ไม่มีคุณสมบัติ",
//examAttribute = x.disable.Certificates.Any() && x.disable.Certificates.First().IssueDate != null
// ? _disableService.CheckValidCertificate(x.disable.Certificates.First().IssueDate, 5)
// ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ"
// : "ไม่มีคุณสมบัติ",
examAttribute = x.score == null
? "ไม่มีคุณสมบัติ"
: string.IsNullOrEmpty(x.score.ExamAttribute)
? "ไม่มีคุณสมบัติ"
: x.score.ExamAttribute,
remark = x.disable.Remark,
isSpecial = x.disable.Isspecial == "Y" ? x.disable.Isspecial : "",
applyDate = x.disable.ApplyDate.HasValue && x.disable.ApplyDate.Value != DateTime.MinValue
@ -2214,11 +2222,16 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
: ""
: "",
ExamResult = sr == null ? "" : sr.ExamStatus,
ExamAttribute = p.Certificates.Count > 0 ?
_disableService.CheckValidCertificate(p.Certificates.First().IssueDate, 5)
? "มีคุณสมบัติ"
: "ไม่มีคุณสมบัติ"
: "ไม่มีคุณสมบัติ",
// ExamAttribute = p.Certificates.Count > 0 ?
// _disableService.CheckValidCertificate(p.Certificates.First().IssueDate, 5)
// ? "มีคุณสมบัติ"
// : "ไม่มีคุณสมบัติ"
// : "ไม่มีคุณสมบัติ",
ExamAttribute = sr == null
? "ไม่มีคุณสมบัติ"
: string.IsNullOrEmpty(sr.ExamAttribute)
? "ไม่มีคุณสมบัติ"
: sr.ExamAttribute,
IsSpecial = p.Isspecial,
Remark = p.Remark,
University = p.Educations.First().University,