ไม่ validate วันที่สมัครสอบ
This commit is contained in:
parent
a207e5077c
commit
c11b3b68ae
17 changed files with 3276 additions and 312 deletions
|
|
@ -362,17 +362,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
Id = x.Id.ToString(),
|
||||
Category = GetNameCategory(x.Category),
|
||||
CategoryId = x.Category,
|
||||
Start = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
End = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
ExamDate = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
Announcement_date = x.AnnouncementDate.ToString("yyyy-MM-dd"),
|
||||
Start = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
|
||||
End = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
|
||||
ExamDate = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
|
||||
Announcement_date = x.AnnouncementDate == null ? null : x.AnnouncementDate.Value.ToString("yyyy-MM-dd"),
|
||||
Announcement_startDate = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
|
||||
Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
|
||||
AnnouncementExam = x.AnnouncementExam,
|
||||
Register_startDate = x.RegisterStartDate.ToString("yyyy-MM-dd"),
|
||||
Register_endDate = x.RegisterEndDate.ToString("yyyy-MM-dd"),
|
||||
Payment_startDate = x.PaymentStartDate.ToString("yyyy-MM-dd"),
|
||||
Payment_endDate = x.PaymentEndDate.ToString("yyyy-MM-dd"),
|
||||
Register_startDate = x.RegisterStartDate == null ? null : x.RegisterStartDate.Value.ToString("yyyy-MM-dd"),
|
||||
Register_endDate = x.RegisterEndDate == null ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"),
|
||||
Payment_startDate = x.PaymentStartDate == null ? null : x.PaymentStartDate.Value.ToString("yyyy-MM-dd"),
|
||||
Payment_endDate = x.PaymentEndDate == null ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"),
|
||||
Title = x.Name,
|
||||
Image = x.PeriodExamImages.OrderBy(o => o.CreatedAt).FirstOrDefault() == null ?
|
||||
"" :
|
||||
|
|
@ -407,17 +407,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
Id = x.Id.ToString(),
|
||||
Category = GetNameCategory(x.Category),
|
||||
CategoryId = x.Category,
|
||||
Start = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
End = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
ExamDate = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
Announcement_date = x.AnnouncementDate.ToString("yyyy-MM-dd"),
|
||||
Start = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
|
||||
End = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
|
||||
ExamDate = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
|
||||
Announcement_date = x.AnnouncementDate == null ? null : x.AnnouncementDate.Value.ToString("yyyy-MM-dd"),
|
||||
Announcement_startDate = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
|
||||
Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
|
||||
AnnouncementExam = x.AnnouncementExam,
|
||||
Register_startDate = x.RegisterStartDate.ToString("yyyy-MM-dd"),
|
||||
Register_endDate = x.RegisterEndDate.ToString("yyyy-MM-dd"),
|
||||
Payment_startDate = x.PaymentStartDate.ToString("yyyy-MM-dd"),
|
||||
Payment_endDate = x.PaymentEndDate.ToString("yyyy-MM-dd"),
|
||||
Register_startDate = x.RegisterStartDate == null ? null : x.RegisterStartDate.Value.ToString("yyyy-MM-dd"),
|
||||
Register_endDate = x.RegisterEndDate == null ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"),
|
||||
Payment_startDate = x.PaymentStartDate == null ? null : x.PaymentStartDate.Value.ToString("yyyy-MM-dd"),
|
||||
Payment_endDate = x.PaymentEndDate == null ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"),
|
||||
Title = x.Name,
|
||||
Image = x.PeriodExamImages.OrderBy(o => o.CreatedAt).FirstOrDefault() == null ?
|
||||
"" :
|
||||
|
|
@ -454,15 +454,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
CategoryId = x.Category,
|
||||
Start = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
|
||||
End = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
|
||||
ExamDate = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
Announcement_date = x.AnnouncementDate.ToString("yyyy-MM-dd"),
|
||||
ExamDate = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
|
||||
Announcement_date = x.AnnouncementDate == null ? null : x.AnnouncementDate.Value.ToString("yyyy-MM-dd"),
|
||||
Announcement_startDate = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
|
||||
Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
|
||||
AnnouncementExam = x.AnnouncementExam,
|
||||
Register_startDate = x.RegisterStartDate.ToString("yyyy-MM-dd"),
|
||||
Register_endDate = x.RegisterEndDate.ToString("yyyy-MM-dd"),
|
||||
Payment_startDate = x.PaymentStartDate.ToString("yyyy-MM-dd"),
|
||||
Payment_endDate = x.PaymentEndDate.ToString("yyyy-MM-dd"),
|
||||
Register_startDate = x.RegisterStartDate == null ? null : x.RegisterStartDate.Value.ToString("yyyy-MM-dd"),
|
||||
Register_endDate = x.RegisterEndDate == null ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"),
|
||||
Payment_startDate = x.PaymentStartDate == null ? null : x.PaymentStartDate.Value.ToString("yyyy-MM-dd"),
|
||||
Payment_endDate = x.PaymentEndDate == null ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"),
|
||||
Title = x.Name,
|
||||
Detail = x.Detail,
|
||||
Images = x.PeriodExamImages.OrderBy(x => x.CreatedAt).Select(s => new HomePageLinkResponseItem
|
||||
|
|
@ -479,6 +479,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
{
|
||||
Id = s.Id.ToString(),
|
||||
Title = s.PositionName == null ? x.Name : s.PositionName,
|
||||
HighDegree = s.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี",
|
||||
Path = $"{x.Id}/{s.Id}",
|
||||
}).ToList(),
|
||||
})
|
||||
|
|
|
|||
|
|
@ -604,7 +604,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
|
||||
var candidatePosition = await _context.Candidates.AsQueryable()
|
||||
.Include(x => x.PositionExam)
|
||||
.FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId && x.Status != "register" && x.Status != "rejectRegister");
|
||||
.FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId && x.RegisterDate != null && x.Status != "register" && x.Status != "rejectRegister");
|
||||
|
||||
return new RequestStatusRegistry
|
||||
{
|
||||
|
|
@ -1731,6 +1731,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + exam.Name;
|
||||
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่ตรวจสอบข้อมูล";
|
||||
_mailService.SendMailToUser(subject, body, "ananda@frappet.com");
|
||||
if (candidate.RegisterDate == null)
|
||||
candidate.RegisterDate = DateTime.Now;
|
||||
}
|
||||
if (status == "checkPayment")
|
||||
{
|
||||
|
|
@ -1883,6 +1885,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
.Where(x => x.PeriodExam == exam && x.UserId == UserId)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
var positionName = "";
|
||||
var highDegree = "";
|
||||
if (positionId != "00000000-0000-0000-0000-000000000000")
|
||||
{
|
||||
var position = await _context.PositionExams.AsQueryable()
|
||||
|
|
@ -1894,6 +1898,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
candidate = await _context.Candidates.AsQueryable()
|
||||
.Where(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position)
|
||||
.FirstOrDefaultAsync();
|
||||
positionName = position.PositionName;
|
||||
highDegree = position.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี";
|
||||
}
|
||||
|
||||
if (candidate == null)
|
||||
|
|
@ -1918,8 +1924,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
Number = candidate.Number,
|
||||
ReviewPoint = candidate.ReviewPoint,
|
||||
Review = candidate.Review,
|
||||
AnnouncementDate = exam.AnnouncementDate.AddYears(2),
|
||||
AnnouncementDate = exam.AnnouncementDate?.AddYears(2),
|
||||
Id = candidate.Id,
|
||||
Position = positionName,
|
||||
HighDegree = highDegree,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -1933,6 +1941,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
if (candidate == null)
|
||||
throw new Exception(GlobalMessages.CandidateNotFound);
|
||||
|
||||
var positionName = "";
|
||||
var highDegree = "";
|
||||
if (candidate.PositionExam != null)
|
||||
{
|
||||
positionName = candidate.PositionExam.PositionName;
|
||||
highDegree = candidate.PositionExam.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี";
|
||||
}
|
||||
|
||||
return new RequestCardCandidate
|
||||
{
|
||||
Avatar = candidate.ProfileImg == null ? "" : _minioService.ImagesPath(candidate.ProfileImg.Id).Result,
|
||||
|
|
@ -1952,8 +1968,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
Number = candidate.Number,
|
||||
ReviewPoint = candidate.ReviewPoint,
|
||||
Review = candidate.Review,
|
||||
AnnouncementDate = candidate.PeriodExam?.AnnouncementDate.AddYears(2),
|
||||
AnnouncementDate = candidate.PeriodExam?.AnnouncementDate?.AddYears(2),
|
||||
Id = candidate.Id,
|
||||
Position = positionName,
|
||||
HighDegree = highDegree,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
TypeName = b.TypeName,
|
||||
PositionId = b.PositionId,
|
||||
PositionName = b.PositionName,
|
||||
HighDegree = b.HighDegree,
|
||||
}).ToList(),
|
||||
Documents = x.PeriodExamDocuments.OrderBy(o => o.CreatedAt).Select(b => new FileListResponse
|
||||
{
|
||||
|
|
@ -281,7 +282,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
Name = periodExam.Name,
|
||||
Round = periodExam.Round,
|
||||
Year = periodExam.Year,
|
||||
Status = DateTime.Now > periodExam.PaymentEndDate,
|
||||
Status = periodExam.PaymentEndDate == null ? true : DateTime.Now > periodExam.PaymentEndDate,
|
||||
SetSeat = periodExam.SetSeat,
|
||||
};
|
||||
}
|
||||
|
|
@ -380,6 +381,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
PeriodExam = periodExam,
|
||||
PositionId = position.PositionId,
|
||||
PositionName = position.PositionName,
|
||||
HighDegree = position.HighDegree,
|
||||
TypeId = position.TypeId,
|
||||
TypeName = position.TypeName,
|
||||
CreatedAt = DateTime.Now,
|
||||
|
|
@ -503,6 +505,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
{
|
||||
position.PositionId = positionData.PositionId;
|
||||
position.PositionName = positionData.PositionName;
|
||||
position.HighDegree = positionData.HighDegree;
|
||||
position.TypeId = positionData.TypeId;
|
||||
position.TypeName = positionData.TypeName;
|
||||
position.LastUpdatedAt = DateTime.Now;
|
||||
|
|
@ -533,6 +536,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
PeriodExam = periodExam,
|
||||
PositionId = position.PositionId,
|
||||
PositionName = position.PositionName,
|
||||
HighDegree = position.HighDegree,
|
||||
TypeId = position.TypeId,
|
||||
TypeName = position.TypeName,
|
||||
CreatedAt = DateTime.Now,
|
||||
|
|
@ -655,7 +659,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
var candidate = await _context.Candidates.AsQueryable()
|
||||
.Include(x => x.ProfileImg)
|
||||
.OrderByDescending(d => d.CreatedAt)
|
||||
.Where(x => x.PeriodExam == periodExam && x.Status != "register" && x.Status != "rejectRegister")
|
||||
.Where(x => x.PeriodExam == periodExam && x.RegisterDate != null && x.Status != "register" && x.Status != "rejectRegister")
|
||||
.ToListAsync();
|
||||
if (candidate.Where(x => x.Status == "done").FirstOrDefault() != null)
|
||||
candidate = candidate.OrderBy(x => Convert.ToInt32(x.Number)).ToList();
|
||||
|
|
@ -918,7 +922,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
|
||||
foreach (var candidate in candidates)
|
||||
{
|
||||
var item = items.FirstOrDefault(x => x.CitizenId == candidate.CitizenId && x.ExamIdenNumber.Trim().ToUpper() == candidate.ExamIdenNumber.Trim().ToUpper());
|
||||
if (candidate.ExamIdenNumber == null || candidate.CitizenId == null)
|
||||
continue;
|
||||
var item = items.FirstOrDefault(x => x.CitizenId == candidate.CitizenId && x.ExamIdenNumber == candidate.ExamIdenNumber);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
|
|
@ -974,6 +980,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
|
||||
foreach (var candidate in candidates)
|
||||
{
|
||||
if (candidate.ExamIdenNumber == null || candidate.CitizenId == null)
|
||||
continue;
|
||||
var item = items.FirstOrDefault(x => x.CitizenId == candidate.CitizenId && x.ExamIdenNumber == candidate.ExamIdenNumber);
|
||||
|
||||
if (item != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue