diff --git a/Controllers/DisableController.cs b/Controllers/DisableController.cs index f690778..15e5b91 100644 --- a/Controllers/DisableController.cs +++ b/Controllers/DisableController.cs @@ -660,6 +660,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers .ThenInclude(x => x.Scores) .OrderByDescending(x => x.Year) .ThenByDescending(x => x.Round) + .ThenByDescending(x => x.LastUpdatedAt) .Select(x => new { x.Id, @@ -668,14 +669,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers x.Round, ImportDate = x.CreatedAt.Date.ToThaiShortDate(), ExamCount = x.Disables.Count(), - Score = x.ScoreImport == null ? null : + Score = x.ScoreImport == null || x.ScoreImport.Scores.Count == 0 ? null : new { ID = x.ScoreImport.Id, ImportYear = x.ScoreImport.Year, ImportDate = x.CreatedAt.Date.ToThaiShortDate(), ScoreCount = x.ScoreImport.Scores.Count(), - + ResultCount = x.ScoreImport.Scores.Count(x => !string.IsNullOrEmpty(x.Number)) }, x.CreatedUserId, }) @@ -1040,7 +1041,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers /// - /// นำเข้ารายชื่อผู้สมัครสอบคัดเลือกผู้พิการ + /// นำเข้ารายชื่อผู้สมัครสอบคัดเลือกผู้พิการ (ข้อมูลผู้สมัครสอบ) /// /// รหัสรอบการสอบคัดเลือกผู้พิการ /// @@ -1142,137 +1143,272 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers var cell1 = workSheet?.Cells[row, 1]?.GetValue(); if (cell1 == "" || cell1 == null) break; - var r = new Recurit.Exam.Service.Models.Disables.Disable(); - r.ExamId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ExamID)]?.GetValue(); - r.CitizenId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalID)]?.GetValue(); - r.Prefix = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Prefix)]?.GetValue(); - r.FirstName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.FirstName)]?.GetValue(); - r.LastName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.LastName)]?.GetValue(); - r.Gendor = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Gender)]?.GetValue(); - r.National = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.National)]?.GetValue().IsNull(""); - r.Race = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Race)]?.GetValue().IsNull(""); - r.Religion = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Religion)]?.GetValue().IsNull(""); - //r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-"));k - r.DateOfBirth = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue; - r.Marry = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Marry)]?.GetValue(); + # region old + ////var r = new Recurit.Exam.Service.Models.Disables.Disable(); + ////r.ExamId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ExamID)]?.GetValue(); + ////r.CitizenId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalID)]?.GetValue(); + ////r.Prefix = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Prefix)]?.GetValue(); + ////r.FirstName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.FirstName)]?.GetValue(); + ////r.LastName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.LastName)]?.GetValue(); + ////r.Gendor = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Gender)]?.GetValue(); + ////r.National = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.National)]?.GetValue().IsNull(""); + ////r.Race = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Race)]?.GetValue().IsNull(""); + ////r.Religion = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Religion)]?.GetValue().IsNull(""); + //////r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-"));k + ////r.DateOfBirth = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue; + ////r.Marry = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Marry)]?.GetValue(); + ////r.Isspecial = "N"; + ////r.CitizenCardIssuer = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardIssue)]?.GetValue(); + ////r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-")); + ////r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue(); + ////r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue().IsNull(""); + ////r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue().IsNull(""); + ////r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue().IsNull(""); + + ////// address + ////r.Addresses.Add(new DisableAddress() + ////{ + //// Address = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Address)]?.GetValue() ?? "", + //// Moo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo)]?.GetValue() ?? "", + //// Soi = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi)]?.GetValue() ?? "", + //// Road = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road)]?.GetValue() ?? "", + //// District = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District)]?.GetValue() ?? "", + //// Amphur = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur)]?.GetValue() ?? "", + //// Province = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Province)]?.GetValue() ?? "", + //// ZipCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode)]?.GetValue() ?? "", + //// Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Telephone)]?.GetValue() ?? "", + //// Mobile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Mobile)]?.GetValue() ?? "", + //// Address1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Address1)]?.GetValue() ?? "", + //// Moo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo1)]?.GetValue() ?? "", + //// Soi1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi1)]?.GetValue() ?? "", + //// Road1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road1)]?.GetValue() ?? "", + //// District1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District1)]?.GetValue() ?? "", + //// Amphur1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur1)]?.GetValue() ?? "", + //// Province1 = "", + //// ZipCode1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode1)]?.GetValue() ?? "", + //// CreatedAt = DateTime.Now, + //// CreatedUserId = UserId ?? "", + //// CreatedFullName = FullName ?? "System Administrator", + //// LastUpdatedAt = DateTime.Now, + //// LastUpdateUserId = UserId ?? "", + //// LastUpdateFullName = FullName ?? "System Administrator", + ////}); + + ////// payment + ////r.Payments.Add(new DisablePayment() + ////{ + //// PaymentId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PaymentID)]?.GetValue() ?? "", + //// CompanyCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CompanyCode)]?.GetValue() ?? "", + //// TextFile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TextFile)]?.GetValue() ?? "", + //// BankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BankCode)]?.GetValue() ?? "", + //// AccountNumber = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.AccouontNumer)]?.GetValue() ?? "", + //// TransDate = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransDate)]?.GetValue() ?? "", + //// TransTime = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransTime)]?.GetValue() ?? "", + //// CustomerName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CustomerName)]?.GetValue() ?? "", + //// RefNo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.RefNo1)]?.GetValue() ?? "", + //// TermBranch = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TermBranch)]?.GetValue() ?? "", + //// TellerId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TellerID)]?.GetValue() ?? "", + //// CreditDebit = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CreditDebit)]?.GetValue() ?? "", + //// PaymentType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Type)]?.GetValue(), + //// ChequeNo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChequeNo)]?.GetValue() ?? "", + //// Amount = (decimal)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amount)]?.GetValue(), + //// ChqueBankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChqBankCode)]?.GetValue() ?? "", + //// CreatedAt = DateTime.Now, + //// CreatedUserId = UserId ?? "", + //// CreatedFullName = FullName ?? "System Administrator", + //// LastUpdatedAt = DateTime.Now, + //// LastUpdateUserId = UserId ?? "", + //// LastUpdateFullName = FullName ?? "System Administrator", + ////}); + + ////// occupation + ////r.Occupations.Add(new DisableOccupation() + ////{ + //// Occupation = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Occupation)]?.GetValue() ?? "", + //// Position = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Position)]?.GetValue() ?? "", + //// Workplace = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Workplace)]?.GetValue() ?? "", + //// Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkplaceTelephone)]?.GetValue() ?? "", + //// WorkAge = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkAge)]?.GetValue() ?? "", + //// CreatedAt = DateTime.Now, + //// CreatedUserId = UserId ?? "", + //// CreatedFullName = FullName ?? "System Administrator", + //// LastUpdatedAt = DateTime.Now, + //// LastUpdateUserId = UserId ?? "", + //// LastUpdateFullName = FullName ?? "System Administrator", + ////}); + + ////// certificate + ////r.Certificates.Add(new DisableCertificate() + ////{ + //// CertificateNo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateNo)]?.GetValue() ?? "", + //// Description = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateDesc)]?.GetValue() ?? "", + //// IssueDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue, + //// ExpiredDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue, + //// CreatedAt = DateTime.Now, + //// CreatedUserId = UserId ?? "", + //// CreatedFullName = FullName ?? "System Administrator", + //// LastUpdatedAt = DateTime.Now, + //// LastUpdateUserId = UserId ?? "", + //// LastUpdateFullName = FullName ?? "System Administrator", + ////}); + + ////r.Educations.Add(new DisableEducation() + ////{ + //// Degree = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Degree)]?.GetValue() ?? "", + //// Major = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Major)]?.GetValue() ?? "", + //// MajorGroupId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupID)]?.GetValue() ?? "", + //// MajorGroupName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupName)]?.GetValue() ?? "", + //// University = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.University)]?.GetValue() ?? "", + //// GPA = (double)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.GPA)]?.GetValue(), + //// Specialist = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.SpecialList)]?.GetValue() ?? "", + //// HighDegree = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.HighDegree)]?.GetValue() ?? "", + //// BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue, + //// CreatedAt = DateTime.Now, + //// CreatedUserId = UserId ?? "", + //// CreatedFullName = FullName ?? "System Administrator", + //// LastUpdatedAt = DateTime.Now, + //// LastUpdateUserId = UserId ?? "", + //// LastUpdateFullName = FullName ?? "System Administrator", + ////}); + # endregion + + var r = new Models.Disables.Disable(); + r.ExamId = workSheet?.Cells[row, 1]?.GetValue() ?? ""; + r.PositionName = workSheet?.Cells[row, 3]?.GetValue() ?? ""; + r.HddPosition = workSheet?.Cells[row, 4]?.GetValue() ?? ""; + r.Prefix = workSheet?.Cells[row, 5]?.GetValue() == "อื่น ๆ" ? workSheet?.Cells[row, 6]?.GetValue() ?? "" : workSheet?.Cells[row, 5]?.GetValue() ?? ""; + r.FirstName = workSheet?.Cells[row, 7]?.GetValue() ?? ""; + r.LastName = workSheet?.Cells[row, 8]?.GetValue() ?? ""; + r.Gendor = workSheet?.Cells[row, 98]?.GetValue() ?? ""; + r.National = workSheet?.Cells[row, 9]?.GetValue() ?? ""; + r.Race = workSheet?.Cells[row, 9999]?.GetValue() ?? ""; + r.Religion = workSheet?.Cells[row, 10]?.GetValue() ?? ""; + r.DateOfBirth = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 11]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 11]?.GetValue() ?? "", "dd/MM/yyyy") : DateTime.MinValue; + r.CitizenId = workSheet?.Cells[row, 12]?.GetValue() ?? ""; + r.typeTest = workSheet?.Cells[row, 13]?.GetValue() ?? ""; + r.Marry = workSheet?.Cells[row, 9999]?.GetValue() ?? ""; r.Isspecial = "N"; - r.CitizenCardIssuer = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardIssue)]?.GetValue(); - r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-")); - r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue(); - r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue().IsNull(""); - r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue().IsNull(""); - r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue().IsNull(""); + r.CitizenCardIssuer = workSheet?.Cells[row, 9999]?.GetValue() ?? ""; + r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-")); + r.ApplyDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 87]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 87]?.GetValue() ?? "", "dd/MM/yyyy") : DateTime.MinValue; + r.PositionType = workSheet?.Cells[row, 9999]?.GetValue() ?? ""; + r.PositionLevel = workSheet?.Cells[row, 9999]?.GetValue() ?? ""; - // address - r.Addresses.Add(new DisableAddress() + r.CreatedAt = DateTime.Now; + r.CreatedUserId = UserId ?? ""; + r.CreatedFullName = FullName ?? "System Administrator"; + r.LastUpdatedAt = DateTime.Now; + r.LastUpdateUserId = UserId ?? ""; + r.LastUpdateFullName = FullName ?? "System Administrator"; + + // education + r.Educations.Add(new DisableEducation() { - Address = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Address)]?.GetValue() ?? "", - Moo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo)]?.GetValue() ?? "", - Soi = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi)]?.GetValue() ?? "", - Road = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road)]?.GetValue() ?? "", - District = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District)]?.GetValue() ?? "", - Amphur = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur)]?.GetValue() ?? "", - Province = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Province)]?.GetValue() ?? "", - ZipCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode)]?.GetValue() ?? "", - Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Telephone)]?.GetValue() ?? "", - Mobile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Mobile)]?.GetValue() ?? "", - Address1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Address1)]?.GetValue() ?? "", - Moo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo1)]?.GetValue() ?? "", - Soi1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi1)]?.GetValue() ?? "", - Road1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road1)]?.GetValue() ?? "", - District1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District1)]?.GetValue() ?? "", - Amphur1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur1)]?.GetValue() ?? "", - Province1 = "", - ZipCode1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode1)]?.GetValue() ?? "", + Degree = workSheet?.Cells[row, 18]?.GetValue() ?? "", + Major = workSheet?.Cells[row, 19]?.GetValue() == "อื่น ๆ" ? workSheet?.Cells[row, 20]?.GetValue() ?? "" : workSheet?.Cells[row, 19]?.GetValue() ?? "", + MajorGroupId = workSheet?.Cells[row, 9999]?.GetValue() ?? "", + MajorGroupName = workSheet?.Cells[row, 9999]?.GetValue() ?? "", + University = workSheet?.Cells[row, 21]?.GetValue() == "อื่น ๆ" ? workSheet?.Cells[row, 22]?.GetValue() ?? "" : workSheet?.Cells[row, 21]?.GetValue() ?? "", + GPA = (double)workSheet?.Cells[row, 26]?.GetValue(), + Specialist = workSheet?.Cells[row, 9999]?.GetValue() ?? "", + HighDegree = workSheet?.Cells[row, 27]?.GetValue() ?? "", + BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 25]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 11]?.GetValue() ?? "", "dd/MM/yyyy") : DateTime.MinValue, CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", CreatedFullName = FullName ?? "System Administrator", LastUpdatedAt = DateTime.Now, LastUpdateUserId = UserId ?? "", - LastUpdateFullName = FullName ?? "System Administrator", - }); - - // payment - r.Payments.Add(new DisablePayment() - { - PaymentId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PaymentID)]?.GetValue() ?? "", - CompanyCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CompanyCode)]?.GetValue() ?? "", - TextFile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TextFile)]?.GetValue() ?? "", - BankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BankCode)]?.GetValue() ?? "", - AccountNumber = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.AccouontNumer)]?.GetValue() ?? "", - TransDate = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransDate)]?.GetValue() ?? "", - TransTime = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransTime)]?.GetValue() ?? "", - CustomerName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CustomerName)]?.GetValue() ?? "", - RefNo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.RefNo1)]?.GetValue() ?? "", - TermBranch = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TermBranch)]?.GetValue() ?? "", - TellerId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TellerID)]?.GetValue() ?? "", - CreditDebit = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CreditDebit)]?.GetValue() ?? "", - PaymentType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Type)]?.GetValue(), - ChequeNo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChequeNo)]?.GetValue() ?? "", - Amount = (decimal)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amount)]?.GetValue(), - ChqueBankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChqBankCode)]?.GetValue() ?? "", - CreatedAt = DateTime.Now, - CreatedUserId = UserId ?? "", - CreatedFullName = FullName ?? "System Administrator", - LastUpdatedAt = DateTime.Now, - LastUpdateUserId = UserId ?? "", - LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateFullName = FullName ?? "System Administrator" }); // occupation r.Occupations.Add(new DisableOccupation() { - Occupation = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Occupation)]?.GetValue() ?? "", - Position = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Position)]?.GetValue() ?? "", - Workplace = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Workplace)]?.GetValue() ?? "", - Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkplaceTelephone)]?.GetValue() ?? "", - WorkAge = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkAge)]?.GetValue() ?? "", + Occupation = workSheet?.Cells[row, 33]?.GetValue() == "อื่น ๆ" ? workSheet?.Cells[row, 34]?.GetValue() ?? "" : workSheet?.Cells[row, 33]?.GetValue() ?? "", + Position = workSheet?.Cells[row, 37]?.GetValue() ?? "", + Workplace = $"{(workSheet?.Cells[row, 36]?.GetValue() ?? "")} {(workSheet?.Cells[row, 35]?.GetValue() ?? "")}", + Telephone = workSheet?.Cells[row, 9999]?.GetValue() ?? "", + WorkAge = workSheet?.Cells[row, 9999]?.GetValue() ?? "", CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", CreatedFullName = FullName ?? "System Administrator", LastUpdatedAt = DateTime.Now, LastUpdateUserId = UserId ?? "", - LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateFullName = FullName ?? "System Administrator" + }); + + // address + r.Addresses.Add(new DisableAddress() + { + Address = $"{(workSheet?.Cells[row, 49]?.GetValue() ?? "")} {(workSheet?.Cells[row, 50]?.GetValue() ?? "")}", + Moo = workSheet?.Cells[row, 51]?.GetValue() ?? "", + Soi = workSheet?.Cells[row, 52]?.GetValue() ?? "", + Road = workSheet?.Cells[row, 53]?.GetValue() ?? "", + District = workSheet?.Cells[row, 54]?.GetValue() ?? "", + Amphur = workSheet?.Cells[row, 55]?.GetValue() ?? "", + Province = workSheet?.Cells[row, 56]?.GetValue() ?? "", + ZipCode = workSheet?.Cells[row, 57]?.GetValue() ?? "", + Telephone = workSheet?.Cells[row, 58]?.GetValue() ?? "", + Mobile = workSheet?.Cells[row, 9999]?.GetValue() ?? "", + Address1 = $"{(workSheet?.Cells[row, 61]?.GetValue() ?? "")} {(workSheet?.Cells[row, 62]?.GetValue() ?? "")}", + Moo1 = workSheet?.Cells[row, 63]?.GetValue() ?? "", + Soi1 = workSheet?.Cells[row, 64]?.GetValue() ?? "", + Road1 = workSheet?.Cells[row, 65]?.GetValue() ?? "", + District1 = workSheet?.Cells[row, 66]?.GetValue() ?? "", + Amphur1 = workSheet?.Cells[row, 67]?.GetValue() ?? "", + Province1 = workSheet?.Cells[row, 68]?.GetValue() ?? "", + ZipCode1 = workSheet?.Cells[row, 69]?.GetValue() ?? "", + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "System Administrator", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "System Administrator" + }); + + // payment + r.Payments.Add(new DisablePayment() + { + PaymentId = workSheet?.Cells[row, 104]?.GetValue() ?? "", + CompanyCode = workSheet?.Cells[row, 105]?.GetValue() ?? "", + TextFile = workSheet?.Cells[row, 106]?.GetValue() ?? "", + BankCode = workSheet?.Cells[row, 107]?.GetValue() ?? "", + AccountNumber = workSheet?.Cells[row, 108]?.GetValue() ?? "", + TransDate = workSheet?.Cells[row, 109]?.GetValue() ?? "", + TransTime = workSheet?.Cells[row, 110]?.GetValue() ?? "", + CustomerName = workSheet?.Cells[row, 111]?.GetValue() ?? "", + RefNo1 = workSheet?.Cells[row, 112]?.GetValue() ?? "", + TermBranch = workSheet?.Cells[row, 113]?.GetValue() ?? "", + TellerId = workSheet?.Cells[row, 114]?.GetValue() ?? "", + CreditDebit = workSheet?.Cells[row, 115]?.GetValue() ?? "", + PaymentType = workSheet?.Cells[row, 116]?.GetValue(), + ChequeNo = workSheet?.Cells[row, 117]?.GetValue() ?? "", + Amount = (decimal)workSheet?.Cells[row, 118]?.GetValue(), + ChqueBankCode = workSheet?.Cells[row, 119]?.GetValue() ?? "", + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "System Administrator", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "System Administrator" }); // certificate r.Certificates.Add(new DisableCertificate() { - CertificateNo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateNo)]?.GetValue() ?? "", - Description = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateDesc)]?.GetValue() ?? "", - IssueDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue, - ExpiredDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue, + CertificateNo = workSheet?.Cells[row, 9999]?.GetValue() ?? "", + Description = workSheet?.Cells[row, 9999]?.GetValue() ?? "", + IssueDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-")), + ExpiredDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue().ToDateTime(DateTimeFormat.Ymd, "-")), CreatedAt = DateTime.Now, CreatedUserId = UserId ?? "", CreatedFullName = FullName ?? "System Administrator", LastUpdatedAt = DateTime.Now, LastUpdateUserId = UserId ?? "", - LastUpdateFullName = FullName ?? "System Administrator", - }); - - r.Educations.Add(new DisableEducation() - { - Degree = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Degree)]?.GetValue() ?? "", - Major = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Major)]?.GetValue() ?? "", - MajorGroupId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupID)]?.GetValue() ?? "", - MajorGroupName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupName)]?.GetValue() ?? "", - University = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.University)]?.GetValue() ?? "", - GPA = (double)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.GPA)]?.GetValue(), - Specialist = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.SpecialList)]?.GetValue() ?? "", - HighDegree = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.HighDegree)]?.GetValue() ?? "", - BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue() ?? "", "yyyy-MM-dd") : DateTime.MinValue, - CreatedAt = DateTime.Now, - CreatedUserId = UserId ?? "", - CreatedFullName = FullName ?? "System Administrator", - LastUpdatedAt = DateTime.Now, - LastUpdateUserId = UserId ?? "", - LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateFullName = FullName ?? "System Administrator" }); r.PeriodExam = imported; - r.LastUpdatedAt = DateTime.Now; - r.LastUpdateUserId = UserId ?? ""; - r.LastUpdateFullName = FullName ?? "System Administrator"; _context.Disables.Add(r); //imported.Disables.Add(r); @@ -1304,8 +1440,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers #endregion #region " Score File " - + /// + /// นำเข้าผลคะแนนสอบคัดเลือกผู้พิการ (บัญชีรวมคะแนน) + /// + /// รหัสรอบการสอบคัดเลือกผู้พิการ + /// + /// เมื่อทำนำเข้าข้อมูลสำเร็จ + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("score/{id:length(36)}"), DisableRequestSizeLimit] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> ImportScoreFileAsync(Guid id) { var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_EXAM_SELECT"); @@ -1370,9 +1518,23 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { Year = rec_import.Year, ImportFile = doc, + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "System Administrator", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "System Administrator", Scores = new List() }; + // preload disables ทั้งหมดของครั้งเดียว และ Group ExamId เอาเฉพาะ key ที่ไม่ซ้ำ + var recruitsDict = await _context.Disables + .Where(x => x.PeriodExam.Id == rec_import.Id) + .GroupBy(x => x.ExamId) + .Where(g => g.Count() == 1) + .Select(g => g.First()) + .ToDictionaryAsync(x => x.ExamId, x => x); + // import datafile System.IO.File.WriteAllBytes(importFile, fileContent); @@ -1393,40 +1555,44 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers if (cell1 == "" || cell1 == null) break; var r = new DisableScore(); + + #region นำเข้าผลคะแนนสอบคัดเลือกผู้พิการ old + + ////r.ExamId = workSheet?.Cells[row, 2]?.GetValue(); + + ////r.FullA = (int)workSheet?.Cells[7, 7]?.GetValue().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger(); + ////r.SumA = workSheet?.Cells[row, 7]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 7]?.GetValue().Replace(".00", "").ToInteger(); + ////r.PercentageA = workSheet?.Cells[row, 8]?.GetValue() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 8]?.GetValue(); + ////r.AStatus = workSheet?.Cells[row, 9]?.GetValue(); + + ////r.FullB = (int)workSheet?.Cells[7, 12]?.GetValue().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger(); + ////r.SumB = workSheet?.Cells[row, 12]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 12]?.GetValue().Replace(".00", "").ToInteger(); + ////r.PercentageB = workSheet?.Cells[row, 13]?.GetValue() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 13]?.GetValue(); + ////r.BStatus = workSheet?.Cells[row, 14]?.GetValue(); + + ////r.SumAB = workSheet?.Cells[row, 15]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 15]?.GetValue().Replace(".00", "").ToInteger(); + ////r.ABStatus = workSheet?.Cells[row, 17]?.GetValue(); + + ////r.FullC = (int)workSheet?.Cells[7, 20]?.GetValue().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger(); + ////r.SumC = workSheet?.Cells[row, 20]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 20]?.GetValue().Replace(".00", "").ToInteger(); + ////r.PercentageC = workSheet?.Cells[row, 21]?.GetValue() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 21]?.GetValue(); + ////r.CStatus = workSheet?.Cells[row, 22]?.GetValue(); + + ////r.ExamStatus = workSheet?.Cells[row, 24]?.GetValue(); + ////r.Number = workSheet?.Cells[row, 25]?.GetValue() ?? ""; + ////r.Major = workSheet.Name; + + #endregion + r.ExamId = workSheet?.Cells[row, 2]?.GetValue(); - r.FullA = (int)workSheet?.Cells[7, 7]?.GetValue().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger(); - r.SumA = workSheet?.Cells[row, 7]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 7]?.GetValue().Replace(".00", "").ToInteger(); - r.PercentageA = workSheet?.Cells[row, 8]?.GetValue() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 8]?.GetValue(); - r.AStatus = workSheet?.Cells[row, 9]?.GetValue(); + //var recruit = await _context.Disables.AsQueryable() + // .Include(x => x.PeriodExam) + // .Where(x => x.PeriodExam == rec_import && x.ExamId == r.ExamId) + // .FirstOrDefaultAsync(); - r.FullB = (int)workSheet?.Cells[7, 12]?.GetValue().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger(); - r.SumB = workSheet?.Cells[row, 12]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 12]?.GetValue().Replace(".00", "").ToInteger(); - r.PercentageB = workSheet?.Cells[row, 13]?.GetValue() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 13]?.GetValue(); - r.BStatus = workSheet?.Cells[row, 14]?.GetValue(); - - r.SumAB = workSheet?.Cells[row, 15]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 15]?.GetValue().Replace(".00", "").ToInteger(); - r.ABStatus = workSheet?.Cells[row, 17]?.GetValue(); - - r.FullC = (int)workSheet?.Cells[7, 20]?.GetValue().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger(); - r.SumC = workSheet?.Cells[row, 20]?.GetValue() == "ขส." ? 0 : (int)workSheet?.Cells[row, 20]?.GetValue().Replace(".00", "").ToInteger(); - r.PercentageC = workSheet?.Cells[row, 21]?.GetValue() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 21]?.GetValue(); - r.CStatus = workSheet?.Cells[row, 22]?.GetValue(); - - r.ExamStatus = workSheet?.Cells[row, 24]?.GetValue(); - r.Number = workSheet?.Cells[row, 25]?.GetValue() ?? ""; - r.Major = workSheet.Name; - r.LastUpdatedAt = DateTime.Now; - r.LastUpdateUserId = UserId ?? ""; - r.LastUpdateFullName = FullName ?? "System Administrator"; - - imported.Scores.Add(r); - row++; - var recruit = await _context.Disables.AsQueryable() - .Include(x => x.PeriodExam) - .Where(x => x.PeriodExam == rec_import && x.ExamId == r.ExamId) - .FirstOrDefaultAsync(); - if (recruit != null) + // ใช้ dictionary lookup แทน query DB ทีละรอบ + if (!string.IsNullOrEmpty(r.ExamId) && recruitsDict.TryGetValue(r.ExamId, out var recruit)) { var apiUrl = $"{_configuration["API"]}/org/find/head/officer"; using (var client = new HttpClient()) @@ -1443,9 +1609,63 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers recruit.AuthPosition = org.result.position == null ? "" : org.result.position; } } + + r.CitizenId = workSheet?.Cells[row, 3]?.GetValue(); + + // ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง + r.FullA = 200; + r.SumA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 5].GetValue(), 2); + r.PercentageA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 6]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 6].GetValue(), 2); + r.AStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 7]?.GetValue()) ? "" : workSheet?.Cells[row, 7]?.GetValue(); + r.SumAB = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 5].GetValue(), 2); + r.ABStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 7]?.GetValue()) ? "" : workSheet?.Cells[row, 7]?.GetValue(); + + // ภาคความเหมาะสมกับตำแหน่ง + r.FullC = 50; + r.SumC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 8]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 8].GetValue(), 2); + r.FullD = 50; + r.SumD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 9]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 9].GetValue(), 2); + r.SumCD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 10]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 10].GetValue(), 2); + r.PercentageC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 11]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 11].GetValue(), 2); + r.CStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 12]?.GetValue()) ? "" : workSheet?.Cells[row, 12]?.GetValue(); + r.FullScore = 300; + r.TotalScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 13]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 13].GetValue(), 2); + + if (workSheet?.Cells[row, 7]?.GetValue() == "ขาดสอบ") + { + r.ExamStatus = "ขส."; + } + else if (workSheet?.Cells[row, 14]?.GetValue() == "ได้") + { + r.ExamStatus = "ผ่าน"; + } + else if (workSheet?.Cells[row, 14]?.GetValue() == "ตก") + { + r.ExamStatus = "ไม่ผ่าน"; + } + else + { + r.ExamStatus = "-"; + } + + r.RemarkScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 15]?.GetValue()) ? string.Empty : workSheet?.Cells[row, 15]?.GetValue(); + r.Major = workSheet.Name; + + r.CreatedAt = DateTime.Now; + r.CreatedUserId = UserId ?? ""; + r.CreatedFullName = FullName ?? "System Administrator"; + r.LastUpdatedAt = DateTime.Now; + r.LastUpdateUserId = UserId ?? ""; + r.LastUpdateFullName = FullName ?? "System Administrator"; + + imported.Scores.Add(r); + } - } - } + + row++; + + } // end of sheet loop + } // end of all file loop } // finally save to database @@ -1469,6 +1689,126 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers #endregion + #region " Result File " + /// + /// นำเข้าผลการสอบคัดเลือกผู้พิการ (ผลการสอบ) + /// + /// รหัสรอบการสอบคัดเลือกผู้พิการ + /// + /// เมื่อทำนำเข้าข้อมูลสำเร็จ + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("result/{id:length(36)}"), DisableRequestSizeLimit] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> ImportResultFileAsync(Guid id) + { + var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_EXAM_SELECT"); + var jsonData = JsonConvert.DeserializeObject(getPermission); + if (jsonData["status"]?.ToString() != "200") + { + return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden); + } + + try + { + if (Request.Form.Files == null || Request.Form.Files.Count == 0) + { + return Error(GlobalMessages.NoFileToUpload); + } + + var rec_import = await _context.PeriodExams.AsQueryable() + .Include(x => x.ScoreImport) + .ThenInclude(x => x.Scores) + .FirstOrDefaultAsync(x => x.Id == id); + + if (rec_import == null) + return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + + // update ฟิลด์ลำดับที่สอบได้และหมายเหตุจากลำดับที่สอบได้อันเก่าก่อน + if (rec_import.ScoreImport != null && rec_import.ScoreImport.Scores != null) + { + var _oldScores = rec_import.ScoreImport.Scores + .Where(x => !string.IsNullOrEmpty(x.Number)) + .ToList(); + if (_oldScores.Count > 0) + { + foreach (var x in _oldScores) + { + x.Number = string.Empty; + x.RemarkExamOrder = string.Empty; + } + await _context.SaveChangesAsync(); + } + } + + // create import history + rec_import.ImportHostories.Add(new DisableImportHistory + { + Description = "นำเข้าข้อมูลผลการสอบ", + CreatedAt = DateTime.Now, + CreatedUserId = UserId ?? "", + CreatedFullName = FullName ?? "System Administrator", + LastUpdatedAt = DateTime.Now, + LastUpdateUserId = UserId ?? "", + LastUpdateFullName = FullName ?? "System Administrator", + }); + + // preload score + var score = rec_import.ScoreImport.Scores + .Where(s => !string.IsNullOrEmpty(s.ExamId)) + .ToDictionary(s => s.ExamId, s => s); + + // ถ้าไม่มีผลคะแนนสอบคัดเลือกผู้พิการให้จบการทำงาน + if (score.Count == 0) return Success(); + + var file = Request.Form.Files[0]; + using (var stream = file.OpenReadStream()) + using (var c_package = new ExcelPackage(stream)) + { + foreach (var workSheet in c_package.Workbook.Worksheets) + { + var totalRows = workSheet.Dimension.Rows; + int row = 7; // เริ่มที่ row 7 ตามตัวอย่างไฟล์ + + while (row <= totalRows) + { + var examId = workSheet?.Cells[row, 2]?.GetValue(); + if (string.IsNullOrWhiteSpace(examId)) + { + row++; + continue; + } + + if (score.TryGetValue(examId, out var existingScore)) + { + existingScore.Number = workSheet?.Cells[row, 1]?.GetValue(); + existingScore.RemarkExamOrder = workSheet?.Cells[row, 4]?.GetValue() ?? string.Empty; + existingScore.LastUpdatedAt = DateTime.Now; + existingScore.LastUpdateUserId = UserId ?? ""; + existingScore.LastUpdateFullName = FullName ?? "System Administrator"; + } + + row++; + } + } + } + + await _context.SaveChangesAsync(); + return Success(); + + } + catch (Exception ex) + { + return Error(ex); + } + } + + #endregion + #region " Exam Information " /// @@ -1581,6 +1921,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers applyDate = dr["applydate"] == null ? "" : Convert.ToDateTime(dr["applydate"]).ToThaiShortDate(), university = dr["university"].ToString(), position_name = dr["position_name"].ToString(), + hddPosition = dr["hddPosition"].ToString(), + typeTest = dr["typeTest"].ToString(), position_level = dr["position_level"].ToString(), position_type = dr["position_type"].ToString(), exam_name = dr["exam_name"].ToString(), @@ -1667,12 +2009,22 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers ProfileID = p.CitizenId, p.Prefix, FullName = $"{p.FirstName} {p.LastName}", - DateOfBirth = p.DateOfBirth.ToThaiShortDate(), + DateOfBirth = p.DateOfBirth != null + ? p.DateOfBirth != DateTime.MinValue + ? p.DateOfBirth.ToThaiShortDate() + : "" + : "", Gender = p.Gendor, Degree = p.Educations.First().Degree, Major = p.Educations.First().Major, - CertificateNo = p.Certificates.First().CertificateNo, - CertificateIssueDate = p.Certificates.First().IssueDate.ToThaiShortDate(), + CertificateNo = p.Certificates.Count > 0 + ? p.Certificates.First().CertificateNo ?? "" + : "", + CertificateIssueDate = p.Certificates.Count > 0 + ? p.Certificates.First().IssueDate != DateTime.MinValue + ? p.Certificates.First().IssueDate.ToThaiShortDate() + : "" + : "", ExamResult = sr == null ? "" : sr.ExamStatus, ExamAttribute = _disableService.CheckValidCertificate(p.Certificates.First().IssueDate, 5) ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ", IsSpecial = p.Isspecial, @@ -1681,24 +2033,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers PositionName = p.PositionName, PositionType = p.PositionType, PositionLevel = p.PositionLevel, - ExamName = p.PeriodExam.Name, + ExamName = p.PeriodExam!.Name, ExamOrder = p.PeriodExam.Round, ExamYear = p.PeriodExam.Year == null ? 0 : p.PeriodExam.Year.Value.ToThaiYear(), - Score = sr == null ? 0 : sr.SumA + sr.SumB + sr.SumC, + Score = sr == null ? 0.0 : sr.TotalScore, Number = sr == null ? "" : sr.Number, - CitizenId = p.CitizenId, ExamCount = _disableService.GetExamCount(p.CitizenId), - ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.Value.AddYears(2).ToThaiShortDate(), + ScoreExpire = p.PeriodExam.AnnouncementDate == null + ? "" + : p.PeriodExam.AnnouncementDate != DateTime.MinValue + ? p.PeriodExam.AnnouncementDate.Value.AddYears(2).ToThaiShortDate() + : "", + typeTest = p.typeTest, ScoreResult = sr == null ? null : new { ScoreAFull = sr.FullA, ScoreA = sr.SumA, ScoreBFull = sr.FullB, ScoreB = sr.SumB, + ScoreAB = sr.SumAB, ScoreCFull = sr.FullC, ScoreC = sr.SumC, - ScoreSumFull = sr.FullA + sr.FullB + sr.FullC, - ScoreSum = sr.SumA + sr.SumB + sr.SumC, + ScoreDFull = sr.FullD, + ScoreD = sr.SumD, + ScoreCD = sr.SumCD, + ScoreSumFull = sr.FullScore, + ScoreSum = sr.TotalScore, ExamResult = sr.ExamStatus }, Attachments = p.Documents.Select(a => new @@ -1709,7 +2069,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers }) .FirstOrDefaultAsync(); - return Success(new { data, ExamCount = data == null || data.CitizenId == "" ? 0 : _disableService.GetExamCount(data.CitizenId) }); + return Success(data); } catch (Exception ex) { @@ -1872,8 +2232,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers ExamId = r.ExamId, CitizenId = r.CitizenId, Fullname = $"{r.Prefix}{r.FirstName} {r.LastName}", - Full = s.FullA + s.FullB + s.FullC, - Sum = s.SumA + s.SumB + s.SumC, + Full = s.FullScore != null ? s.FullScore : 0, + Sum = s.TotalScore != null ? s.TotalScore : 0, Status = s.ExamStatus, s.Number, r.PositionName, @@ -1924,6 +2284,85 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers #endregion + #region " Report " + + /// + /// ผลคะแนนผู้สมัครสอบ + /// + /// รหัสรอบการสอบคัดเลือกผู้พิการ + /// เลขประจำตัวสอบ + /// + /// เมื่อทำการอ่านข้อมูลจำนวนผู้สอบผ่านแข่งขันเพื่อบรรจุเข้ารับราชการเป็นข้าราชการ กทม. สามัญสำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("report/exam/{id:length(36)}/{examId}"), DisableRequestSizeLimit] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> GetReportExamResultByPersonAsync(Guid id, string examId) + { + try + { + var data = await _context.Disables.AsQueryable() + .Include(x => x.PeriodExam) + .Where(x => x.PeriodExam!.Id == id) + .Where(x => x.ExamId == examId) + .Join(_context.DisableScores.AsQueryable() + .Include(x => x.ScoreImport), + rc => new { rc.PeriodExam!.Id, rc.ExamId }, + sc => new { Id = sc.ScoreImport!.PeriodExamId, sc.ExamId }, + (p, sr) => new + { + ExamID = p.ExamId != null ? p.ExamId.ToThaiNumber() : "", + CitizenId = p.CitizenId != null ? p.CitizenId.ToThaiNumber() : "", + FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", + DateOfBirth = p.DateOfBirth != null + ? p.DateOfBirth != DateTime.MinValue + ? p.DateOfBirth.ToThaiShortDate().ToString().ToThaiNumber() + : "" + : "", + Gender = p.Gendor, + Degree = p.Educations.First().Degree, + Major = p.Educations.First().Major, + University = p.Educations.First().University, + PositionName = p.PositionName, + ExamName = $"{p.PeriodExam!.Name} ครั้งที่ {p.PeriodExam.Round}/{(p.PeriodExam.Year > 2500 ? p.PeriodExam.Year : (p.PeriodExam.Year+543))}".ToThaiNumber(), + + ExamCount = _disableService.GetExamCount(p.CitizenId).ToString().ToThaiNumber(), + type = p.typeTest == "bangkok" ? "กทม." : p.typeTest == "ocsc" ? "ก.พ." : "", + FA = sr.FullA != null ? sr.FullA.ToString().ToThaiNumber() : "", + SA = sr.SumA != null ? sr.SumA.ToString().ToThaiNumber() : "", + FC = sr.FullC != null ? sr.FullC.ToString().ToThaiNumber() : "", + SC = sr.SumC != null ? sr.SumC.ToString().ToThaiNumber() : "", + FD = sr.FullD != null ? sr.FullD.ToString().ToThaiNumber() : "", + SD = sr.SumD != null ? sr.SumD.ToString().ToThaiNumber() : "", + F = sr.FullScore != null ? sr.FullScore.ToString().ToThaiNumber() : "", + T = sr.TotalScore != null ? sr.TotalScore.ToString().ToThaiNumber() : "", + Result = sr.ExamStatus, + Number = sr.Number != null ? sr.Number.ToString().ToThaiNumber() : "", + Expire = p.PeriodExam.AnnouncementDate == null + ? "" + : p.PeriodExam.AnnouncementDate != DateTime.MinValue + ? p.PeriodExam.AnnouncementDate.Value.AddYears(2).ToThaiShortDate().ToString().ToThaiNumber() + : "", + }) + .FirstOrDefaultAsync(); + + var result = new + { + template = "recruit-exam", + reportName = "recruit-exam", + data = data + }; + return Success(result); + } + catch (Exception ex) + { + return Error(ex); + } + } + #endregion + #endregion } } \ No newline at end of file diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs index 895fa1f..5a1d98a 100644 --- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1067,6 +1067,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasMaxLength(20) .HasColumnType("varchar(20)"); + b.Property("HddPosition") + .HasColumnType("longtext") + .HasComment("บัญชีสอบ"); + b.Property("Isspecial") .IsRequired() .HasMaxLength(1) @@ -1151,6 +1155,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasMaxLength(200) .HasColumnType("varchar(200)"); + b.Property("typeTest") + .HasColumnType("longtext") + .HasComment("ประเภทการสอบภาค ก."); + b.HasKey("Id"); b.HasIndex("PeriodExamId"); @@ -1833,22 +1841,30 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("ABStatus") .IsRequired() .HasMaxLength(50) - .HasColumnType("varchar(50)"); + .HasColumnType("varchar(50)") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน"); b.Property("AStatus") .IsRequired() .HasMaxLength(50) - .HasColumnType("varchar(50)"); + .HasColumnType("varchar(50)") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน"); b.Property("BStatus") - .IsRequired() .HasMaxLength(50) .HasColumnType("varchar(50)"); b.Property("CStatus") .IsRequired() .HasMaxLength(50) - .HasColumnType("varchar(50)"); + .HasColumnType("varchar(50)") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน"); + + b.Property("CitizenId") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("เลขประจำตัวประชาชน"); b.Property("CreatedAt") .HasColumnType("datetime(6)") @@ -1872,21 +1888,33 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations b.Property("ExamId") .IsRequired() .HasMaxLength(50) - .HasColumnType("varchar(50)"); + .HasColumnType("varchar(50)") + .HasComment("เลขประจำตัวสอบ"); b.Property("ExamStatus") .IsRequired() .HasMaxLength(50) - .HasColumnType("varchar(50)"); + .HasColumnType("varchar(50)") + .HasComment("สอบได้ / ตก / ขาดสอบ"); b.Property("FullA") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม"); - b.Property("FullB") + b.Property("FullB") .HasColumnType("int"); b.Property("FullC") - .HasColumnType("int"); + .HasColumnType("int") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม"); + + b.Property("FullD") + .HasColumnType("int") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม"); + + b.Property("FullScore") + .HasColumnType("int") + .HasComment("คะแนนเต็ม"); b.Property("LastUpdateFullName") .IsRequired() @@ -1919,28 +1947,55 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations .HasComment("ลำดับที่สอบได้"); b.Property("PercentageA") - .HasColumnType("double"); + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ"); - b.Property("PercentageB") + b.Property("PercentageB") .HasColumnType("double"); b.Property("PercentageC") - .HasColumnType("double"); + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ"); + + b.Property("RemarkExamOrder") + .IsRequired() + .HasColumnType("longtext") + .HasComment("หมายเหตุจากลำดับที่สอบได้"); + + b.Property("RemarkScore") + .IsRequired() + .HasColumnType("longtext") + .HasComment("หมายเหตุจากบัญชีรวมคะแนน"); b.Property("ScoreImportId") .HasColumnType("char(36)"); - b.Property("SumA") - .HasColumnType("int"); + b.Property("SumA") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); - b.Property("SumAB") - .HasColumnType("int"); + b.Property("SumAB") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); - b.Property("SumB") - .HasColumnType("int"); + b.Property("SumB") + .HasColumnType("double"); - b.Property("SumC") - .HasColumnType("int"); + b.Property("SumC") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม"); + + b.Property("SumCD") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์"); + + b.Property("SumD") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม"); + + b.Property("TotalScore") + .HasColumnType("double") + .HasComment("คะแนนรวม"); b.HasKey("Id"); diff --git a/Migrations/20250905040454_add_fields_disable_and_disableScore.Designer.cs b/Migrations/20250905040454_add_fields_disable_and_disableScore.Designer.cs new file mode 100644 index 0000000..ef32d7d --- /dev/null +++ b/Migrations/20250905040454_add_fields_disable_and_disableScore.Designer.cs @@ -0,0 +1,3134 @@ +// +using System; +using BMA.EHR.Recurit.Exam.Service.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20250905040454_add_fields_disable_and_disableScore")] + partial class add_fields_disable_and_disableScore + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AccountName") + .HasColumnType("longtext") + .HasComment("ชื่อบัญชี"); + + b.Property("AccountNumber") + .HasColumnType("longtext") + .HasComment("เลขบัญชี"); + + b.Property("BankName") + .HasColumnType("longtext") + .HasComment("ธนาคาร"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("BankExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSAgencys"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("About") + .HasColumnType("longtext") + .HasComment("ข้อมูลเกี่ยวกับเรา"); + + b.Property("Address") + .HasColumnType("longtext") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("BannerImgId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .HasColumnType("longtext") + .HasComment("ข้อมูลเว็บโดยย่อ"); + + b.Property("DistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอ"); + + b.Property("DistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอ"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("LogoImgId") + .HasColumnType("char(36)"); + + b.Property("NameEn") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาอังกฤษ"); + + b.Property("NameTh") + .HasColumnType("longtext") + .HasComment("ชื่อเว็บภาษาไทย"); + + b.Property("ProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัด"); + + b.Property("ProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัด"); + + b.Property("ShortName") + .HasColumnType("longtext") + .HasComment("ชื่อย่อ"); + + b.Property("SubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบล"); + + b.Property("SubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบล"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("ZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์"); + + b.HasKey("Id"); + + b.HasIndex("BannerImgId"); + + b.HasIndex("LogoImgId"); + + b.ToTable("CMSCandidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CMSCandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Link") + .HasColumnType("longtext") + .HasComment("ลิงค์"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("ชื่อลิงค์"); + + b.HasKey("Id"); + + b.HasIndex("CMSCandidateId"); + + b.ToTable("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CitizenDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ออกบัตร"); + + b.Property("CitizenDistrictId") + .HasColumnType("char(36)") + .HasComment("Id เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenDistrictName") + .HasColumnType("longtext") + .HasComment("เขตที่ออกบัตรประชาชน"); + + b.Property("CitizenId") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("เลขประจำตัวประชาชน"); + + b.Property("CitizenProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่ออกบัตรประชาชน"); + + b.Property("CitizenProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่ออกบัตรประชาชน"); + + b.Property("ContactFirstname") + .HasColumnType("longtext") + .HasComment("ชื่อ บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactLastname") + .HasColumnType("longtext") + .HasComment("สกุล บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้า บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้า บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactRelations") + .HasColumnType("longtext") + .HasComment("เกี่ยวข้องเป็น บุคคลที่สามารถติดต่อได้"); + + b.Property("ContactTel") + .HasColumnType("longtext") + .HasComment("โทรศัพท์ บุคคลที่สามารถติดต่อได้"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("CurrentAddress") + .HasColumnType("longtext") + .HasComment("ที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอที่อยู่ปัจจุบัน"); + + b.Property("CurrentDistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอที่อยู่ปัจจุบัน"); + + b.Property("CurrentProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่อยู่ปัจจุบัน"); + + b.Property("CurrentProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่อยู่ปัจจุบัน"); + + b.Property("CurrentSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบลที่อยู่ปัจจุบัน"); + + b.Property("CurrentSubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบลที่อยู่ปัจจุบัน"); + + b.Property("CurrentZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน"); + + b.Property("DateOfBirth") + .HasMaxLength(40) + .HasColumnType("datetime(6)") + .HasComment("วันเกิด"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อีเมล"); + + b.Property("ExamIdenNumber") + .HasColumnType("longtext") + .HasComment("เลขประจำตัวสอบ"); + + b.Property("ExamReason") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.Property("FatherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงบิดา"); + + b.Property("FatherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลบิดา"); + + b.Property("FatherNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติบิดา"); + + b.Property("FatherOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพบิดา"); + + b.Property("FatherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อบิดา"); + + b.Property("FatherPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อบิดา"); + + b.Property("FirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(1) + .HasComment("ชื่อจริง"); + + b.Property("Knowledge") + .HasColumnType("longtext") + .HasComment("ความสามารถพิเศษ"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnOrder(2) + .HasComment("นามสกุล"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Marry") + .HasColumnType("tinyint(1)") + .HasComment("คู่สมรส"); + + b.Property("MarryFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงคู่สมรส"); + + b.Property("MarryLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลคู่สมรส"); + + b.Property("MarryNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติคู่สมรส"); + + b.Property("MarryOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพคู่สมรส"); + + b.Property("MarryPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อคู่สมรส"); + + b.Property("MarryPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อคู่สมรส"); + + b.Property("MobilePhone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์มือถือ"); + + b.Property("MotherFirstName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("ชื่อจริงมารดา"); + + b.Property("MotherLastName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("นามสกุลมารดา"); + + b.Property("MotherNationality") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasComment("สัญชาติมารดา"); + + b.Property("MotherOccupation") + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("อาชีพมารดา"); + + b.Property("MotherPrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อมารดา"); + + b.Property("MotherPrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อมารดา"); + + b.Property("Nationality") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(3) + .HasComment("สัญชาติ"); + + b.Property("Number") + .HasColumnType("longtext") + .HasComment("ลำดับที่สอบได้"); + + b.Property("OccupationGroup") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน กลุ่ม/ฝ่าย"); + + b.Property("OccupationOrg") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน ชื่อตำแหน่ง"); + + b.Property("OccupationPile") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน กอง"); + + b.Property("OccupationPosition") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน สังกัด"); + + b.Property("OccupationPositionType") + .HasColumnType("longtext") + .HasComment("ตำแหน่งปัจจุบัน ประเภทราชการ"); + + b.Property("OccupationSalary") + .HasColumnType("int") + .HasComment("ตำแหน่งปัจจุบัน เงินเดือน"); + + b.Property("OccupationTelephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน"); + + b.Property("Pass") + .HasColumnType("longtext") + .HasComment("ผลสมัครสอบ"); + + b.Property("PaymentDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่ชำระเงิน"); + + b.Property("PaymentImgId") + .HasColumnType("char(36)"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PointA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก"); + + b.Property("PointB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข"); + + b.Property("PointC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค"); + + b.Property("PointPath1A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความสามารถในการคิดวิเคราะห์"); + + b.Property("PointPath1C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค คทดสอบสมรรถนะหลัก"); + + b.Property("PointPath2A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ภาษาอังกฤษ"); + + b.Property("PointPath2C") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค สัมภาษณ์"); + + b.Property("PointPath3A") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก ความรู้และลักษณะการเป็นข้าราชการที่ดี"); + + b.Property("PointPerA") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ก เปอร์เซนต์"); + + b.Property("PointPerB") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ข เปอร์เซนต์"); + + b.Property("PointPerC") + .HasColumnType("longtext") + .HasComment("คะแนนภาค ค เปอร์เซนต์"); + + b.Property("PointTotalA") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ก"); + + b.Property("PointTotalB") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ข"); + + b.Property("PointTotalC") + .HasColumnType("longtext") + .HasComment("คะแนนเต็มภาค ค"); + + b.Property("PositionExamId") + .HasColumnType("char(36)"); + + b.Property("PrefixId") + .HasColumnType("char(36)") + .HasComment("Id คำนำหน้าชื่อ"); + + b.Property("PrefixName") + .HasColumnType("longtext") + .HasComment("คำนำหน้าชื่อ"); + + b.Property("ProfileImgId") + .HasColumnType("char(36)"); + + b.Property("RegistAddress") + .HasColumnType("longtext") + .HasComment("ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictId") + .HasColumnType("char(36)") + .HasComment("Id อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistDistrictName") + .HasColumnType("longtext") + .HasComment("อำเภอที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceId") + .HasColumnType("char(36)") + .HasComment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistProvinceName") + .HasColumnType("longtext") + .HasComment("จังหวัดที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSame") + .HasColumnType("tinyint(1)") + .HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictId") + .HasColumnType("char(36)") + .HasComment("Id ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistSubDistrictName") + .HasColumnType("longtext") + .HasComment("ตำบลที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegistZipCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)") + .HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน"); + + b.Property("RegisterDate") + .HasMaxLength(40) + .HasColumnType("datetime(6)") + .HasComment("วันที่สมัคร"); + + b.Property("RejectDetail") + .HasColumnType("longtext") + .HasComment("เหตุผลการไม่อนุมัติ"); + + b.Property("RelationshipId") + .HasColumnType("char(36)") + .HasComment("Id สถานภาพ"); + + b.Property("RelationshipName") + .HasColumnType("longtext") + .HasComment("สถานภาพ"); + + b.Property("ReligionId") + .HasColumnType("char(36)") + .HasComment("Id ศาสนา"); + + b.Property("ReligionName") + .HasColumnType("longtext") + .HasComment("ศาสนา"); + + b.Property("ResultA") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ก"); + + b.Property("ResultB") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ข"); + + b.Property("ResultC") + .HasColumnType("longtext") + .HasComment("ผลสอบภาค ค"); + + b.Property("Review") + .HasColumnType("longtext") + .HasComment("ข้อแนะนำ"); + + b.Property("ReviewPoint") + .HasColumnType("int") + .HasComment("คะแนนความพึงพอใจ"); + + b.Property("SeatNumber") + .HasColumnType("longtext") + .HasComment("เลขที่นั่งสอบ"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("สถานะผู้สมัคร"); + + b.Property("Telephone") + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasComment("โทรศัพท์"); + + b.Property("UserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasComment("User Id ผู้สมัคร"); + + b.HasKey("Id"); + + b.HasIndex("PaymentImgId"); + + b.HasIndex("PeriodExamId"); + + b.HasIndex("PositionExamId"); + + b.HasIndex("ProfileImgId"); + + b.ToTable("Candidates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.HasIndex("DocumentId"); + + b.ToTable("CandidateDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DurationEnd") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("ระยะเวลาสิ้นสุด"); + + b.Property("DurationStart") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("ระยะเวลาเริ่ม"); + + b.Property("Group") + .HasColumnType("longtext") + .HasColumnOrder(4) + .HasComment("กลุ่ม/ฝ่าย"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Org") + .HasColumnType("longtext") + .HasColumnOrder(6) + .HasComment("สังกัด"); + + b.Property("Pile") + .HasColumnType("longtext") + .HasColumnOrder(5) + .HasComment("กอง"); + + b.Property("Position") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(3) + .HasComment("ชื่อตำแหน่ง"); + + b.Property("RangeDate") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(7) + .HasComment("ระยะเวลา"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(8) + .HasComment("ประเภท"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.ToTable("Careers"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ApplyDate") + .HasColumnType("datetime(6)"); + + b.Property("AuthName") + .HasColumnType("longtext"); + + b.Property("AuthPosition") + .HasColumnType("longtext"); + + b.Property("CitizenCardExpireDate") + .HasColumnType("datetime(6)"); + + b.Property("CitizenCardIssuer") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CitizenId") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("เลขประจำตัวประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DateOfBirth") + .HasColumnType("datetime(6)"); + + b.Property("ExamId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.Property("Gendor") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("HddPosition") + .HasColumnType("longtext") + .HasComment("บัญชีสอบ"); + + b.Property("Isspecial") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("varchar(1)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Marry") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("ModifiedDate") + .HasColumnType("datetime(6)"); + + b.Property("National") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PositionLevel") + .HasColumnType("longtext"); + + b.Property("PositionName") + .HasColumnType("longtext"); + + b.Property("PositionType") + .HasColumnType("longtext"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Qualified") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("varchar(1)"); + + b.Property("Race") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefNo") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Religion") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Remark") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("typeTest") + .HasColumnType("longtext") + .HasComment("ประเภทการสอบภาค ก."); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("Disables"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Address") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Address1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Amphur") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Amphur1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("District") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("District1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Mobile") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Moo") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Moo1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Province1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Road") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Road1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Soi") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Soi1") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Telephone") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ZipCode") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.Property("ZipCode1") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableAddresses"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableCertificate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CertificateNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("ExpiredDate") + .HasColumnType("datetime(6)"); + + b.Property("IssueDate") + .HasColumnType("datetime(6)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableCertificates"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("DocumentFileId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.HasIndex("DocumentFileId"); + + b.ToTable("DisableDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableEducation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("BachelorDate") + .HasColumnType("datetime(6)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Degree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("GPA") + .HasColumnType("double"); + + b.Property("HighDegree") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Major") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("MajorGroupId") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("MajorGroupName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Specialist") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("University") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableEducations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableImportHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext") + .HasColumnOrder(1) + .HasComment("รายละเอียดการนำเข้า"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("DisableImportHistories"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableOccupation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Occupation") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Position") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Telephone") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("WorkAge") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Workplace") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisableOccupations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisablePayment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AccountNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("BankCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ChequeNo") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ChqueBankCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CompanyCode") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("CreditDebit") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CustomerName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DisableId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PaymentId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PaymentType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("RefNo1") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TellerId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TermBranch") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TextFile") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TransDate") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("TransTime") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("DisableId"); + + b.ToTable("DisablePayments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableScore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("ABStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน"); + + b.Property("AStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน"); + + b.Property("BStatus") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน"); + + b.Property("CitizenId") + .IsRequired() + .HasMaxLength(13) + .HasColumnType("varchar(13)") + .HasComment("เลขประจำตัวประชาชน"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("ExamId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("เลขประจำตัวสอบ"); + + b.Property("ExamStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasComment("สอบได้ / ตก / ขาดสอบ"); + + b.Property("FullA") + .HasColumnType("int") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม"); + + b.Property("FullB") + .HasColumnType("int"); + + b.Property("FullC") + .HasColumnType("int") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม"); + + b.Property("FullD") + .HasColumnType("int") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม"); + + b.Property("FullScore") + .HasColumnType("int") + .HasComment("คะแนนเต็ม"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Major") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasComment("ลำดับที่สอบได้"); + + b.Property("PercentageA") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ"); + + b.Property("PercentageB") + .HasColumnType("double"); + + b.Property("PercentageC") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ"); + + b.Property("RemarkExamOrder") + .IsRequired() + .HasColumnType("longtext") + .HasComment("หมายเหตุจากลำดับที่สอบได้"); + + b.Property("RemarkScore") + .IsRequired() + .HasColumnType("longtext") + .HasComment("หมายเหตุจากบัญชีรวมคะแนน"); + + b.Property("ScoreImportId") + .HasColumnType("char(36)"); + + b.Property("SumA") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); + + b.Property("SumAB") + .HasColumnType("double") + .HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); + + b.Property("SumB") + .HasColumnType("double"); + + b.Property("SumC") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม"); + + b.Property("SumCD") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์"); + + b.Property("SumD") + .HasColumnType("double") + .HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม"); + + b.Property("TotalScore") + .HasColumnType("double") + .HasComment("คะแนนรวม"); + + b.HasKey("Id"); + + b.HasIndex("ScoreImportId"); + + b.ToTable("DisableScores"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("ImportFileId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.HasIndex("PeriodExamId") + .IsUnique(); + + b.ToTable("ScoreImports"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("text"); + + b.Property("FileName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("FileSize") + .HasColumnType("int"); + + b.Property("FileType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ObjectRefId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("Documents"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CandidateId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("EducationEndDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สำเร็จการศึกษา"); + + b.Property("EducationLevelExamId") + .HasColumnType("char(36)") + .HasComment("Id วุฒิที่ใช้สมัครสอบ"); + + b.Property("EducationLevelExamName") + .HasColumnType("longtext") + .HasComment("วุฒิที่ใช้สมัครสอบ"); + + b.Property("EducationLevelHighId") + .HasColumnType("char(36)") + .HasComment("Id วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLevelHighName") + .HasColumnType("longtext") + .HasComment("วุฒิการศึกษาสูงสุด"); + + b.Property("EducationLocation") + .HasColumnType("longtext") + .HasComment("ชื่อสถานศึกษา"); + + b.Property("EducationMajor") + .HasColumnType("longtext") + .HasComment("สาขาวิชา/วิชาเอก"); + + b.Property("EducationName") + .HasColumnType("longtext") + .HasComment("ชื่อปริญญา"); + + b.Property("EducationScores") + .HasColumnType("longtext") + .HasComment("คะแนนเฉลี่ยสะสม"); + + b.Property("EducationType") + .HasColumnType("longtext") + .HasComment("ประเภทสถานศึกษา"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.HasKey("Id"); + + b.HasIndex("CandidateId"); + + b.ToTable("Educations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("AnnouncementDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(5) + .HasComment("วันประกาศผลสอบ"); + + b.Property("AnnouncementEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(7) + .HasComment("วันสิ้นสุดประกาศ"); + + b.Property("AnnouncementExam") + .HasColumnType("tinyint(1)") + .HasComment("ประกาศนี้มีสมัครสอบคัดเลือก"); + + b.Property("AnnouncementStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(6) + .HasComment("วันเริ่มประกาศ"); + + b.Property("Category") + .HasColumnType("longtext") + .HasComment("สำนัก"); + + b.Property("CheckDisability") + .HasColumnType("tinyint(1)") + .HasComment("คนพิการ"); + + b.Property("CheckDocument") + .HasColumnType("tinyint(1)") + .HasComment("ตรวจสอบเอกสารหลังประกาศผลสอบ"); + + b.Property("CompanyCode") + .HasColumnType("longtext") + .HasComment("Company code"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("Detail") + .HasColumnType("longtext") + .HasComment("รายละเอียดสมัครสอบ"); + + b.Property("EditorCondition") + .HasColumnType("longtext") + .HasComment("รายละเอียดเงื่อนไขการสมัคร"); + + b.Property("EditorConfirm") + .HasColumnType("longtext") + .HasComment("รายละเอียดคำรับรอง"); + + b.Property("ExamDate") + .HasColumnType("datetime(6)") + .HasComment("วันที่สอบ"); + + b.Property("Fee") + .HasColumnType("float") + .HasComment("ค่าธรรมเนียม"); + + b.Property("ImportFileId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasComment("สถานะการใช้งาน"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("varchar(150)") + .HasColumnOrder(8) + .HasComment("ชื่อการสอบ"); + + b.Property("Note") + .HasColumnType("longtext") + .HasComment("หมายเหตุ"); + + b.Property("OrganizationCodeId") + .HasColumnType("char(36)") + .HasComment("Id รหัสส่วนราชการ"); + + b.Property("OrganizationCodeName") + .HasColumnType("longtext") + .HasComment("ชื่อรหัสส่วนราชการ"); + + b.Property("OrganizationId") + .HasColumnType("char(36)") + .HasComment("Id หน่วยงาน"); + + b.Property("OrganizationName") + .HasColumnType("longtext") + .HasComment("ชื่อหน่วยงาน"); + + b.Property("PaymentEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(4) + .HasComment("วันสิ้นสุดชำระเงิน"); + + b.Property("PaymentKrungThai") + .HasColumnType("longtext") + .HasComment("ชำระเงินผ่านกรุงไทย"); + + b.Property("PaymentStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(3) + .HasComment("วันเริ่มชำระเงิน"); + + b.Property("Reason") + .HasColumnType("text") + .HasComment("หมายเหตุ"); + + b.Property("RefNo1") + .HasColumnType("longtext") + .HasComment("Ref No1"); + + b.Property("RegisterEndDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(2) + .HasComment("วันสิ้นสุดสมัครสอบ"); + + b.Property("RegisterStartDate") + .HasColumnType("datetime(6)") + .HasColumnOrder(1) + .HasComment("วันเริ่มสมัครสอบ"); + + b.Property("Remark") + .HasColumnType("text") + .HasComment("remark"); + + b.Property("Round") + .HasColumnType("int") + .HasColumnOrder(9) + .HasComment("รอบการสอบ"); + + b.Property("SetSeat") + .HasColumnType("tinyint(1)") + .HasComment("เช็คอัพคะแนน"); + + b.Property("Year") + .HasColumnType("int") + .HasComment("ปีงบประมาณ"); + + b.HasKey("Id"); + + b.HasIndex("ImportFileId"); + + b.ToTable("PeriodExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamBarCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamBarCodes"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamDocuments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamImages"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamQrCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PeriodExamQrCodes"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasColumnOrder(0) + .HasComment("PrimaryKey") + .HasAnnotation("Relational:JsonPropertyName", "id"); + + b.Property("Code") + .HasColumnType("longtext") + .HasComment("รหัสประจำตำแหน่งที่สอบ"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(100) + .HasComment("สร้างข้อมูลเมื่อ"); + + b.Property("CreatedFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(104) + .HasComment("ชื่อ User ที่สร้างข้อมูล"); + + b.Property("CreatedUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(101) + .HasComment("User Id ที่สร้างข้อมูล"); + + b.Property("HighDegree") + .HasColumnType("tinyint(1)") + .HasComment("ปริญญาบัตรขึ้นไป"); + + b.Property("LastUpdateFullName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)") + .HasColumnOrder(105) + .HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdateUserId") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnOrder(103) + .HasComment("User Id ที่แก้ไขข้อมูลล่าสุด"); + + b.Property("LastUpdatedAt") + .HasColumnType("datetime(6)") + .HasColumnOrder(102) + .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); + + b.Property("PeriodExamId") + .HasColumnType("char(36)"); + + b.Property("PositionId") + .HasColumnType("char(36)") + .HasComment("Id ตำแหน่ง"); + + b.Property("PositionLevelId") + .HasColumnType("char(36)") + .HasComment("Id ระดับ"); + + b.Property("PositionLevelName") + .HasColumnType("longtext") + .HasComment("ชื่อระดับ"); + + b.Property("PositionName") + .HasColumnType("longtext") + .HasComment("ชื่อตำแหน่ง"); + + b.Property("TypeId") + .HasColumnType("longtext") + .HasComment("Id ประเภทแบบฟอร์ม"); + + b.Property("TypeName") + .HasColumnType("longtext") + .HasComment("ชื่อประเภทแบบฟอร์ม"); + + b.HasKey("Id"); + + b.HasIndex("PeriodExamId"); + + b.ToTable("PositionExams"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("BankExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSAgency", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSAgencys") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "BannerImg") + .WithMany() + .HasForeignKey("BannerImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "LogoImg") + .WithMany() + .HasForeignKey("LogoImgId"); + + b.Navigation("BannerImg"); + + b.Navigation("LogoImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", "CMSCandidate") + .WithMany("CMSGovernments") + .HasForeignKey("CMSCandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CMSCandidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "PaymentImg") + .WithMany() + .HasForeignKey("PaymentImgId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("Candidate") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", "PositionExam") + .WithMany() + .HasForeignKey("PositionExamId"); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ProfileImg") + .WithMany() + .HasForeignKey("ProfileImgId"); + + b.Navigation("PaymentImg"); + + b.Navigation("PeriodExam"); + + b.Navigation("PositionExam"); + + b.Navigation("ProfileImg"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany() + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + + b.Navigation("Document"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany("Careers") + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("Disables") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableAddress", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Addresses") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableCertificate", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Certificates") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Documents") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "DocumentFile") + .WithMany() + .HasForeignKey("DocumentFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + + b.Navigation("DocumentFile"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableEducation", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Educations") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableImportHistory", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("ImportHostories") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableOccupation", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Occupations") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisablePayment", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", "Disable") + .WithMany("Payments") + .HasForeignKey("DisableId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Disable"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.DisableScore", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", "ScoreImport") + .WithMany("Scores") + .HasForeignKey("ScoreImportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ScoreImport"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithOne("ScoreImport") + .HasForeignKey("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", "PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ImportFile"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate") + .WithMany("Educations") + .HasForeignKey("CandidateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Candidate"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ImportFile") + .WithMany() + .HasForeignKey("ImportFileId"); + + b.Navigation("ImportFile"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamBarCode", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamBarCodes") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamDocuments") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamImage", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamImages") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamQrCode", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PeriodExamQrCodes") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b => + { + b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam") + .WithMany("PositionExam") + .HasForeignKey("PeriodExamId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PeriodExam"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b => + { + b.Navigation("CMSAgencys"); + + b.Navigation("CMSGovernments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b => + { + b.Navigation("Careers"); + + b.Navigation("Educations"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.Disable", b => + { + b.Navigation("Addresses"); + + b.Navigation("Certificates"); + + b.Navigation("Documents"); + + b.Navigation("Educations"); + + b.Navigation("Occupations"); + + b.Navigation("Payments"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Disables.ScoreImport", b => + { + b.Navigation("Scores"); + }); + + modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b => + { + b.Navigation("BankExam"); + + b.Navigation("Candidate"); + + b.Navigation("Disables"); + + b.Navigation("ImportHostories"); + + b.Navigation("PeriodExamBarCodes"); + + b.Navigation("PeriodExamDocuments"); + + b.Navigation("PeriodExamImages"); + + b.Navigation("PeriodExamQrCodes"); + + b.Navigation("PositionExam"); + + b.Navigation("ScoreImport"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20250905040454_add_fields_disable_and_disableScore.cs b/Migrations/20250905040454_add_fields_disable_and_disableScore.cs new file mode 100644 index 0000000..ec77ee7 --- /dev/null +++ b/Migrations/20250905040454_add_fields_disable_and_disableScore.cs @@ -0,0 +1,482 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BMA.EHR.Recurit.Exam.Service.Migrations +{ + /// + public partial class add_fields_disable_and_disableScore : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "SumC", + table: "DisableScores", + type: "double", + nullable: false, + comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "SumB", + table: "DisableScores", + type: "double", + nullable: true, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "SumAB", + table: "DisableScores", + type: "double", + nullable: false, + comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "SumA", + table: "DisableScores", + type: "double", + nullable: false, + comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "PercentageC", + table: "DisableScores", + type: "double", + nullable: false, + comment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ", + oldClrType: typeof(double), + oldType: "double"); + + migrationBuilder.AlterColumn( + name: "PercentageB", + table: "DisableScores", + type: "double", + nullable: true, + oldClrType: typeof(double), + oldType: "double"); + + migrationBuilder.AlterColumn( + name: "PercentageA", + table: "DisableScores", + type: "double", + nullable: false, + comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ", + oldClrType: typeof(double), + oldType: "double"); + + migrationBuilder.AlterColumn( + name: "FullC", + table: "DisableScores", + type: "int", + nullable: false, + comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "FullB", + table: "DisableScores", + type: "int", + nullable: true, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "FullA", + table: "DisableScores", + type: "int", + nullable: false, + comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม", + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "ExamStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + comment: "สอบได้ / ตก / ขาดสอบ", + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExamId", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + comment: "เลขประจำตัวสอบ", + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "CStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + comment: "ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน", + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "BStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "AStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน", + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ABStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน", + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "CitizenId", + table: "DisableScores", + type: "varchar(13)", + maxLength: 13, + nullable: false, + defaultValue: "", + comment: "เลขประจำตัวประชาชน") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "FullD", + table: "DisableScores", + type: "int", + nullable: false, + defaultValue: 0, + comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม"); + + migrationBuilder.AddColumn( + name: "FullScore", + table: "DisableScores", + type: "int", + nullable: false, + defaultValue: 0, + comment: "คะแนนเต็ม"); + + migrationBuilder.AddColumn( + name: "RemarkExamOrder", + table: "DisableScores", + type: "longtext", + nullable: false, + comment: "หมายเหตุจากลำดับที่สอบได้") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "RemarkScore", + table: "DisableScores", + type: "longtext", + nullable: false, + comment: "หมายเหตุจากบัญชีรวมคะแนน") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "SumCD", + table: "DisableScores", + type: "double", + nullable: false, + defaultValue: 0.0, + comment: "ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์"); + + migrationBuilder.AddColumn( + name: "SumD", + table: "DisableScores", + type: "double", + nullable: false, + defaultValue: 0.0, + comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม"); + + migrationBuilder.AddColumn( + name: "TotalScore", + table: "DisableScores", + type: "double", + nullable: false, + defaultValue: 0.0, + comment: "คะแนนรวม"); + + migrationBuilder.AddColumn( + name: "HddPosition", + table: "Disables", + type: "longtext", + nullable: true, + comment: "บัญชีสอบ") + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AddColumn( + name: "typeTest", + table: "Disables", + type: "longtext", + nullable: true, + comment: "ประเภทการสอบภาค ก.") + .Annotation("MySql:CharSet", "utf8mb4"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "CitizenId", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "FullD", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "FullScore", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "RemarkExamOrder", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "RemarkScore", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "SumCD", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "SumD", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "TotalScore", + table: "DisableScores"); + + migrationBuilder.DropColumn( + name: "HddPosition", + table: "Disables"); + + migrationBuilder.DropColumn( + name: "typeTest", + table: "Disables"); + + migrationBuilder.AlterColumn( + name: "SumC", + table: "DisableScores", + type: "int", + nullable: false, + oldClrType: typeof(double), + oldType: "double", + oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม"); + + migrationBuilder.AlterColumn( + name: "SumB", + table: "DisableScores", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(double), + oldType: "double", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "SumAB", + table: "DisableScores", + type: "int", + nullable: false, + oldClrType: typeof(double), + oldType: "double", + oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); + + migrationBuilder.AlterColumn( + name: "SumA", + table: "DisableScores", + type: "int", + nullable: false, + oldClrType: typeof(double), + oldType: "double", + oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม"); + + migrationBuilder.AlterColumn( + name: "PercentageC", + table: "DisableScores", + type: "double", + nullable: false, + oldClrType: typeof(double), + oldType: "double", + oldComment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ"); + + migrationBuilder.AlterColumn( + name: "PercentageB", + table: "DisableScores", + type: "double", + nullable: false, + defaultValue: 0.0, + oldClrType: typeof(double), + oldType: "double", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PercentageA", + table: "DisableScores", + type: "double", + nullable: false, + oldClrType: typeof(double), + oldType: "double", + oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ"); + + migrationBuilder.AlterColumn( + name: "FullC", + table: "DisableScores", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม"); + + migrationBuilder.AlterColumn( + name: "FullB", + table: "DisableScores", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "FullA", + table: "DisableScores", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int", + oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม"); + + migrationBuilder.AlterColumn( + name: "ExamStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50, + oldComment: "สอบได้ / ตก / ขาดสอบ") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ExamId", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50, + oldComment: "เลขประจำตัวสอบ") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "CStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50, + oldComment: "ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.UpdateData( + table: "DisableScores", + keyColumn: "BStatus", + keyValue: null, + column: "BStatus", + value: ""); + + migrationBuilder.AlterColumn( + name: "BStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "AStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50, + oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ABStatus", + table: "DisableScores", + type: "varchar(50)", + maxLength: 50, + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(50)", + oldMaxLength: 50, + oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/Models/Disable/Disable.cs b/Models/Disable/Disable.cs index 94ee9bd..4ee99bb 100644 --- a/Models/Disable/Disable.cs +++ b/Models/Disable/Disable.cs @@ -82,5 +82,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables public string? PositionLevel { get; set; } public string? AuthName { get; set; } public string? AuthPosition { get; set; } + + [Comment("บัญชีสอบ")] + public string? HddPosition { get; set; } = string.Empty; + + [Comment("ประเภทการสอบภาค ก.")] + public string? typeTest { get; set; } = string.Empty; + } } diff --git a/Models/Disable/DisableScore.cs b/Models/Disable/DisableScore.cs index 1e081fc..cf8a4f8 100644 --- a/Models/Disable/DisableScore.cs +++ b/Models/Disable/DisableScore.cs @@ -5,42 +5,64 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables { public class DisableScore : EntityBase { - [Required, MaxLength(50)] + [Required, MaxLength(50), Comment("เลขประจำตัวสอบ")] public string ExamId { get; set; } - public int SumA { get; set; } + [Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม")] + public double SumA { get; set; } + [Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม")] public int FullA { get; set; } + [Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ")] public double PercentageA { get; set; } - [MaxLength(50)] + [MaxLength(50), Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")] public string AStatus { get; set; } - public int SumB { get; set; } + public double? SumB { get; set; } - public int FullB { get; set; } + public int? FullB { get; set; } - public double PercentageB { get; set; } + public double? PercentageB { get; set; } [MaxLength(50)] - public string BStatus { get; set; } + public string? BStatus { get; set; } - public int SumAB { get; set; } + [Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม")] + public double SumAB { get; set; } - [Required, MaxLength(50)] + [Required, MaxLength(50), Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")] public string ABStatus { get; set; } - public int SumC { get; set; } + [Comment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม")] + public double SumC { get; set; } + [Comment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม")] public int FullC { get; set; } + [Comment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ")] public double PercentageC { get; set; } - [MaxLength(50)] + [MaxLength(50), Comment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน")] public string CStatus { get; set; } - [Required, MaxLength(50)] + [Comment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม")] + public double SumD { get; set; } + + [Comment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม")] + public int FullD { get; set; } + + [Comment("ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์")] + public double SumCD { get; set; } + + [Comment("คะแนนรวม")] + public double TotalScore { get; set; } + + [Comment("คะแนนเต็ม")] + public int FullScore { get; set; } + + [Required, MaxLength(50), Comment("สอบได้ / ตก / ขาดสอบ")] public string ExamStatus { get; set; } [MaxLength(200)] @@ -49,6 +71,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables [MaxLength(200), Comment("ลำดับที่สอบได้")] public string Number { get; set; } = string.Empty; + [MaxLength(13), Comment("เลขประจำตัวประชาชน")] + public string CitizenId { get; set; } = string.Empty; + + [Comment("หมายเหตุจากบัญชีรวมคะแนน")] + public string RemarkScore { get; set; } = string.Empty; + + [Comment("หมายเหตุจากลำดับที่สอบได้")] + public string RemarkExamOrder { get; set; } = string.Empty; + public ScoreImport ScoreImport { get; set; } } } diff --git a/Services/DisableService.cs b/Services/DisableService.cs index 2b99e0d..2a54077 100644 --- a/Services/DisableService.cs +++ b/Services/DisableService.cs @@ -67,10 +67,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services public DateTime CheckDateTime(string Date, string Formate) { // ตอนนี้ทำไว้ให้รองรับแค่ "dd/MM/yyyy", "yyyy-MM-dd" + Date = Date.Trim(); if (string.IsNullOrWhiteSpace(Date)) return DateTime.MinValue; + // จะเข้าเฉพาะกรณีที่ string เป็นตัวเลข เช่น "35635", "44561.5" + if (double.TryParse(Date, out double oaDate)) + { + try + { + Date = DateTime.FromOADate(oaDate).ToString(Formate); + } + catch + { + Date = DateTime.MinValue.ToString(Formate); + } + } + string[] parts = Date.Trim().Replace("-", "/").Split("/"); if (parts.Length != 3)