Compare commits
11 commits
b7bfc35a97
...
44e4ab3f9f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44e4ab3f9f | ||
|
|
5a94c3b67a | ||
|
|
38ed06ece6 | ||
|
|
39da79a893 | ||
|
|
8b5a46cb52 | ||
|
|
caad36949b | ||
|
|
55128d5b43 | ||
|
|
3e1701cfdf | ||
|
|
2d694c79fc | ||
|
|
59faf42af1 | ||
| 0d290baaab |
11 changed files with 4556 additions and 189 deletions
|
|
@ -469,7 +469,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
if (req == null)
|
||||
return Error(GlobalMessages.InvalidRequestParam, (int)HttpStatusCode.BadRequest);
|
||||
|
||||
await _context.PeriodExams.AddAsync(new PeriodExam
|
||||
var periodExam = new PeriodExam
|
||||
{
|
||||
Year = req.Year,
|
||||
Name = req.Name,
|
||||
|
|
@ -492,11 +492,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
LastUpdatedAt = DateTime.Now,
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
});
|
||||
|
||||
};
|
||||
await _context.PeriodExams.AddAsync(periodExam);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return Success();
|
||||
return Success(periodExam.Id);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -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
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// นำเข้ารายชื่อผู้สมัครสอบคัดเลือกผู้พิการ
|
||||
/// นำเข้ารายชื่อผู้สมัครสอบคัดเลือกผู้พิการ (ข้อมูลผู้สมัครสอบ)
|
||||
/// </summary>
|
||||
/// <param name="id">รหัสรอบการสอบคัดเลือกผู้พิการ</param>
|
||||
/// <returns></returns>
|
||||
|
|
@ -1142,136 +1143,272 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var r = new Recurit.Exam.Service.Models.Disables.Disable();
|
||||
r.ExamId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ExamID)]?.GetValue<string>();
|
||||
r.CitizenId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalID)]?.GetValue<string>();
|
||||
r.Prefix = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Prefix)]?.GetValue<string>();
|
||||
r.FirstName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.FirstName)]?.GetValue<string>();
|
||||
r.LastName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.LastName)]?.GetValue<string>();
|
||||
r.Gendor = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Gender)]?.GetValue<string>();
|
||||
r.National = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.National)]?.GetValue<string>().IsNull("");
|
||||
r.Race = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Race)]?.GetValue<string>().IsNull("");
|
||||
r.Religion = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Religion)]?.GetValue<string>().IsNull("");
|
||||
r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
|
||||
r.Marry = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Marry)]?.GetValue<string>();
|
||||
# region old
|
||||
////var r = new Recurit.Exam.Service.Models.Disables.Disable();
|
||||
////r.ExamId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ExamID)]?.GetValue<string>();
|
||||
////r.CitizenId = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalID)]?.GetValue<string>();
|
||||
////r.Prefix = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Prefix)]?.GetValue<string>();
|
||||
////r.FirstName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.FirstName)]?.GetValue<string>();
|
||||
////r.LastName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.LastName)]?.GetValue<string>();
|
||||
////r.Gendor = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Gender)]?.GetValue<string>();
|
||||
////r.National = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.National)]?.GetValue<string>().IsNull("");
|
||||
////r.Race = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Race)]?.GetValue<string>().IsNull("");
|
||||
////r.Religion = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.Religion)]?.GetValue<string>().IsNull("");
|
||||
//////r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.DateOfBirth)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));k
|
||||
////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.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("");
|
||||
r.CitizenCardIssuer = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||
r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
|
||||
r.ApplyDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 87]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 87]?.GetValue<string>() ?? "", "dd/MM/yyyy") : DateTime.MinValue;
|
||||
r.PositionType = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||
r.PositionLevel = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
|
||||
|
||||
// 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<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>() ?? "",
|
||||
Degree = workSheet?.Cells[row, 18]?.GetValue<string>() ?? "",
|
||||
Major = workSheet?.Cells[row, 19]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 20]?.GetValue<string>() ?? "" : workSheet?.Cells[row, 19]?.GetValue<string>() ?? "",
|
||||
MajorGroupId = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||
MajorGroupName = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||
University = workSheet?.Cells[row, 21]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 22]?.GetValue<string>() ?? "" : workSheet?.Cells[row, 21]?.GetValue<string>() ?? "",
|
||||
GPA = (double)workSheet?.Cells[row, 26]?.GetValue<double>(),
|
||||
Specialist = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||
HighDegree = workSheet?.Cells[row, 27]?.GetValue<string>() ?? "",
|
||||
BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 25]?.GetValue<string>()) ? _disableService.CheckDateTime(workSheet?.Cells[row, 11]?.GetValue<string>() ?? "", "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<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",
|
||||
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>() ?? "",
|
||||
Occupation = workSheet?.Cells[row, 33]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 34]?.GetValue<string>() ?? "" : workSheet?.Cells[row, 33]?.GetValue<string>() ?? "",
|
||||
Position = workSheet?.Cells[row, 37]?.GetValue<string>() ?? "",
|
||||
Workplace = $"{(workSheet?.Cells[row, 36]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 35]?.GetValue<string>() ?? "")}",
|
||||
Telephone = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||
WorkAge = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||
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<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
|
||||
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 = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateIssueDate)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-")),
|
||||
ExpiredDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.CertificateExpireDate)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-")),
|
||||
CertificateNo = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||
Description = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
|
||||
IssueDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-")),
|
||||
ExpiredDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().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<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 = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.BachelorDate)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-")),
|
||||
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);
|
||||
|
|
@ -1303,8 +1440,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
#endregion
|
||||
|
||||
#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]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> ImportScoreFileAsync(Guid id)
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_EXAM_SELECT");
|
||||
|
|
@ -1369,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<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
|
||||
System.IO.File.WriteAllBytes(importFile, fileContent);
|
||||
|
||||
|
|
@ -1392,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<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.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>();
|
||||
//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<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;
|
||||
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())
|
||||
|
|
@ -1442,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<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
|
||||
|
|
@ -1468,6 +1689,126 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
|
||||
#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 "
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -1580,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(),
|
||||
|
|
@ -1590,6 +1933,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
|
||||
}
|
||||
|
||||
if (data != null && data.Count > 0)
|
||||
data = data.Skip((req.Page - 1) * req.PageSize).Take(req.PageSize).ToList();
|
||||
|
||||
dynamic header = null;
|
||||
using (var cmd = _context.Database.GetDbConnection().CreateCommand())
|
||||
{
|
||||
|
|
@ -1615,7 +1961,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
{
|
||||
count = 0,
|
||||
pass = 0,
|
||||
notpass = 0
|
||||
notpass = 0,
|
||||
missed_exam = 0,
|
||||
other = 0
|
||||
};
|
||||
}
|
||||
else
|
||||
|
|
@ -1625,7 +1973,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
{
|
||||
count = dr["count"].ToString().ToInteger(),
|
||||
pass = dr["pass"].ToString().ToInteger(),
|
||||
notpass = dr["notpass"].ToString().ToInteger()
|
||||
notpass = dr["notpass"].ToString().ToInteger(),
|
||||
missed_exam = dr["missed_exam"].ToString().ToInteger(),
|
||||
other = dr["other"].ToString().ToInteger()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1666,12 +2016,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,
|
||||
|
|
@ -1680,24 +2040,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
|
||||
|
|
@ -1708,7 +2076,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)
|
||||
{
|
||||
|
|
@ -1871,8 +2239,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,
|
||||
|
|
@ -1923,6 +2291,85 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
|
@ -1067,6 +1067,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasMaxLength(20)
|
||||
.HasColumnType("varchar(20)");
|
||||
|
||||
b.Property<string>("HddPosition")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("บัญชีสอบ");
|
||||
|
||||
b.Property<string>("Isspecial")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1)
|
||||
|
|
@ -1151,6 +1155,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)");
|
||||
|
||||
b.Property<string>("typeTest")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ประเภทการสอบภาค ก.");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("PeriodExamId");
|
||||
|
|
@ -1833,22 +1841,30 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<string>("ABStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน");
|
||||
|
||||
b.Property<string>("AStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ผลประเมิน");
|
||||
|
||||
b.Property<string>("BStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
|
||||
b.Property<string>("CStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("ภาคความเหมาะสมกับตำแหน่ง ผลประเมิน");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(13)
|
||||
.HasColumnType("varchar(13)")
|
||||
.HasComment("เลขประจำตัวประชาชน");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
|
|
@ -1872,21 +1888,33 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<string>("ExamId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("เลขประจำตัวสอบ");
|
||||
|
||||
b.Property<string>("ExamStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)");
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasComment("สอบได้ / ตก / ขาดสอบ");
|
||||
|
||||
b.Property<int>("FullA")
|
||||
.HasColumnType("int");
|
||||
.HasColumnType("int")
|
||||
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนเต็ม");
|
||||
|
||||
b.Property<int>("FullB")
|
||||
b.Property<int?>("FullB")
|
||||
.HasColumnType("int");
|
||||
|
||||
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")
|
||||
.IsRequired()
|
||||
|
|
@ -1919,28 +1947,55 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("ลำดับที่สอบได้");
|
||||
|
||||
b.Property<double>("PercentageA")
|
||||
.HasColumnType("double");
|
||||
.HasColumnType("double")
|
||||
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง ร้อยละ");
|
||||
|
||||
b.Property<double>("PercentageB")
|
||||
b.Property<double?>("PercentageB")
|
||||
.HasColumnType("double");
|
||||
|
||||
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")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<int>("SumA")
|
||||
.HasColumnType("int");
|
||||
b.Property<double>("SumA")
|
||||
.HasColumnType("double")
|
||||
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
|
||||
|
||||
b.Property<int>("SumAB")
|
||||
.HasColumnType("int");
|
||||
b.Property<double>("SumAB")
|
||||
.HasColumnType("double")
|
||||
.HasComment("ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง คะแนนรวม");
|
||||
|
||||
b.Property<int>("SumB")
|
||||
.HasColumnType("int");
|
||||
b.Property<double?>("SumB")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<int>("SumC")
|
||||
.HasColumnType("int");
|
||||
b.Property<double>("SumC")
|
||||
.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");
|
||||
|
||||
|
|
|
|||
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? AuthName { 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
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,8 @@
|
|||
/// ข้อมูลผลการสอบ 'ผ่าน' 'ไม่ผ่าน'
|
||||
/// </summary>
|
||||
public string ExamResult { get; set; }
|
||||
|
||||
public int Page { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 10;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1261,7 +1261,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
|
||||
if (candidate.ProfileImg != null)
|
||||
{
|
||||
await DeleteDocument(candidate.ProfileImg.Id.ToString());
|
||||
string profileImgId = candidate.ProfileImg.Id.ToString();
|
||||
//ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo
|
||||
candidate.ProfileImg = null;
|
||||
await _context.SaveChangesAsync();
|
||||
await DeleteDocument(profileImgId);
|
||||
}
|
||||
|
||||
var doc = await _minioService.UploadFileAsync(file);
|
||||
|
|
@ -1284,7 +1288,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
|
||||
if (candidate.ProfileImg != null)
|
||||
{
|
||||
await DeleteDocument(candidate.ProfileImg.Id.ToString());
|
||||
string profileImgId = candidate.ProfileImg.Id.ToString();
|
||||
//ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo
|
||||
candidate.ProfileImg = null;
|
||||
await _context.SaveChangesAsync();
|
||||
await DeleteDocument(profileImgId);
|
||||
}
|
||||
|
||||
var doc = await _minioService.UploadFileAsync(file);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using BMA.EHR.Recurit.Exam.Service.Data;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||
{
|
||||
|
|
@ -63,5 +64,93 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
return valid;
|
||||
}
|
||||
|
||||
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)
|
||||
return DateTime.MinValue;
|
||||
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
switch (Formate)
|
||||
{
|
||||
case "dd/MM/yyyy":
|
||||
if (int.TryParse(parts[2], out year) && year > 2500)
|
||||
{
|
||||
year -= 543;
|
||||
}
|
||||
else if (!int.TryParse(parts[2], out year))
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
|
||||
if (!int.TryParse(parts[1], out month))
|
||||
return DateTime.MinValue;
|
||||
|
||||
if (!int.TryParse(parts[0], out day))
|
||||
return DateTime.MinValue;
|
||||
|
||||
break;
|
||||
|
||||
case "yyyy-MM-dd":
|
||||
if (int.TryParse(parts[0], out year) && year > 2500)
|
||||
{
|
||||
year -= 543;
|
||||
}
|
||||
else if (!int.TryParse(parts[0], out year))
|
||||
{
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
|
||||
if (!int.TryParse(parts[1], out month))
|
||||
return DateTime.MinValue;
|
||||
|
||||
if (!int.TryParse(parts[2], out day))
|
||||
return DateTime.MinValue;
|
||||
break;
|
||||
|
||||
default:
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
|
||||
if (month < 1 || month > 12)
|
||||
month = 1;
|
||||
|
||||
int maxDay = DateTime.DaysInMonth(year, month);
|
||||
|
||||
if (day < 1)
|
||||
day = 1;
|
||||
else if (day > maxDay)
|
||||
day = maxDay;
|
||||
|
||||
var normalDate = $"{day}/{(month >= 1 && month <= 9 ? $"0{month}" : month)}/{year}";
|
||||
if (DateTime.TryParseExact(normalDate, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime parsedDate))
|
||||
{
|
||||
return parsedDate;
|
||||
}
|
||||
|
||||
return DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
#region " Fields "
|
||||
|
||||
private readonly ApplicationDbContext _context;
|
||||
private readonly MetadataDbContext _contextMetadata;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly AmazonS3Client _s3Client;
|
||||
|
|
@ -29,10 +30,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
#region " Constructors "
|
||||
|
||||
public MinIOService(ApplicationDbContext context,
|
||||
MetadataDbContext contextMetadata,
|
||||
IConfiguration configuration,
|
||||
IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
_context = context;
|
||||
_contextMetadata = contextMetadata;
|
||||
_configuration = configuration;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
|
||||
|
|
@ -165,6 +168,101 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<Document> UploadImageFileAsync(IFormFile file, string newFileName = "")
|
||||
{
|
||||
var fileName = "";
|
||||
var fileExt = Path.GetExtension(file.FileName);
|
||||
if (newFileName != "")
|
||||
fileName = $"{newFileName}";
|
||||
else
|
||||
fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"');
|
||||
|
||||
var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp");
|
||||
if (!Directory.Exists(tmpDir))
|
||||
Directory.CreateDirectory(tmpDir);
|
||||
|
||||
var tmpFile = Path.Combine(tmpDir, $"tmp_{DateTime.Now.ToString("ddMMyyyyHHmmss")}{fileExt}");
|
||||
|
||||
try
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
var id = Guid.NewGuid();
|
||||
file.CopyTo(ms);
|
||||
var fileBytes = ms.ToArray();
|
||||
System.IO.MemoryStream filestream = new System.IO.MemoryStream(fileBytes);
|
||||
|
||||
var request = new PutObjectRequest
|
||||
{
|
||||
BucketName = _bucketName,
|
||||
Key = id.ToString("D"),
|
||||
InputStream = filestream,
|
||||
ContentType = file.ContentType,
|
||||
CannedACL = S3CannedACL.PublicRead
|
||||
};
|
||||
|
||||
await _s3Client.PutObjectAsync(request);
|
||||
|
||||
// create document object
|
||||
var doc = new Document()
|
||||
{
|
||||
FileName = fileName,
|
||||
FileType = file.ContentType,
|
||||
FileSize = Convert.ToInt32(file.Length),
|
||||
ObjectRefId = id,
|
||||
CreatedDate = DateTime.Now
|
||||
};
|
||||
// ãªé _contextMetadata à¾×èÍ Save ŧ½Ñè§ÃкººÃèØ
|
||||
await _contextMetadata.Documents.AddAsync(doc);
|
||||
await _contextMetadata.SaveChangesAsync();
|
||||
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(tmpFile);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<FormFile> GetImageToFormFileAsync(string refId)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var memoryStream = new MemoryStream();
|
||||
var request = new GetObjectRequest
|
||||
{
|
||||
BucketName = _bucketName,
|
||||
Key = refId
|
||||
};
|
||||
|
||||
using var response = await _s3Client.GetObjectAsync(request);
|
||||
using var responseStream = response.ResponseStream;
|
||||
|
||||
await responseStream.CopyToAsync(memoryStream);
|
||||
|
||||
var finalBytes = memoryStream.ToArray();
|
||||
|
||||
var finalStream = new MemoryStream(finalBytes);
|
||||
var fileName = Path.GetFileName(refId);
|
||||
var contentType = response.Headers.ContentType ?? "image/jpeg";
|
||||
|
||||
return new FormFile(finalStream, 0, finalStream.Length, "file", fileName)
|
||||
{
|
||||
Headers = new HeaderDictionary(),
|
||||
ContentType = contentType
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteFileAsync(Guid fileId)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
|
|
@ -2828,7 +2828,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
LastUpdateFullName = FullName ?? "",
|
||||
};
|
||||
await _contextMetadata.Placements.AddAsync(placement);
|
||||
foreach (var candidate in periodExam.Candidate.Where(x => x.Status == "done" && x.Pass == "ได้"))
|
||||
foreach (var candidate in periodExam.Candidate.Where(x => x.Status.Trim().ToUpper() == "DONE" && x.Pass?.Trim() == "ได้"))
|
||||
{
|
||||
var IsOfficer = false;
|
||||
dynamic org = null;
|
||||
|
|
@ -2959,6 +2959,19 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
posLevelIdOld = org?.result?.posLevelId ?? null,
|
||||
posLevelNameOld = org?.result?.posLevelName ?? null,
|
||||
};
|
||||
|
||||
if (candidate.ProfileImg != null && candidate.ProfileImg.ObjectRefId != null)
|
||||
{
|
||||
IFormFile imageFile = await _minioService.GetImageToFormFileAsync(candidate.ProfileImg.ObjectRefId.ToString());
|
||||
var doc = await _minioService.UploadImageFileAsync(imageFile, imageFile.FileName);
|
||||
var _doc = await _contextMetadata.Documents.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Id == doc.Id);
|
||||
if (_doc != null)
|
||||
{
|
||||
placementProfile.ProfileImg = _doc;
|
||||
}
|
||||
}
|
||||
|
||||
await _contextMetadata.PlacementProfiles.AddAsync(placementProfile);
|
||||
|
||||
foreach (var education in candidate.Educations)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue