update issue #1529

This commit is contained in:
Bright 2025-06-11 17:46:14 +07:00
parent 9e21548d61
commit 9a7e654208

View file

@ -1071,75 +1071,75 @@ namespace BMA.EHR.Recruit.Service.Controllers
if (cell1 == "" || cell1 == null) break;
var r = new Models.Recruits.Recruit();
r.ExamId = workSheet?.Cells[row, 9999]?.GetValue<string>();
r.CitizenId = workSheet?.Cells[row, 0]?.GetValue<string>();
r.ExamId = workSheet?.Cells[row, 0]?.GetValue<string>();
r.CitizenId = workSheet?.Cells[row, 11]?.GetValue<string>();
r.Prefix = workSheet?.Cells[row, 4]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 5]?.GetValue<string>() : workSheet?.Cells[row, 4]?.GetValue<string>();
r.FirstName = workSheet?.Cells[row, 6]?.GetValue<string>();
r.LastName = workSheet?.Cells[row, 7]?.GetValue<string>();
r.Gendor = workSheet?.Cells[row, 9999]?.GetValue<string>();
r.National = workSheet?.Cells[row, 9999]?.GetValue<string>().IsNull("");
r.Gendor = workSheet?.Cells[row, 97]?.GetValue<string>();
r.National = workSheet?.Cells[row, 8]?.GetValue<string>().IsNull("");
r.Race = workSheet?.Cells[row, 9999]?.GetValue<string>().IsNull("");
r.Religion = workSheet?.Cells[row, 9999]?.GetValue<string>().IsNull("");
r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
r.Religion = workSheet?.Cells[row, 9]?.GetValue<string>().IsNull("");
r.DateOfBirth = Convert.ToDateTime(workSheet?.Cells[row, 10]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
r.Marry = workSheet?.Cells[row, 9999]?.GetValue<string>();
r.Isspecial = "N";
r.CitizenCardIssuer = workSheet?.Cells[row, 9999]?.GetValue<string>();
r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
r.ApplyDate = (DateTime)workSheet?.Cells[row, 9999]?.GetValue<DateTime>();
r.PositionName = workSheet?.Cells[row, 9999]?.GetValue<string>().IsNull("");
r.PositionName = workSheet?.Cells[row, 2]?.GetValue<string>().IsNull("");
r.PositionType = workSheet?.Cells[row, 9999]?.GetValue<string>().IsNull("");
r.PositionLevel = workSheet?.Cells[row, 9999]?.GetValue<string>().IsNull("");
// address
r.Addresses.Add(new RecruitAddress()
{
Address = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Moo = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Soi = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Road = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
District = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Amphur = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Province = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
ZipCode = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Telephone = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Mobile = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Address1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Moo1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Soi1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Road1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
District1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Amphur1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Province1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
ZipCode1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Address = $"{(workSheet?.Cells[row, 48]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 49]?.GetValue<string>() ?? "")}",
Moo = workSheet?.Cells[row, 50]?.GetValue<string>() ?? "",
Soi = workSheet?.Cells[row, 51]?.GetValue<string>() ?? "",
Road = workSheet?.Cells[row, 52]?.GetValue<string>() ?? "",
District = workSheet?.Cells[row, 53]?.GetValue<string>() ?? "",
Amphur = workSheet?.Cells[row, 54]?.GetValue<string>() ?? "",
Province = workSheet?.Cells[row, 55]?.GetValue<string>() ?? "",
ZipCode = workSheet?.Cells[row, 56]?.GetValue<string>() ?? "",
Telephone = workSheet?.Cells[row, 57]?.GetValue<string>() ?? "",
Mobile = workSheet?.Cells[row, 57]?.GetValue<string>() ?? "",
Address1 = $"{(workSheet?.Cells[row, 60]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 61]?.GetValue<string>() ?? "")}",
Moo1 = workSheet?.Cells[row, 62]?.GetValue<string>() ?? "",
Soi1 = workSheet?.Cells[row, 63]?.GetValue<string>() ?? "",
Road1 = workSheet?.Cells[row, 64]?.GetValue<string>() ?? "",
District1 = workSheet?.Cells[row, 65]?.GetValue<string>() ?? "",
Amphur1 = workSheet?.Cells[row, 66]?.GetValue<string>() ?? "",
Province1 = workSheet?.Cells[row, 67]?.GetValue<string>() ?? "",
ZipCode1 = workSheet?.Cells[row, 68]?.GetValue<string>() ?? "",
});
// payment
r.Payments.Add(new RecruitPayment()
{
PaymentId = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
CompanyCode = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
TextFile = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
BankCode = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
AccountNumber = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
TransDate = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
TransTime = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
CustomerName = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
RefNo1 = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
TermBranch = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
TellerId = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
CreditDebit = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
PaymentType = workSheet?.Cells[row, 9999]?.GetValue<string>(),
ChequeNo = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Amount = (decimal)workSheet?.Cells[row, 9999]?.GetValue<decimal>(),
ChqueBankCode = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? ""
PaymentId = workSheet?.Cells[row, 103]?.GetValue<string>() ?? "",
CompanyCode = workSheet?.Cells[row, 104]?.GetValue<string>() ?? "",
TextFile = workSheet?.Cells[row, 105]?.GetValue<string>() ?? "",
BankCode = workSheet?.Cells[row, 106]?.GetValue<string>() ?? "",
AccountNumber = workSheet?.Cells[row, 107]?.GetValue<string>() ?? "",
TransDate = workSheet?.Cells[row, 108]?.GetValue<string>() ?? "",
TransTime = workSheet?.Cells[row, 109]?.GetValue<string>() ?? "",
CustomerName = workSheet?.Cells[row, 110]?.GetValue<string>() ?? "",
RefNo1 = workSheet?.Cells[row, 111]?.GetValue<string>() ?? "",
TermBranch = workSheet?.Cells[row, 112]?.GetValue<string>() ?? "",
TellerId = workSheet?.Cells[row, 113]?.GetValue<string>() ?? "",
CreditDebit = workSheet?.Cells[row, 114]?.GetValue<string>() ?? "",
PaymentType = workSheet?.Cells[row, 115]?.GetValue<string>(),
ChequeNo = workSheet?.Cells[row, 116]?.GetValue<string>() ?? "",
Amount = (decimal)workSheet?.Cells[row, 117]?.GetValue<decimal>(),
ChqueBankCode = workSheet?.Cells[row, 118]?.GetValue<string>() ?? ""
});
// occupation
r.Occupations.Add(new RecruitOccupation()
{
Occupation = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Position = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Workplace = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Occupation = workSheet?.Cells[row, 32]?.GetValue<string>() ?? "",
Position = workSheet?.Cells[row, 36]?.GetValue<string>() ?? "",
Workplace = $"{(workSheet?.Cells[row, 35]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 34]?.GetValue<string>() ?? "")}",
Telephone = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
WorkAge = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
});
@ -1155,15 +1155,15 @@ namespace BMA.EHR.Recruit.Service.Controllers
r.Educations.Add(new RecruitEducation()
{
Degree = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
Degree = workSheet?.Cells[row, 17]?.GetValue<string>() ?? "",
Major = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
MajorGroupId = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
MajorGroupName = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
University = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
GPA = (double)workSheet?.Cells[row, 9999]?.GetValue<double>(),
University = workSheet?.Cells[row, 20]?.GetValue<string>() == "อื่น ๆ" ? workSheet?.Cells[row, 21]?.GetValue<string>() : workSheet?.Cells[row, 20]?.GetValue<string>(),
GPA = (double)workSheet?.Cells[row, 25]?.GetValue<double>(),
Specialist = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
HighDegree = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
BachelorDate = Convert.ToDateTime(workSheet?.Cells[row, 9999]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"))
HighDegree = workSheet?.Cells[row, 26]?.GetValue<string>() ?? "",
BachelorDate = Convert.ToDateTime(workSheet?.Cells[row, 24]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"))
});
r.RecruitImport = imported;