migrate + ปรับ API ระบบสอบคัดเลือกผู้พิการ
This commit is contained in:
parent
38ed06ece6
commit
5a94c3b67a
7 changed files with 4343 additions and 181 deletions
|
|
@ -660,6 +660,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
.ThenInclude(x => x.Scores)
|
.ThenInclude(x => x.Scores)
|
||||||
.OrderByDescending(x => x.Year)
|
.OrderByDescending(x => x.Year)
|
||||||
.ThenByDescending(x => x.Round)
|
.ThenByDescending(x => x.Round)
|
||||||
|
.ThenByDescending(x => x.LastUpdatedAt)
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.Id,
|
x.Id,
|
||||||
|
|
@ -668,14 +669,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
x.Round,
|
x.Round,
|
||||||
ImportDate = x.CreatedAt.Date.ToThaiShortDate(),
|
ImportDate = x.CreatedAt.Date.ToThaiShortDate(),
|
||||||
ExamCount = x.Disables.Count(),
|
ExamCount = x.Disables.Count(),
|
||||||
Score = x.ScoreImport == null ? null :
|
Score = x.ScoreImport == null || x.ScoreImport.Scores.Count == 0 ? null :
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
ID = x.ScoreImport.Id,
|
ID = x.ScoreImport.Id,
|
||||||
ImportYear = x.ScoreImport.Year,
|
ImportYear = x.ScoreImport.Year,
|
||||||
ImportDate = x.CreatedAt.Date.ToThaiShortDate(),
|
ImportDate = x.CreatedAt.Date.ToThaiShortDate(),
|
||||||
ScoreCount = x.ScoreImport.Scores.Count(),
|
ScoreCount = x.ScoreImport.Scores.Count(),
|
||||||
|
ResultCount = x.ScoreImport.Scores.Count(x => !string.IsNullOrEmpty(x.Number))
|
||||||
},
|
},
|
||||||
x.CreatedUserId,
|
x.CreatedUserId,
|
||||||
})
|
})
|
||||||
|
|
@ -1040,7 +1041,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// นำเข้ารายชื่อผู้สมัครสอบคัดเลือกผู้พิการ
|
/// นำเข้ารายชื่อผู้สมัครสอบคัดเลือกผู้พิการ (ข้อมูลผู้สมัครสอบ)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">รหัสรอบการสอบคัดเลือกผู้พิการ</param>
|
/// <param name="id">รหัสรอบการสอบคัดเลือกผู้พิการ</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
@ -1142,137 +1143,272 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||||
if (cell1 == "" || cell1 == null) break;
|
if (cell1 == "" || cell1 == null) break;
|
||||||
|
|
||||||
var r = new Recurit.Exam.Service.Models.Disables.Disable();
|
# region old
|
||||||
r.ExamId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ExamID)]?.GetValue<string>();
|
////var r = new Recurit.Exam.Service.Models.Disables.Disable();
|
||||||
r.CitizenId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalID)]?.GetValue<string>();
|
////r.ExamId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ExamID)]?.GetValue<string>();
|
||||||
r.Prefix = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Prefix)]?.GetValue<string>();
|
////r.CitizenId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalID)]?.GetValue<string>();
|
||||||
r.FirstName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.FirstName)]?.GetValue<string>();
|
////r.Prefix = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Prefix)]?.GetValue<string>();
|
||||||
r.LastName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.LastName)]?.GetValue<string>();
|
////r.FirstName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.FirstName)]?.GetValue<string>();
|
||||||
r.Gendor = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Gender)]?.GetValue<string>();
|
////r.LastName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.LastName)]?.GetValue<string>();
|
||||||
r.National = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.National)]?.GetValue<string>().IsNull("");
|
////r.Gendor = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Gender)]?.GetValue<string>();
|
||||||
r.Race = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Race)]?.GetValue<string>().IsNull("");
|
////r.National = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.National)]?.GetValue<string>().IsNull("");
|
||||||
r.Religion = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Religion)]?.GetValue<string>().IsNull("");
|
////r.Race = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Race)]?.GetValue<string>().IsNull("");
|
||||||
//r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));k
|
////r.Religion = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Religion)]?.GetValue<string>().IsNull("");
|
||||||
r.DateOfBirth = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>() ?? "", "yyyy-MM-dd") : DateTime.MinValue;
|
//////r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));k
|
||||||
r.Marry = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Marry)]?.GetValue<string>();
|
////r.DateOfBirth = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>() ?? "", "yyyy-MM-dd") : DateTime.MinValue;
|
||||||
|
////r.Marry = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Marry)]?.GetValue<string>();
|
||||||
|
////r.Isspecial = "N";
|
||||||
|
////r.CitizenCardIssuer = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardIssue)]?.GetValue<string>();
|
||||||
|
////r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
|
||||||
|
////r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue<DateTime>();
|
||||||
|
////r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue<string>().IsNull("");
|
||||||
|
////r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue<string>().IsNull("");
|
||||||
|
////r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue<string>().IsNull("");
|
||||||
|
|
||||||
|
////// address
|
||||||
|
////r.Addresses.Add(new DisableAddress()
|
||||||
|
////{
|
||||||
|
//// Address = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Address)]?.GetValue<string>() ?? "",
|
||||||
|
//// Moo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo)]?.GetValue<string>() ?? "",
|
||||||
|
//// Soi = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi)]?.GetValue<string>() ?? "",
|
||||||
|
//// Road = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road)]?.GetValue<string>() ?? "",
|
||||||
|
//// District = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District)]?.GetValue<string>() ?? "",
|
||||||
|
//// Amphur = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur)]?.GetValue<string>() ?? "",
|
||||||
|
//// Province = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Province)]?.GetValue<string>() ?? "",
|
||||||
|
//// ZipCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode)]?.GetValue<string>() ?? "",
|
||||||
|
//// Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Telephone)]?.GetValue<string>() ?? "",
|
||||||
|
//// Mobile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Mobile)]?.GetValue<string>() ?? "",
|
||||||
|
//// Address1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Address1)]?.GetValue<string>() ?? "",
|
||||||
|
//// Moo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo1)]?.GetValue<string>() ?? "",
|
||||||
|
//// Soi1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi1)]?.GetValue<string>() ?? "",
|
||||||
|
//// Road1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road1)]?.GetValue<string>() ?? "",
|
||||||
|
//// District1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District1)]?.GetValue<string>() ?? "",
|
||||||
|
//// Amphur1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur1)]?.GetValue<string>() ?? "",
|
||||||
|
//// Province1 = "",
|
||||||
|
//// ZipCode1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode1)]?.GetValue<string>() ?? "",
|
||||||
|
//// 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<string>() ?? "",
|
||||||
|
//// CompanyCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CompanyCode)]?.GetValue<string>() ?? "",
|
||||||
|
//// TextFile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TextFile)]?.GetValue<string>() ?? "",
|
||||||
|
//// BankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BankCode)]?.GetValue<string>() ?? "",
|
||||||
|
//// AccountNumber = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.AccouontNumer)]?.GetValue<string>() ?? "",
|
||||||
|
//// TransDate = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransDate)]?.GetValue<string>() ?? "",
|
||||||
|
//// TransTime = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransTime)]?.GetValue<string>() ?? "",
|
||||||
|
//// CustomerName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CustomerName)]?.GetValue<string>() ?? "",
|
||||||
|
//// RefNo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.RefNo1)]?.GetValue<string>() ?? "",
|
||||||
|
//// TermBranch = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TermBranch)]?.GetValue<string>() ?? "",
|
||||||
|
//// TellerId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TellerID)]?.GetValue<string>() ?? "",
|
||||||
|
//// CreditDebit = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CreditDebit)]?.GetValue<string>() ?? "",
|
||||||
|
//// PaymentType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Type)]?.GetValue<string>(),
|
||||||
|
//// ChequeNo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChequeNo)]?.GetValue<string>() ?? "",
|
||||||
|
//// Amount = (decimal)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amount)]?.GetValue<decimal>(),
|
||||||
|
//// ChqueBankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChqBankCode)]?.GetValue<string>() ?? "",
|
||||||
|
//// 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<string>() ?? "",
|
||||||
|
//// Position = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Position)]?.GetValue<string>() ?? "",
|
||||||
|
//// Workplace = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Workplace)]?.GetValue<string>() ?? "",
|
||||||
|
//// Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkplaceTelephone)]?.GetValue<string>() ?? "",
|
||||||
|
//// WorkAge = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkAge)]?.GetValue<string>() ?? "",
|
||||||
|
//// 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<string>() ?? "",
|
||||||
|
//// Description = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateDesc)]?.GetValue<string>() ?? "",
|
||||||
|
//// IssueDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue<string>() ?? "", "yyyy-MM-dd") : DateTime.MinValue,
|
||||||
|
//// ExpiredDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue<string>() ?? "", "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<string>() ?? "",
|
||||||
|
//// Major = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Major)]?.GetValue<string>() ?? "",
|
||||||
|
//// MajorGroupId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupID)]?.GetValue<string>() ?? "",
|
||||||
|
//// MajorGroupName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupName)]?.GetValue<string>() ?? "",
|
||||||
|
//// University = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.University)]?.GetValue<string>() ?? "",
|
||||||
|
//// GPA = (double)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.GPA)]?.GetValue<double>(),
|
||||||
|
//// Specialist = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.SpecialList)]?.GetValue<string>() ?? "",
|
||||||
|
//// HighDegree = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.HighDegree)]?.GetValue<string>() ?? "",
|
||||||
|
//// BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue<string>() ?? "", "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<string>() ?? "";
|
||||||
|
r.PositionName = workSheet?.Cells[row, 3]?.GetValue<string>() ?? "";
|
||||||
|
r.HddPosition = workSheet?.Cells[row, 4]?.GetValue<string>() ?? "";
|
||||||
|
r.Prefix = workSheet?.Cells[row, 5]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 6]?.GetValue<string>() ?? "" : workSheet?.Cells[row, 5]?.GetValue<string>() ?? "";
|
||||||
|
r.FirstName = workSheet?.Cells[row, 7]?.GetValue<string>() ?? "";
|
||||||
|
r.LastName = workSheet?.Cells[row, 8]?.GetValue<string>() ?? "";
|
||||||
|
r.Gendor = workSheet?.Cells[row, 98]?.GetValue<string>() ?? "";
|
||||||
|
r.National = workSheet?.Cells[row, 9]?.GetValue<string>() ?? "";
|
||||||
|
r.Race = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||||
|
r.Religion = workSheet?.Cells[row, 10]?.GetValue<string>() ?? "";
|
||||||
|
r.DateOfBirth = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 11]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 11]?.GetValue<string>() ?? "", "dd/MM/yyyy") : DateTime.MinValue;
|
||||||
|
r.CitizenId = workSheet?.Cells[row, 12]?.GetValue<string>() ?? "";
|
||||||
|
r.typeTest = workSheet?.Cells[row, 13]?.GetValue<string>() ?? "";
|
||||||
|
r.Marry = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||||
r.Isspecial = "N";
|
r.Isspecial = "N";
|
||||||
r.CitizenCardIssuer = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardIssue)]?.GetValue<string>();
|
r.CitizenCardIssuer = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||||
r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
|
r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
|
||||||
r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue<DateTime>();
|
r.ApplyDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 87]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 87]?.GetValue<string>() ?? "", "dd/MM/yyyy") : DateTime.MinValue;
|
||||||
r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue<string>().IsNull("");
|
r.PositionType = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||||
r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue<string>().IsNull("");
|
r.PositionLevel = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||||
r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue<string>().IsNull("");
|
|
||||||
|
|
||||||
// address
|
r.CreatedAt = DateTime.Now;
|
||||||
r.Addresses.Add(new DisableAddress()
|
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<string>() ?? "",
|
Degree = workSheet?.Cells[row, 18]?.GetValue<string>() ?? "",
|
||||||
Moo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo)]?.GetValue<string>() ?? "",
|
Major = workSheet?.Cells[row, 19]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 20]?.GetValue<string>() ?? "" : workSheet?.Cells[row, 19]?.GetValue<string>() ?? "",
|
||||||
Soi = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi)]?.GetValue<string>() ?? "",
|
MajorGroupId = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
Road = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road)]?.GetValue<string>() ?? "",
|
MajorGroupName = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
District = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District)]?.GetValue<string>() ?? "",
|
University = workSheet?.Cells[row, 21]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 22]?.GetValue<string>() ?? "" : workSheet?.Cells[row, 21]?.GetValue<string>() ?? "",
|
||||||
Amphur = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur)]?.GetValue<string>() ?? "",
|
GPA = (double)workSheet?.Cells[row, 26]?.GetValue<double>(),
|
||||||
Province = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Province)]?.GetValue<string>() ?? "",
|
Specialist = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
ZipCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode)]?.GetValue<string>() ?? "",
|
HighDegree = workSheet?.Cells[row, 27]?.GetValue<string>() ?? "",
|
||||||
Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Telephone)]?.GetValue<string>() ?? "",
|
BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 25]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 11]?.GetValue<string>() ?? "", "dd/MM/yyyy") : DateTime.MinValue,
|
||||||
Mobile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Mobile)]?.GetValue<string>() ?? "",
|
|
||||||
Address1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Address1)]?.GetValue<string>() ?? "",
|
|
||||||
Moo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Moo1)]?.GetValue<string>() ?? "",
|
|
||||||
Soi1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Soi1)]?.GetValue<string>() ?? "",
|
|
||||||
Road1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Road1)]?.GetValue<string>() ?? "",
|
|
||||||
District1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.District1)]?.GetValue<string>() ?? "",
|
|
||||||
Amphur1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amphur1)]?.GetValue<string>() ?? "",
|
|
||||||
Province1 = "",
|
|
||||||
ZipCode1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ZipCode1)]?.GetValue<string>() ?? "",
|
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
LastUpdateFullName = FullName ?? "System Administrator"
|
||||||
});
|
|
||||||
|
|
||||||
// payment
|
|
||||||
r.Payments.Add(new DisablePayment()
|
|
||||||
{
|
|
||||||
PaymentId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PaymentID)]?.GetValue<string>() ?? "",
|
|
||||||
CompanyCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CompanyCode)]?.GetValue<string>() ?? "",
|
|
||||||
TextFile = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TextFile)]?.GetValue<string>() ?? "",
|
|
||||||
BankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BankCode)]?.GetValue<string>() ?? "",
|
|
||||||
AccountNumber = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.AccouontNumer)]?.GetValue<string>() ?? "",
|
|
||||||
TransDate = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransDate)]?.GetValue<string>() ?? "",
|
|
||||||
TransTime = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TransTime)]?.GetValue<string>() ?? "",
|
|
||||||
CustomerName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CustomerName)]?.GetValue<string>() ?? "",
|
|
||||||
RefNo1 = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.RefNo1)]?.GetValue<string>() ?? "",
|
|
||||||
TermBranch = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TermBranch)]?.GetValue<string>() ?? "",
|
|
||||||
TellerId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.TellerID)]?.GetValue<string>() ?? "",
|
|
||||||
CreditDebit = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CreditDebit)]?.GetValue<string>() ?? "",
|
|
||||||
PaymentType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Type)]?.GetValue<string>(),
|
|
||||||
ChequeNo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChequeNo)]?.GetValue<string>() ?? "",
|
|
||||||
Amount = (decimal)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Amount)]?.GetValue<decimal>(),
|
|
||||||
ChqueBankCode = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ChqBankCode)]?.GetValue<string>() ?? "",
|
|
||||||
CreatedAt = DateTime.Now,
|
|
||||||
CreatedUserId = UserId ?? "",
|
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
|
||||||
LastUpdatedAt = DateTime.Now,
|
|
||||||
LastUpdateUserId = UserId ?? "",
|
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// occupation
|
// occupation
|
||||||
r.Occupations.Add(new DisableOccupation()
|
r.Occupations.Add(new DisableOccupation()
|
||||||
{
|
{
|
||||||
Occupation = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Occupation)]?.GetValue<string>() ?? "",
|
Occupation = workSheet?.Cells[row, 33]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 34]?.GetValue<string>() ?? "" : workSheet?.Cells[row, 33]?.GetValue<string>() ?? "",
|
||||||
Position = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Position)]?.GetValue<string>() ?? "",
|
Position = workSheet?.Cells[row, 37]?.GetValue<string>() ?? "",
|
||||||
Workplace = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Workplace)]?.GetValue<string>() ?? "",
|
Workplace = $"{(workSheet?.Cells[row, 36]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 35]?.GetValue<string>() ?? "")}",
|
||||||
Telephone = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkplaceTelephone)]?.GetValue<string>() ?? "",
|
Telephone = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
WorkAge = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.WorkAge)]?.GetValue<string>() ?? "",
|
WorkAge = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
LastUpdateFullName = FullName ?? "System Administrator"
|
||||||
|
});
|
||||||
|
|
||||||
|
// address
|
||||||
|
r.Addresses.Add(new DisableAddress()
|
||||||
|
{
|
||||||
|
Address = $"{(workSheet?.Cells[row, 49]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 50]?.GetValue<string>() ?? "")}",
|
||||||
|
Moo = workSheet?.Cells[row, 51]?.GetValue<string>() ?? "",
|
||||||
|
Soi = workSheet?.Cells[row, 52]?.GetValue<string>() ?? "",
|
||||||
|
Road = workSheet?.Cells[row, 53]?.GetValue<string>() ?? "",
|
||||||
|
District = workSheet?.Cells[row, 54]?.GetValue<string>() ?? "",
|
||||||
|
Amphur = workSheet?.Cells[row, 55]?.GetValue<string>() ?? "",
|
||||||
|
Province = workSheet?.Cells[row, 56]?.GetValue<string>() ?? "",
|
||||||
|
ZipCode = workSheet?.Cells[row, 57]?.GetValue<string>() ?? "",
|
||||||
|
Telephone = workSheet?.Cells[row, 58]?.GetValue<string>() ?? "",
|
||||||
|
Mobile = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
|
Address1 = $"{(workSheet?.Cells[row, 61]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 62]?.GetValue<string>() ?? "")}",
|
||||||
|
Moo1 = workSheet?.Cells[row, 63]?.GetValue<string>() ?? "",
|
||||||
|
Soi1 = workSheet?.Cells[row, 64]?.GetValue<string>() ?? "",
|
||||||
|
Road1 = workSheet?.Cells[row, 65]?.GetValue<string>() ?? "",
|
||||||
|
District1 = workSheet?.Cells[row, 66]?.GetValue<string>() ?? "",
|
||||||
|
Amphur1 = workSheet?.Cells[row, 67]?.GetValue<string>() ?? "",
|
||||||
|
Province1 = workSheet?.Cells[row, 68]?.GetValue<string>() ?? "",
|
||||||
|
ZipCode1 = workSheet?.Cells[row, 69]?.GetValue<string>() ?? "",
|
||||||
|
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<string>() ?? "",
|
||||||
|
CompanyCode = workSheet?.Cells[row, 105]?.GetValue<string>() ?? "",
|
||||||
|
TextFile = workSheet?.Cells[row, 106]?.GetValue<string>() ?? "",
|
||||||
|
BankCode = workSheet?.Cells[row, 107]?.GetValue<string>() ?? "",
|
||||||
|
AccountNumber = workSheet?.Cells[row, 108]?.GetValue<string>() ?? "",
|
||||||
|
TransDate = workSheet?.Cells[row, 109]?.GetValue<string>() ?? "",
|
||||||
|
TransTime = workSheet?.Cells[row, 110]?.GetValue<string>() ?? "",
|
||||||
|
CustomerName = workSheet?.Cells[row, 111]?.GetValue<string>() ?? "",
|
||||||
|
RefNo1 = workSheet?.Cells[row, 112]?.GetValue<string>() ?? "",
|
||||||
|
TermBranch = workSheet?.Cells[row, 113]?.GetValue<string>() ?? "",
|
||||||
|
TellerId = workSheet?.Cells[row, 114]?.GetValue<string>() ?? "",
|
||||||
|
CreditDebit = workSheet?.Cells[row, 115]?.GetValue<string>() ?? "",
|
||||||
|
PaymentType = workSheet?.Cells[row, 116]?.GetValue<string>(),
|
||||||
|
ChequeNo = workSheet?.Cells[row, 117]?.GetValue<string>() ?? "",
|
||||||
|
Amount = (decimal)workSheet?.Cells[row, 118]?.GetValue<decimal>(),
|
||||||
|
ChqueBankCode = workSheet?.Cells[row, 119]?.GetValue<string>() ?? "",
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
LastUpdateFullName = FullName ?? "System Administrator"
|
||||||
});
|
});
|
||||||
|
|
||||||
// certificate
|
// certificate
|
||||||
r.Certificates.Add(new DisableCertificate()
|
r.Certificates.Add(new DisableCertificate()
|
||||||
{
|
{
|
||||||
CertificateNo = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateNo)]?.GetValue<string>() ?? "",
|
CertificateNo = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
Description = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateDesc)]?.GetValue<string>() ?? "",
|
Description = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||||
IssueDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue<string>() ?? "", "yyyy-MM-dd") : DateTime.MinValue,
|
IssueDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-")),
|
||||||
ExpiredDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue<string>() ?? "", "yyyy-MM-dd") : DateTime.MinValue,
|
ExpiredDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-")),
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
LastUpdateFullName = FullName ?? "System Administrator"
|
||||||
});
|
|
||||||
|
|
||||||
r.Educations.Add(new DisableEducation()
|
|
||||||
{
|
|
||||||
Degree = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Degree)]?.GetValue<string>() ?? "",
|
|
||||||
Major = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Major)]?.GetValue<string>() ?? "",
|
|
||||||
MajorGroupId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupID)]?.GetValue<string>() ?? "",
|
|
||||||
MajorGroupName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.MajorGroupName)]?.GetValue<string>() ?? "",
|
|
||||||
University = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.University)]?.GetValue<string>() ?? "",
|
|
||||||
GPA = (double)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.GPA)]?.GetValue<double>(),
|
|
||||||
Specialist = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.SpecialList)]?.GetValue<string>() ?? "",
|
|
||||||
HighDegree = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.HighDegree)]?.GetValue<string>() ?? "",
|
|
||||||
BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue<string>() ?? "", "yyyy-MM-dd") : DateTime.MinValue,
|
|
||||||
CreatedAt = DateTime.Now,
|
|
||||||
CreatedUserId = UserId ?? "",
|
|
||||||
CreatedFullName = FullName ?? "System Administrator",
|
|
||||||
LastUpdatedAt = DateTime.Now,
|
|
||||||
LastUpdateUserId = UserId ?? "",
|
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
r.PeriodExam = imported;
|
r.PeriodExam = imported;
|
||||||
r.LastUpdatedAt = DateTime.Now;
|
|
||||||
r.LastUpdateUserId = UserId ?? "";
|
|
||||||
r.LastUpdateFullName = FullName ?? "System Administrator";
|
|
||||||
_context.Disables.Add(r);
|
_context.Disables.Add(r);
|
||||||
|
|
||||||
//imported.Disables.Add(r);
|
//imported.Disables.Add(r);
|
||||||
|
|
@ -1304,8 +1440,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region " Score File "
|
#region " Score File "
|
||||||
|
/// <summary>
|
||||||
|
/// นำเข้าผลคะแนนสอบคัดเลือกผู้พิการ (บัญชีรวมคะแนน)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">รหัสรอบการสอบคัดเลือกผู้พิการ</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำนำเข้าข้อมูลสำเร็จ</response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
[HttpPost("score/{id:length(36)}"), DisableRequestSizeLimit]
|
[HttpPost("score/{id:length(36)}"), DisableRequestSizeLimit]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
public async Task<ActionResult<ResponseObject>> ImportScoreFileAsync(Guid id)
|
public async Task<ActionResult<ResponseObject>> ImportScoreFileAsync(Guid id)
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_EXAM_SELECT");
|
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_EXAM_SELECT");
|
||||||
|
|
@ -1370,9 +1518,23 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
{
|
{
|
||||||
Year = rec_import.Year,
|
Year = rec_import.Year,
|
||||||
ImportFile = doc,
|
ImportFile = doc,
|
||||||
|
CreatedAt = DateTime.Now,
|
||||||
|
CreatedUserId = UserId ?? "",
|
||||||
|
CreatedFullName = FullName ?? "System Administrator",
|
||||||
|
LastUpdatedAt = DateTime.Now,
|
||||||
|
LastUpdateUserId = UserId ?? "",
|
||||||
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
Scores = new List<DisableScore>()
|
Scores = new List<DisableScore>()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 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
|
// import datafile
|
||||||
System.IO.File.WriteAllBytes(importFile, fileContent);
|
System.IO.File.WriteAllBytes(importFile, fileContent);
|
||||||
|
|
||||||
|
|
@ -1393,40 +1555,44 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
if (cell1 == "" || cell1 == null) break;
|
if (cell1 == "" || cell1 == null) break;
|
||||||
|
|
||||||
var r = new DisableScore();
|
var r = new DisableScore();
|
||||||
|
|
||||||
|
#region นำเข้าผลคะแนนสอบคัดเลือกผู้พิการ old
|
||||||
|
|
||||||
|
////r.ExamId = workSheet?.Cells[row, 2]?.GetValue<string>();
|
||||||
|
|
||||||
|
////r.FullA = (int)workSheet?.Cells[7, 7]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
|
||||||
|
////r.SumA = workSheet?.Cells[row, 7]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 7]?.GetValue<string>().Replace(".00", "").ToInteger();
|
||||||
|
////r.PercentageA = workSheet?.Cells[row, 8]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 8]?.GetValue<double>();
|
||||||
|
////r.AStatus = workSheet?.Cells[row, 9]?.GetValue<string>();
|
||||||
|
|
||||||
|
////r.FullB = (int)workSheet?.Cells[7, 12]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
|
||||||
|
////r.SumB = workSheet?.Cells[row, 12]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 12]?.GetValue<string>().Replace(".00", "").ToInteger();
|
||||||
|
////r.PercentageB = workSheet?.Cells[row, 13]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 13]?.GetValue<double>();
|
||||||
|
////r.BStatus = workSheet?.Cells[row, 14]?.GetValue<string>();
|
||||||
|
|
||||||
|
////r.SumAB = workSheet?.Cells[row, 15]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 15]?.GetValue<string>().Replace(".00", "").ToInteger();
|
||||||
|
////r.ABStatus = workSheet?.Cells[row, 17]?.GetValue<string>();
|
||||||
|
|
||||||
|
////r.FullC = (int)workSheet?.Cells[7, 20]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
|
||||||
|
////r.SumC = workSheet?.Cells[row, 20]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 20]?.GetValue<string>().Replace(".00", "").ToInteger();
|
||||||
|
////r.PercentageC = workSheet?.Cells[row, 21]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 21]?.GetValue<double>();
|
||||||
|
////r.CStatus = workSheet?.Cells[row, 22]?.GetValue<string>();
|
||||||
|
|
||||||
|
////r.ExamStatus = workSheet?.Cells[row, 24]?.GetValue<string>();
|
||||||
|
////r.Number = workSheet?.Cells[row, 25]?.GetValue<string>() ?? "";
|
||||||
|
////r.Major = workSheet.Name;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
r.ExamId = workSheet?.Cells[row, 2]?.GetValue<string>();
|
r.ExamId = workSheet?.Cells[row, 2]?.GetValue<string>();
|
||||||
|
|
||||||
r.FullA = (int)workSheet?.Cells[7, 7]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
|
//var recruit = await _context.Disables.AsQueryable()
|
||||||
r.SumA = workSheet?.Cells[row, 7]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 7]?.GetValue<string>().Replace(".00", "").ToInteger();
|
// .Include(x => x.PeriodExam)
|
||||||
r.PercentageA = workSheet?.Cells[row, 8]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 8]?.GetValue<double>();
|
// .Where(x => x.PeriodExam == rec_import && x.ExamId == r.ExamId)
|
||||||
r.AStatus = workSheet?.Cells[row, 9]?.GetValue<string>();
|
// .FirstOrDefaultAsync();
|
||||||
|
|
||||||
r.FullB = (int)workSheet?.Cells[7, 12]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
|
// ใช้ dictionary lookup แทน query DB ทีละรอบ
|
||||||
r.SumB = workSheet?.Cells[row, 12]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 12]?.GetValue<string>().Replace(".00", "").ToInteger();
|
if (!string.IsNullOrEmpty(r.ExamId) && recruitsDict.TryGetValue(r.ExamId, out var recruit))
|
||||||
r.PercentageB = workSheet?.Cells[row, 13]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 13]?.GetValue<double>();
|
|
||||||
r.BStatus = workSheet?.Cells[row, 14]?.GetValue<string>();
|
|
||||||
|
|
||||||
r.SumAB = workSheet?.Cells[row, 15]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 15]?.GetValue<string>().Replace(".00", "").ToInteger();
|
|
||||||
r.ABStatus = workSheet?.Cells[row, 17]?.GetValue<string>();
|
|
||||||
|
|
||||||
r.FullC = (int)workSheet?.Cells[7, 20]?.GetValue<string>().Replace("(", "").Replace(")", "").Replace("คะแนน", "").Trim().ToInteger();
|
|
||||||
r.SumC = workSheet?.Cells[row, 20]?.GetValue<string>() == "ขส." ? 0 : (int)workSheet?.Cells[row, 20]?.GetValue<string>().Replace(".00", "").ToInteger();
|
|
||||||
r.PercentageC = workSheet?.Cells[row, 21]?.GetValue<string>() == "ขส." ? 0.0 : (double)workSheet?.Cells[row, 21]?.GetValue<double>();
|
|
||||||
r.CStatus = workSheet?.Cells[row, 22]?.GetValue<string>();
|
|
||||||
|
|
||||||
r.ExamStatus = workSheet?.Cells[row, 24]?.GetValue<string>();
|
|
||||||
r.Number = workSheet?.Cells[row, 25]?.GetValue<string>() ?? "";
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
var apiUrl = $"{_configuration["API"]}/org/find/head/officer";
|
var apiUrl = $"{_configuration["API"]}/org/find/head/officer";
|
||||||
using (var client = new HttpClient())
|
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;
|
recruit.AuthPosition = org.result.position == null ? "" : org.result.position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r.CitizenId = workSheet?.Cells[row, 3]?.GetValue<string>();
|
||||||
|
|
||||||
|
// ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง
|
||||||
|
r.FullA = 200;
|
||||||
|
r.SumA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 5].GetValue<double>(), 2);
|
||||||
|
r.PercentageA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 6]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 6].GetValue<double>(), 2);
|
||||||
|
r.AStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 7]?.GetValue<string>()) ? "" : workSheet?.Cells[row, 7]?.GetValue<string>();
|
||||||
|
r.SumAB = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 5].GetValue<double>(), 2);
|
||||||
|
r.ABStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 7]?.GetValue<string>()) ? "" : workSheet?.Cells[row, 7]?.GetValue<string>();
|
||||||
|
|
||||||
|
// ภาคความเหมาะสมกับตำแหน่ง
|
||||||
|
r.FullC = 50;
|
||||||
|
r.SumC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 8]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 8].GetValue<double>(), 2);
|
||||||
|
r.FullD = 50;
|
||||||
|
r.SumD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 9]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 9].GetValue<double>(), 2);
|
||||||
|
r.SumCD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 10]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 10].GetValue<double>(), 2);
|
||||||
|
r.PercentageC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 11]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 11].GetValue<double>(), 2);
|
||||||
|
r.CStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 12]?.GetValue<string>()) ? "" : workSheet?.Cells[row, 12]?.GetValue<string>();
|
||||||
|
r.FullScore = 300;
|
||||||
|
r.TotalScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 13]?.GetValue<string>()) ? 0.00 : Math.Round(workSheet.Cells[row, 13].GetValue<double>(), 2);
|
||||||
|
|
||||||
|
if (workSheet?.Cells[row, 7]?.GetValue<string>() == "ขาดสอบ")
|
||||||
|
{
|
||||||
|
r.ExamStatus = "ขส.";
|
||||||
|
}
|
||||||
|
else if (workSheet?.Cells[row, 14]?.GetValue<string>() == "ได้")
|
||||||
|
{
|
||||||
|
r.ExamStatus = "ผ่าน";
|
||||||
|
}
|
||||||
|
else if (workSheet?.Cells[row, 14]?.GetValue<string>() == "ตก")
|
||||||
|
{
|
||||||
|
r.ExamStatus = "ไม่ผ่าน";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r.ExamStatus = "-";
|
||||||
|
}
|
||||||
|
|
||||||
|
r.RemarkScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 15]?.GetValue<string>()) ? string.Empty : workSheet?.Cells[row, 15]?.GetValue<string>();
|
||||||
|
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
|
// finally save to database
|
||||||
|
|
@ -1469,6 +1689,126 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region " Result File "
|
||||||
|
/// <summary>
|
||||||
|
/// นำเข้าผลการสอบคัดเลือกผู้พิการ (ผลการสอบ)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">รหัสรอบการสอบคัดเลือกผู้พิการ </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำนำเข้าข้อมูลสำเร็จ</response>
|
||||||
|
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpPost("result/{id:length(36)}"), DisableRequestSizeLimit]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> ImportResultFileAsync(Guid id)
|
||||||
|
{
|
||||||
|
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_EXAM_SELECT");
|
||||||
|
var jsonData = JsonConvert.DeserializeObject<JObject>(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<string>();
|
||||||
|
if (string.IsNullOrWhiteSpace(examId))
|
||||||
|
{
|
||||||
|
row++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (score.TryGetValue(examId, out var existingScore))
|
||||||
|
{
|
||||||
|
existingScore.Number = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||||
|
existingScore.RemarkExamOrder = workSheet?.Cells[row, 4]?.GetValue<string>() ?? 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 "
|
#region " Exam Information "
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -1581,6 +1921,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
applyDate = dr["applydate"] == null ? "" : Convert.ToDateTime(dr["applydate"]).ToThaiShortDate(),
|
applyDate = dr["applydate"] == null ? "" : Convert.ToDateTime(dr["applydate"]).ToThaiShortDate(),
|
||||||
university = dr["university"].ToString(),
|
university = dr["university"].ToString(),
|
||||||
position_name = dr["position_name"].ToString(),
|
position_name = dr["position_name"].ToString(),
|
||||||
|
hddPosition = dr["hddPosition"].ToString(),
|
||||||
|
typeTest = dr["typeTest"].ToString(),
|
||||||
position_level = dr["position_level"].ToString(),
|
position_level = dr["position_level"].ToString(),
|
||||||
position_type = dr["position_type"].ToString(),
|
position_type = dr["position_type"].ToString(),
|
||||||
exam_name = dr["exam_name"].ToString(),
|
exam_name = dr["exam_name"].ToString(),
|
||||||
|
|
@ -1667,12 +2009,22 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
ProfileID = p.CitizenId,
|
ProfileID = p.CitizenId,
|
||||||
p.Prefix,
|
p.Prefix,
|
||||||
FullName = $"{p.FirstName} {p.LastName}",
|
FullName = $"{p.FirstName} {p.LastName}",
|
||||||
DateOfBirth = p.DateOfBirth.ToThaiShortDate(),
|
DateOfBirth = p.DateOfBirth != null
|
||||||
|
? p.DateOfBirth != DateTime.MinValue
|
||||||
|
? p.DateOfBirth.ToThaiShortDate()
|
||||||
|
: ""
|
||||||
|
: "",
|
||||||
Gender = p.Gendor,
|
Gender = p.Gendor,
|
||||||
Degree = p.Educations.First().Degree,
|
Degree = p.Educations.First().Degree,
|
||||||
Major = p.Educations.First().Major,
|
Major = p.Educations.First().Major,
|
||||||
CertificateNo = p.Certificates.First().CertificateNo,
|
CertificateNo = p.Certificates.Count > 0
|
||||||
CertificateIssueDate = p.Certificates.First().IssueDate.ToThaiShortDate(),
|
? 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,
|
ExamResult = sr == null ? "" : sr.ExamStatus,
|
||||||
ExamAttribute = _disableService.CheckValidCertificate(p.Certificates.First().IssueDate, 5) ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ",
|
ExamAttribute = _disableService.CheckValidCertificate(p.Certificates.First().IssueDate, 5) ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ",
|
||||||
IsSpecial = p.Isspecial,
|
IsSpecial = p.Isspecial,
|
||||||
|
|
@ -1681,24 +2033,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
PositionName = p.PositionName,
|
PositionName = p.PositionName,
|
||||||
PositionType = p.PositionType,
|
PositionType = p.PositionType,
|
||||||
PositionLevel = p.PositionLevel,
|
PositionLevel = p.PositionLevel,
|
||||||
ExamName = p.PeriodExam.Name,
|
ExamName = p.PeriodExam!.Name,
|
||||||
ExamOrder = p.PeriodExam.Round,
|
ExamOrder = p.PeriodExam.Round,
|
||||||
ExamYear = p.PeriodExam.Year == null ? 0 : p.PeriodExam.Year.Value.ToThaiYear(),
|
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,
|
Number = sr == null ? "" : sr.Number,
|
||||||
CitizenId = p.CitizenId,
|
|
||||||
ExamCount = _disableService.GetExamCount(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
|
ScoreResult = sr == null ? null : new
|
||||||
{
|
{
|
||||||
ScoreAFull = sr.FullA,
|
ScoreAFull = sr.FullA,
|
||||||
ScoreA = sr.SumA,
|
ScoreA = sr.SumA,
|
||||||
ScoreBFull = sr.FullB,
|
ScoreBFull = sr.FullB,
|
||||||
ScoreB = sr.SumB,
|
ScoreB = sr.SumB,
|
||||||
|
ScoreAB = sr.SumAB,
|
||||||
ScoreCFull = sr.FullC,
|
ScoreCFull = sr.FullC,
|
||||||
ScoreC = sr.SumC,
|
ScoreC = sr.SumC,
|
||||||
ScoreSumFull = sr.FullA + sr.FullB + sr.FullC,
|
ScoreDFull = sr.FullD,
|
||||||
ScoreSum = sr.SumA + sr.SumB + sr.SumC,
|
ScoreD = sr.SumD,
|
||||||
|
ScoreCD = sr.SumCD,
|
||||||
|
ScoreSumFull = sr.FullScore,
|
||||||
|
ScoreSum = sr.TotalScore,
|
||||||
ExamResult = sr.ExamStatus
|
ExamResult = sr.ExamStatus
|
||||||
},
|
},
|
||||||
Attachments = p.Documents.Select(a => new
|
Attachments = p.Documents.Select(a => new
|
||||||
|
|
@ -1709,7 +2069,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
})
|
})
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
return Success(new { data, ExamCount = data == null || data.CitizenId == "" ? 0 : _disableService.GetExamCount(data.CitizenId) });
|
return Success(data);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -1872,8 +2232,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
ExamId = r.ExamId,
|
ExamId = r.ExamId,
|
||||||
CitizenId = r.CitizenId,
|
CitizenId = r.CitizenId,
|
||||||
Fullname = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
Fullname = $"{r.Prefix}{r.FirstName} {r.LastName}",
|
||||||
Full = s.FullA + s.FullB + s.FullC,
|
Full = s.FullScore != null ? s.FullScore : 0,
|
||||||
Sum = s.SumA + s.SumB + s.SumC,
|
Sum = s.TotalScore != null ? s.TotalScore : 0,
|
||||||
Status = s.ExamStatus,
|
Status = s.ExamStatus,
|
||||||
s.Number,
|
s.Number,
|
||||||
r.PositionName,
|
r.PositionName,
|
||||||
|
|
@ -1924,6 +2284,85 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region " Report "
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ผลคะแนนผู้สมัครสอบ
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">รหัสรอบการสอบคัดเลือกผู้พิการ</param>
|
||||||
|
/// <param name="examId">เลขประจำตัวสอบ</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <response code="200">เมื่อทำการอ่านข้อมูลจำนวนผู้สอบผ่านแข่งขันเพื่อบรรจุเข้ารับราชการเป็นข้าราชการ กทม. สามัญสำเร็จ</response>
|
||||||
|
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||||
|
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||||
|
[HttpGet("report/exam/{id:length(36)}/{examId}"), DisableRequestSizeLimit]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
|
public async Task<ActionResult<ResponseObject>> 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
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1067,6 +1067,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
||||||
.HasMaxLength(20)
|
.HasMaxLength(20)
|
||||||
.HasColumnType("varchar(20)");
|
.HasColumnType("varchar(20)");
|
||||||
|
|
||||||
|
b.Property<string>("HddPosition")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("บัญชีสอบ");
|
||||||
|
|
||||||
b.Property<string>("Isspecial")
|
b.Property<string>("Isspecial")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(1)
|
.HasMaxLength(1)
|
||||||
|
|
@ -1151,6 +1155,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
||||||
.HasMaxLength(200)
|
.HasMaxLength(200)
|
||||||
.HasColumnType("varchar(200)");
|
.HasColumnType("varchar(200)");
|
||||||
|
|
||||||
|
b.Property<string>("typeTest")
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("ประเภทการสอบภาค ก.");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("PeriodExamId");
|
b.HasIndex("PeriodExamId");
|
||||||
|
|
@ -1833,22 +1841,30 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
||||||
b.Property<string>("ABStatus")
|
b.Property<string>("ABStatus")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasColumnType("varchar(50)");
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน");
|
||||||
|
|
||||||
b.Property<string>("AStatus")
|
b.Property<string>("AStatus")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasColumnType("varchar(50)");
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน");
|
||||||
|
|
||||||
b.Property<string>("BStatus")
|
b.Property<string>("BStatus")
|
||||||
.IsRequired()
|
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasColumnType("varchar(50)");
|
.HasColumnType("varchar(50)");
|
||||||
|
|
||||||
b.Property<string>("CStatus")
|
b.Property<string>("CStatus")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasColumnType("varchar(50)");
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน");
|
||||||
|
|
||||||
|
b.Property<string>("CitizenId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(13)
|
||||||
|
.HasColumnType("varchar(13)")
|
||||||
|
.HasComment("เลขประจำตัวประชาชน");
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
b.Property<DateTime>("CreatedAt")
|
||||||
.HasColumnType("datetime(6)")
|
.HasColumnType("datetime(6)")
|
||||||
|
|
@ -1872,21 +1888,33 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
||||||
b.Property<string>("ExamId")
|
b.Property<string>("ExamId")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasColumnType("varchar(50)");
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasComment("เลขประจำตัวสอบ");
|
||||||
|
|
||||||
b.Property<string>("ExamStatus")
|
b.Property<string>("ExamStatus")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(50)
|
.HasMaxLength(50)
|
||||||
.HasColumnType("varchar(50)");
|
.HasColumnType("varchar(50)")
|
||||||
|
.HasComment("สอบได้ / ตก / ขาดสอบ");
|
||||||
|
|
||||||
b.Property<int>("FullA")
|
b.Property<int>("FullA")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int")
|
||||||
|
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม");
|
||||||
|
|
||||||
b.Property<int>("FullB")
|
b.Property<int?>("FullB")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<int>("FullC")
|
b.Property<int>("FullC")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int")
|
||||||
|
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม");
|
||||||
|
|
||||||
|
b.Property<int>("FullD")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม");
|
||||||
|
|
||||||
|
b.Property<int>("FullScore")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("คะแนนเต็ม");
|
||||||
|
|
||||||
b.Property<string>("LastUpdateFullName")
|
b.Property<string>("LastUpdateFullName")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
|
|
@ -1919,28 +1947,55 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
||||||
.HasComment("ลำดับที่สอบได้");
|
.HasComment("ลำดับที่สอบได้");
|
||||||
|
|
||||||
b.Property<double>("PercentageA")
|
b.Property<double>("PercentageA")
|
||||||
.HasColumnType("double");
|
.HasColumnType("double")
|
||||||
|
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ");
|
||||||
|
|
||||||
b.Property<double>("PercentageB")
|
b.Property<double?>("PercentageB")
|
||||||
.HasColumnType("double");
|
.HasColumnType("double");
|
||||||
|
|
||||||
b.Property<double>("PercentageC")
|
b.Property<double>("PercentageC")
|
||||||
.HasColumnType("double");
|
.HasColumnType("double")
|
||||||
|
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ");
|
||||||
|
|
||||||
|
b.Property<string>("RemarkExamOrder")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุจากลำดับที่สอบได้");
|
||||||
|
|
||||||
|
b.Property<string>("RemarkScore")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("longtext")
|
||||||
|
.HasComment("หมายเหตุจากบัญชีรวมคะแนน");
|
||||||
|
|
||||||
b.Property<Guid>("ScoreImportId")
|
b.Property<Guid>("ScoreImportId")
|
||||||
.HasColumnType("char(36)");
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
b.Property<int>("SumA")
|
b.Property<double>("SumA")
|
||||||
.HasColumnType("int");
|
.HasColumnType("double")
|
||||||
|
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
|
||||||
|
|
||||||
b.Property<int>("SumAB")
|
b.Property<double>("SumAB")
|
||||||
.HasColumnType("int");
|
.HasColumnType("double")
|
||||||
|
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
|
||||||
|
|
||||||
b.Property<int>("SumB")
|
b.Property<double?>("SumB")
|
||||||
.HasColumnType("int");
|
.HasColumnType("double");
|
||||||
|
|
||||||
b.Property<int>("SumC")
|
b.Property<double>("SumC")
|
||||||
.HasColumnType("int");
|
.HasColumnType("double")
|
||||||
|
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม");
|
||||||
|
|
||||||
|
b.Property<double>("SumCD")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์");
|
||||||
|
|
||||||
|
b.Property<double>("SumD")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม");
|
||||||
|
|
||||||
|
b.Property<double>("TotalScore")
|
||||||
|
.HasColumnType("double")
|
||||||
|
.HasComment("คะแนนรวม");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
|
|
||||||
3134
Migrations/20250905040454_add_fields_disable_and_disableScore.Designer.cs
generated
Normal file
3134
Migrations/20250905040454_add_fields_disable_and_disableScore.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
482
Migrations/20250905040454_add_fields_disable_and_disableScore.cs
Normal file
482
Migrations/20250905040454_add_fields_disable_and_disableScore.cs
Normal file
|
|
@ -0,0 +1,482 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Recurit.Exam.Service.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class add_fields_disable_and_disableScore : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "SumC",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "SumB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "SumAB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "SumA",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "PercentageC",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
comment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ",
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "PercentageB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "PercentageA",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ",
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "FullC",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
comment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "FullB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "FullA",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
comment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม",
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
name: "CitizenId",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "varchar(13)",
|
||||||
|
maxLength: 13,
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "",
|
||||||
|
comment: "เลขประจำตัวประชาชน")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "FullD",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0,
|
||||||
|
comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนเต็ม");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "FullScore",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0,
|
||||||
|
comment: "คะแนนเต็ม");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "RemarkExamOrder",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: false,
|
||||||
|
comment: "หมายเหตุจากลำดับที่สอบได้")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "RemarkScore",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: false,
|
||||||
|
comment: "หมายเหตุจากบัญชีรวมคะแนน")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "SumCD",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0,
|
||||||
|
comment: "ภาคความเหมาะสมกับตำแหน่ง คะแนนรวมทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ และสัมภาษณ์");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "SumD",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0,
|
||||||
|
comment: "ภาคความเหมาะสมกับตำแหน่ง สัมภาษณ์ คะแนนรวม");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "TotalScore",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0,
|
||||||
|
comment: "คะแนนรวม");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "HddPosition",
|
||||||
|
table: "Disables",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true,
|
||||||
|
comment: "บัญชีสอบ")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "typeTest",
|
||||||
|
table: "Disables",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true,
|
||||||
|
comment: "ประเภทการสอบภาค ก.")
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
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<int>(
|
||||||
|
name: "SumC",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double",
|
||||||
|
oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "SumB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "SumAB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double",
|
||||||
|
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "SumA",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double",
|
||||||
|
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "PercentageC",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double",
|
||||||
|
oldComment: "ภาคความเหมาะสมกับตำแหน่ง ร้อยละ");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "PercentageB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0.0,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<double>(
|
||||||
|
name: "PercentageA",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "double",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(double),
|
||||||
|
oldType: "double",
|
||||||
|
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "FullC",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldComment: "ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "FullB",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "FullA",
|
||||||
|
table: "DisableScores",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int",
|
||||||
|
oldComment: "ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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<string>(
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -82,5 +82,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
|
||||||
public string? PositionLevel { get; set; }
|
public string? PositionLevel { get; set; }
|
||||||
public string? AuthName { get; set; }
|
public string? AuthName { get; set; }
|
||||||
public string? AuthPosition { get; set; }
|
public string? AuthPosition { get; set; }
|
||||||
|
|
||||||
|
[Comment("บัญชีสอบ")]
|
||||||
|
public string? HddPosition { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Comment("ประเภทการสอบภาค ก.")]
|
||||||
|
public string? typeTest { get; set; } = string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,42 +5,64 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
|
||||||
{
|
{
|
||||||
public class DisableScore : EntityBase
|
public class DisableScore : EntityBase
|
||||||
{
|
{
|
||||||
[Required, MaxLength(50)]
|
[Required, MaxLength(50), Comment("เลขประจำตัวสอบ")]
|
||||||
public string ExamId { get; set; }
|
public string ExamId { get; set; }
|
||||||
|
|
||||||
public int SumA { get; set; }
|
[Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม")]
|
||||||
|
public double SumA { get; set; }
|
||||||
|
|
||||||
|
[Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม")]
|
||||||
public int FullA { get; set; }
|
public int FullA { get; set; }
|
||||||
|
|
||||||
|
[Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ")]
|
||||||
public double PercentageA { get; set; }
|
public double PercentageA { get; set; }
|
||||||
|
|
||||||
[MaxLength(50)]
|
[MaxLength(50), Comment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน")]
|
||||||
public string AStatus { get; set; }
|
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)]
|
[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 string ABStatus { get; set; }
|
||||||
|
|
||||||
public int SumC { get; set; }
|
[Comment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนรวม")]
|
||||||
|
public double SumC { get; set; }
|
||||||
|
|
||||||
|
[Comment("ภาคความเหมาะสมกับตำแหน่ง ทดสอบสมรรถนะ+ทดสอบจิตวิทยาฯ คะแนนเต็ม")]
|
||||||
public int FullC { get; set; }
|
public int FullC { get; set; }
|
||||||
|
|
||||||
|
[Comment("ภาคความเหมาะสมกับตำแหน่ง ร้อยละ")]
|
||||||
public double PercentageC { get; set; }
|
public double PercentageC { get; set; }
|
||||||
|
|
||||||
[MaxLength(50)]
|
[MaxLength(50), Comment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน")]
|
||||||
public string CStatus { get; set; }
|
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; }
|
public string ExamStatus { get; set; }
|
||||||
|
|
||||||
[MaxLength(200)]
|
[MaxLength(200)]
|
||||||
|
|
@ -49,6 +71,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
|
||||||
[MaxLength(200), Comment("ลำดับที่สอบได้")]
|
[MaxLength(200), Comment("ลำดับที่สอบได้")]
|
||||||
public string Number { get; set; } = string.Empty;
|
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; }
|
public ScoreImport ScoreImport { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
public DateTime CheckDateTime(string Date, string Formate)
|
public DateTime CheckDateTime(string Date, string Formate)
|
||||||
{
|
{
|
||||||
// ตอนนี้ทำไว้ให้รองรับแค่ "dd/MM/yyyy", "yyyy-MM-dd"
|
// ตอนนี้ทำไว้ให้รองรับแค่ "dd/MM/yyyy", "yyyy-MM-dd"
|
||||||
|
Date = Date.Trim();
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(Date))
|
if (string.IsNullOrWhiteSpace(Date))
|
||||||
return DateTime.MinValue;
|
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("/");
|
string[] parts = Date.Trim().Replace("-", "/").Split("/");
|
||||||
|
|
||||||
if (parts.Length != 3)
|
if (parts.Length != 3)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue