ไม่ validate วันที่สมัครสอบ

This commit is contained in:
Kittapath 2023-06-01 15:49:25 +07:00
parent a207e5077c
commit c11b3b68ae
17 changed files with 3276 additions and 312 deletions

View file

@ -1686,7 +1686,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
Number = sr == null ? "" : sr.Number, Number = sr == null ? "" : sr.Number,
CitizenId = p.CitizenId, CitizenId = p.CitizenId,
ExamCount = 0, ExamCount = 0,
ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.AddYears(2).ToThaiShortDate(), ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.Value.AddYears(2).ToThaiShortDate(),
ScoreResult = sr == null ? null : new ScoreResult = sr == null ? null : new
{ {
ScoreAFull = sr.FullA, ScoreAFull = sr.FullA,
@ -1736,11 +1736,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
announcement_startDate = r.AnnouncementStartDate == null ? "" : r.AnnouncementStartDate.ToString("yyyy-mm-dd"), announcement_startDate = r.AnnouncementStartDate == null ? "" : r.AnnouncementStartDate.ToString("yyyy-mm-dd"),
announcement_endDate = r.AnnouncementEndDate == null ? "" : r.AnnouncementEndDate.ToString("yyyy-MM-dd"), announcement_endDate = r.AnnouncementEndDate == null ? "" : r.AnnouncementEndDate.ToString("yyyy-MM-dd"),
announcementExam = true, announcementExam = true,
register_startDate = r.RegisterStartDate == null ? "" : r.RegisterStartDate.ToString("yyyy-MM-dd"), register_startDate = r.RegisterStartDate == null ? "" : r.RegisterStartDate.Value.ToString("yyyy-MM-dd"),
register_endDate = r.RegisterEndDate == null ? "" : r.RegisterEndDate.ToString("yyyy-MM-dd"), register_endDate = r.RegisterEndDate == null ? "" : r.RegisterEndDate.Value.ToString("yyyy-MM-dd"),
payment_startDate = r.PaymentStartDate == null ? "" : r.PaymentStartDate.ToString("yyyy-MM-dd"), payment_startDate = r.PaymentStartDate == null ? "" : r.PaymentStartDate.Value.ToString("yyyy-MM-dd"),
payment_endDate = r.PaymentEndDate == null ? "" : r.PaymentEndDate.ToString("yyyy-MM-dd"), payment_endDate = r.PaymentEndDate == null ? "" : r.PaymentEndDate.Value.ToString("yyyy-MM-dd"),
exam_date = r.ExamDate == null ? "" : r.ExamDate.ToString("yyyy-MM-dd") exam_date = r.ExamDate == null ? "" : r.ExamDate.Value.ToString("yyyy-MM-dd")
}) })
.ToList(); .ToList();

View file

@ -99,7 +99,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
Year = p.PeriodExam.Year.Value.ToThaiYear(), Year = p.PeriodExam.Year.Value.ToThaiYear(),
FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", FullName = $"{p.Prefix}{p.FirstName} {p.LastName}",
ExamResult = sr == null ? "" : sr.ExamStatus, ExamResult = sr == null ? "" : sr.ExamStatus,
EndDate = p.PeriodExam.RegisterEndDate.ToThaiFullDate3(), EndDate = p.PeriodExam.RegisterEndDate == null ? null : p.PeriodExam.RegisterEndDate.Value.ToThaiFullDate3(),
AuthName = "นายณัฐพงศ์ ดิษยบุตร", AuthName = "นายณัฐพงศ์ ดิษยบุตร",
AuthPosition = "หัวหน้าสำนักงาน ก.ก." AuthPosition = "หัวหน้าสำนักงาน ก.ก."
}) })
@ -181,7 +181,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
Number = sr == null ? "" : sr.Number, Number = sr == null ? "" : sr.Number,
// ExamCount = 10, // ExamCount = 10,
// ExamCount = GetExamCountTes(p.CitizenId), // ExamCount = GetExamCountTes(p.CitizenId),
ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.AddYears(2).ToThaiShortDate(), ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.Value.AddYears(2).ToThaiShortDate(),
FullA = sr == null ? 0 : sr.FullA, FullA = sr == null ? 0 : sr.FullA,
SumA = sr == null ? 0 : sr.SumA, SumA = sr == null ? 0 : sr.SumA,
FullB = sr == null ? 0 : sr.FullB, FullB = sr == null ? 0 : sr.FullB,

View file

@ -704,6 +704,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnType("varchar(10)") .HasColumnType("varchar(10)")
.HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน"); .HasComment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน");
b.Property<DateTime?>("RegisterDate")
.HasMaxLength(40)
.HasColumnType("datetime(6)")
.HasComment("วันที่สมัคร");
b.Property<string>("RejectDetail") b.Property<string>("RejectDetail")
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("เหตุผลการไม่อนุมัติ"); .HasComment("เหตุผลการไม่อนุมัติ");
@ -2128,7 +2133,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasComment("PrimaryKey") .HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id"); .HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<DateTime>("AnnouncementDate") b.Property<DateTime?>("AnnouncementDate")
.IsRequired()
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnOrder(5) .HasColumnOrder(5)
.HasComment("วันประกาศผลสอบ"); .HasComment("วันประกาศผลสอบ");
@ -2182,7 +2188,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("รายละเอียดสมัครสอบ"); .HasComment("รายละเอียดสมัครสอบ");
b.Property<DateTime>("ExamDate") b.Property<DateTime?>("ExamDate")
.IsRequired()
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasComment("วันที่สอบ"); .HasComment("วันที่สอบ");
@ -2243,7 +2250,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("ชื่อหน่วยงาน"); .HasComment("ชื่อหน่วยงาน");
b.Property<DateTime>("PaymentEndDate") b.Property<DateTime?>("PaymentEndDate")
.IsRequired()
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnOrder(4) .HasColumnOrder(4)
.HasComment("วันสิ้นสุดชำระเงิน"); .HasComment("วันสิ้นสุดชำระเงิน");
@ -2252,17 +2260,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnType("longtext") .HasColumnType("longtext")
.HasComment("ชำระเงินผ่านกรุงไทย"); .HasComment("ชำระเงินผ่านกรุงไทย");
b.Property<DateTime>("PaymentStartDate") b.Property<DateTime?>("PaymentStartDate")
.IsRequired()
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnOrder(3) .HasColumnOrder(3)
.HasComment("วันเริ่มชำระเงิน"); .HasComment("วันเริ่มชำระเงิน");
b.Property<DateTime>("RegisterEndDate") b.Property<DateTime?>("RegisterEndDate")
.IsRequired()
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnOrder(2) .HasColumnOrder(2)
.HasComment("วันสิ้นสุดสมัครสอบ"); .HasComment("วันสิ้นสุดสมัครสอบ");
b.Property<DateTime>("RegisterStartDate") b.Property<DateTime?>("RegisterStartDate")
.IsRequired()
.HasColumnType("datetime(6)") .HasColumnType("datetime(6)")
.HasColumnOrder(1) .HasColumnOrder(1)
.HasComment("วันเริ่มสมัครสอบ"); .HasComment("วันเริ่มสมัครสอบ");
@ -2449,6 +2460,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(101) .HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล"); .HasComment("User Id ที่สร้างข้อมูล");
b.Property<bool>("HighDegree")
.HasColumnType("tinyint(1)")
.HasComment("ปริญญาขึ้นไป");
b.Property<bool>("IsActive") b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)") .HasColumnType("tinyint(1)")
.HasColumnOrder(106) .HasColumnOrder(106)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
/// <inheritdoc />
public partial class updatetablecandidateaddhighdegree : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "HighDegree",
table: "PositionExams",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "ปริญญาขึ้นไป");
migrationBuilder.AddColumn<DateTime>(
name: "RegisterDate",
table: "Candidates",
type: "datetime(6)",
maxLength: 40,
nullable: true,
comment: "วันที่สมัคร");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "HighDegree",
table: "PositionExams");
migrationBuilder.DropColumn(
name: "RegisterDate",
table: "Candidates");
}
}
}

View file

@ -252,5 +252,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
[Comment("ข้อแนะนำ")] [Comment("ข้อแนะนำ")]
public string? Review { get; set; } public string? Review { get; set; }
[MaxLength(40), Comment("วันที่สมัคร")]
public DateTime? RegisterDate { get; set; }
} }
} }

View file

@ -27,19 +27,19 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public float? Fee { get; set; } = 0; public float? Fee { get; set; } = 0;
[Required, Column(Order = 1), Comment("วันเริ่มสมัครสอบ")] [Required, Column(Order = 1), Comment("วันเริ่มสมัครสอบ")]
public DateTime RegisterStartDate { get; set; } = DateTime.Now.Date; public DateTime? RegisterStartDate { get; set; }
[Required, Column(Order = 2), Comment("วันสิ้นสุดสมัครสอบ")] [Required, Column(Order = 2), Comment("วันสิ้นสุดสมัครสอบ")]
public DateTime RegisterEndDate { get; set; } = DateTime.Now.Date; public DateTime? RegisterEndDate { get; set; }
[Required, Column(Order = 3), Comment("วันเริ่มชำระเงิน")] [Required, Column(Order = 3), Comment("วันเริ่มชำระเงิน")]
public DateTime PaymentStartDate { get; set; } = DateTime.Now.Date; public DateTime? PaymentStartDate { get; set; }
[Required, Column(Order = 4), Comment("วันสิ้นสุดชำระเงิน")] [Required, Column(Order = 4), Comment("วันสิ้นสุดชำระเงิน")]
public DateTime PaymentEndDate { get; set; } = DateTime.Now.Date; public DateTime? PaymentEndDate { get; set; }
[Required, Column(Order = 5), Comment("วันประกาศผลสอบ")] [Required, Column(Order = 5), Comment("วันประกาศผลสอบ")]
public DateTime AnnouncementDate { get; set; } = DateTime.Now.Date; public DateTime? AnnouncementDate { get; set; }
[Required, Column(Order = 6), Comment("วันเริ่มประกาศ")] [Required, Column(Order = 6), Comment("วันเริ่มประกาศ")]
public DateTime AnnouncementStartDate { get; set; } = DateTime.Now.Date; public DateTime AnnouncementStartDate { get; set; } = DateTime.Now.Date;
@ -48,7 +48,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public DateTime AnnouncementEndDate { get; set; } = DateTime.Now.Date; public DateTime AnnouncementEndDate { get; set; } = DateTime.Now.Date;
[Required, Comment("วันที่สอบ")] [Required, Comment("วันที่สอบ")]
public DateTime ExamDate { get; set; } = DateTime.Now.Date; public DateTime? ExamDate { get; set; }
[Comment("Id รหัสส่วนราชการ")] [Comment("Id รหัสส่วนราชการ")]
public Guid? OrganizationCodeId { get; set; } public Guid? OrganizationCodeId { get; set; }

View file

@ -21,5 +21,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
[Comment("ชื่อประเภทแบบฟอร์ม")] [Comment("ชื่อประเภทแบบฟอร์ม")]
public string? TypeName { get; set; } public string? TypeName { get; set; }
[Comment("ปริญญาขึ้นไป")]
public bool HighDegree { get; set; }
} }
} }

View file

@ -22,6 +22,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Request
public string? Number { get; set; } public string? Number { get; set; }
public int? ReviewPoint { get; set; } public int? ReviewPoint { get; set; }
public string? Review { get; set; } public string? Review { get; set; }
public string? Position { get; set; }
public string? HighDegree { get; set; }
public DateTime? AnnouncementDate { get; set; } public DateTime? AnnouncementDate { get; set; }
public Guid? Id { get; set; } public Guid? Id { get; set; }
} }

View file

@ -10,14 +10,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Request
public int? Round { get; set; } public int? Round { get; set; }
public int? Year { get; set; } public int? Year { get; set; }
public float? Fee { get; set; } = 0; public float? Fee { get; set; } = 0;
public DateTime RegisterStartDate { get; set; } = DateTime.Now.Date; public DateTime? RegisterStartDate { get; set; }
public DateTime RegisterEndDate { get; set; } = DateTime.Now.Date; public DateTime? RegisterEndDate { get; set; }
public DateTime PaymentStartDate { get; set; } = DateTime.Now.Date; public DateTime? PaymentStartDate { get; set; }
public DateTime PaymentEndDate { get; set; } = DateTime.Now.Date; public DateTime? PaymentEndDate { get; set; }
public DateTime AnnouncementStartDate { get; set; } = DateTime.Now.Date; public DateTime AnnouncementStartDate { get; set; } = DateTime.Now.Date;
public DateTime AnnouncementEndDate { get; set; } = DateTime.Now.Date; public DateTime AnnouncementEndDate { get; set; } = DateTime.Now.Date;
public DateTime AnnouncementDate { get; set; } = DateTime.Now.Date; public DateTime? AnnouncementDate { get; set; }
public DateTime ExamDate { get; set; } = DateTime.Now.Date; public DateTime? ExamDate { get; set; }
public Guid? OrganizationCodeId { get; set; } public Guid? OrganizationCodeId { get; set; }
public string? OrganizationCodeName { get; set; } public string? OrganizationCodeName { get; set; }
public Guid? OrganizationId { get; set; } public Guid? OrganizationId { get; set; }

View file

@ -7,6 +7,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Request
public Guid? Id { get; set; } public Guid? Id { get; set; }
public Guid? PositionId { get; set; } public Guid? PositionId { get; set; }
public string? PositionName { get; set; } public string? PositionName { get; set; }
public bool HighDegree { get; set; }
public string? TypeId { get; set; } public string? TypeId { get; set; }
public string? TypeName { get; set; } public string? TypeName { get; set; }
} }

View file

@ -20,5 +20,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
public string? Url { get; set; } public string? Url { get; set; }
public string? Id { get; set; } public string? Id { get; set; }
public string? Path { get; set; } public string? Path { get; set; }
public string? HighDegree { get; set; }
} }
} }

View file

@ -14,14 +14,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
public Guid? OcId { get; set; } public Guid? OcId { get; set; }
public string CreatedUserId { get; set; } public string CreatedUserId { get; set; }
public float? Fee { get; set; } public float? Fee { get; set; }
public DateTime RegisterStartDate { get; set; } public DateTime? RegisterStartDate { get; set; }
public DateTime RegisterEndDate { get; set; } public DateTime? RegisterEndDate { get; set; }
public DateTime PaymentStartDate { get; set; } public DateTime? PaymentStartDate { get; set; }
public DateTime PaymentEndDate { get; set; } public DateTime? PaymentEndDate { get; set; }
public DateTime AnnouncementStartDate { get; set; } public DateTime AnnouncementStartDate { get; set; }
public DateTime AnnouncementEndDate { get; set; } public DateTime AnnouncementEndDate { get; set; }
public DateTime AnnouncementDate { get; set; } public DateTime? AnnouncementDate { get; set; }
public DateTime ExamDate { get; set; } public DateTime? ExamDate { get; set; }
public Guid? OrganizationCodeId { get; set; } public Guid? OrganizationCodeId { get; set; }
public string? OrganizationCodeName { get; set; } public string? OrganizationCodeName { get; set; }
public Guid? OrganizationId { get; set; } public Guid? OrganizationId { get; set; }

View file

@ -362,17 +362,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Id = x.Id.ToString(), Id = x.Id.ToString(),
Category = GetNameCategory(x.Category), Category = GetNameCategory(x.Category),
CategoryId = x.Category, CategoryId = x.Category,
Start = x.ExamDate.ToString("yyyy-MM-dd"), Start = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
End = x.ExamDate.ToString("yyyy-MM-dd"), End = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
ExamDate = x.ExamDate.ToString("yyyy-MM-dd"), ExamDate = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
Announcement_date = x.AnnouncementDate.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_startDate = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"), Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
AnnouncementExam = x.AnnouncementExam, AnnouncementExam = x.AnnouncementExam,
Register_startDate = x.RegisterStartDate.ToString("yyyy-MM-dd"), Register_startDate = x.RegisterStartDate == null ? null : x.RegisterStartDate.Value.ToString("yyyy-MM-dd"),
Register_endDate = x.RegisterEndDate.ToString("yyyy-MM-dd"), Register_endDate = x.RegisterEndDate == null ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"),
Payment_startDate = x.PaymentStartDate.ToString("yyyy-MM-dd"), Payment_startDate = x.PaymentStartDate == null ? null : x.PaymentStartDate.Value.ToString("yyyy-MM-dd"),
Payment_endDate = x.PaymentEndDate.ToString("yyyy-MM-dd"), Payment_endDate = x.PaymentEndDate == null ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"),
Title = x.Name, Title = x.Name,
Image = x.PeriodExamImages.OrderBy(o => o.CreatedAt).FirstOrDefault() == null ? Image = x.PeriodExamImages.OrderBy(o => o.CreatedAt).FirstOrDefault() == null ?
"" : "" :
@ -407,17 +407,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Id = x.Id.ToString(), Id = x.Id.ToString(),
Category = GetNameCategory(x.Category), Category = GetNameCategory(x.Category),
CategoryId = x.Category, CategoryId = x.Category,
Start = x.ExamDate.ToString("yyyy-MM-dd"), Start = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
End = x.ExamDate.ToString("yyyy-MM-dd"), End = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
ExamDate = x.ExamDate.ToString("yyyy-MM-dd"), ExamDate = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
Announcement_date = x.AnnouncementDate.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_startDate = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"), Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
AnnouncementExam = x.AnnouncementExam, AnnouncementExam = x.AnnouncementExam,
Register_startDate = x.RegisterStartDate.ToString("yyyy-MM-dd"), Register_startDate = x.RegisterStartDate == null ? null : x.RegisterStartDate.Value.ToString("yyyy-MM-dd"),
Register_endDate = x.RegisterEndDate.ToString("yyyy-MM-dd"), Register_endDate = x.RegisterEndDate == null ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"),
Payment_startDate = x.PaymentStartDate.ToString("yyyy-MM-dd"), Payment_startDate = x.PaymentStartDate == null ? null : x.PaymentStartDate.Value.ToString("yyyy-MM-dd"),
Payment_endDate = x.PaymentEndDate.ToString("yyyy-MM-dd"), Payment_endDate = x.PaymentEndDate == null ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"),
Title = x.Name, Title = x.Name,
Image = x.PeriodExamImages.OrderBy(o => o.CreatedAt).FirstOrDefault() == null ? Image = x.PeriodExamImages.OrderBy(o => o.CreatedAt).FirstOrDefault() == null ?
"" : "" :
@ -454,15 +454,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
CategoryId = x.Category, CategoryId = x.Category,
Start = x.AnnouncementStartDate.ToString("yyyy-MM-dd"), Start = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
End = x.AnnouncementEndDate.ToString("yyyy-MM-dd"), End = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
ExamDate = x.ExamDate.ToString("yyyy-MM-dd"), ExamDate = x.ExamDate == null ? null : x.ExamDate.Value.ToString("yyyy-MM-dd"),
Announcement_date = x.AnnouncementDate.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_startDate = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"), Announcement_endDate = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
AnnouncementExam = x.AnnouncementExam, AnnouncementExam = x.AnnouncementExam,
Register_startDate = x.RegisterStartDate.ToString("yyyy-MM-dd"), Register_startDate = x.RegisterStartDate == null ? null : x.RegisterStartDate.Value.ToString("yyyy-MM-dd"),
Register_endDate = x.RegisterEndDate.ToString("yyyy-MM-dd"), Register_endDate = x.RegisterEndDate == null ? null : x.RegisterEndDate.Value.ToString("yyyy-MM-dd"),
Payment_startDate = x.PaymentStartDate.ToString("yyyy-MM-dd"), Payment_startDate = x.PaymentStartDate == null ? null : x.PaymentStartDate.Value.ToString("yyyy-MM-dd"),
Payment_endDate = x.PaymentEndDate.ToString("yyyy-MM-dd"), Payment_endDate = x.PaymentEndDate == null ? null : x.PaymentEndDate.Value.ToString("yyyy-MM-dd"),
Title = x.Name, Title = x.Name,
Detail = x.Detail, Detail = x.Detail,
Images = x.PeriodExamImages.OrderBy(x => x.CreatedAt).Select(s => new HomePageLinkResponseItem 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(), Id = s.Id.ToString(),
Title = s.PositionName == null ? x.Name : s.PositionName, Title = s.PositionName == null ? x.Name : s.PositionName,
HighDegree = s.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี",
Path = $"{x.Id}/{s.Id}", Path = $"{x.Id}/{s.Id}",
}).ToList(), }).ToList(),
}) })

View file

@ -604,7 +604,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var candidatePosition = await _context.Candidates.AsQueryable() var candidatePosition = await _context.Candidates.AsQueryable()
.Include(x => x.PositionExam) .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 return new RequestStatusRegistry
{ {
@ -1731,6 +1731,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + exam.Name; var subject = "แจ้งผลการสมัครสอบคัดเลือก " + exam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่ตรวจสอบข้อมูล"; var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่ตรวจสอบข้อมูล";
_mailService.SendMailToUser(subject, body, "ananda@frappet.com"); _mailService.SendMailToUser(subject, body, "ananda@frappet.com");
if (candidate.RegisterDate == null)
candidate.RegisterDate = DateTime.Now;
} }
if (status == "checkPayment") if (status == "checkPayment")
{ {
@ -1883,6 +1885,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
.Where(x => x.PeriodExam == exam && x.UserId == UserId) .Where(x => x.PeriodExam == exam && x.UserId == UserId)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
var positionName = "";
var highDegree = "";
if (positionId != "00000000-0000-0000-0000-000000000000") if (positionId != "00000000-0000-0000-0000-000000000000")
{ {
var position = await _context.PositionExams.AsQueryable() var position = await _context.PositionExams.AsQueryable()
@ -1894,6 +1898,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
candidate = await _context.Candidates.AsQueryable() candidate = await _context.Candidates.AsQueryable()
.Where(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position) .Where(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();
positionName = position.PositionName;
highDegree = position.HighDegree == true ? "ปริญญาขึ้นไป" : "ต่ำกว่าปริญญาตรี";
} }
if (candidate == null) if (candidate == null)
@ -1918,8 +1924,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Number = candidate.Number, Number = candidate.Number,
ReviewPoint = candidate.ReviewPoint, ReviewPoint = candidate.ReviewPoint,
Review = candidate.Review, Review = candidate.Review,
AnnouncementDate = exam.AnnouncementDate.AddYears(2), AnnouncementDate = exam.AnnouncementDate?.AddYears(2),
Id = candidate.Id, Id = candidate.Id,
Position = positionName,
HighDegree = highDegree,
}; };
} }
@ -1933,6 +1941,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (candidate == null) if (candidate == null)
throw new Exception(GlobalMessages.CandidateNotFound); 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 return new RequestCardCandidate
{ {
Avatar = candidate.ProfileImg == null ? "" : _minioService.ImagesPath(candidate.ProfileImg.Id).Result, Avatar = candidate.ProfileImg == null ? "" : _minioService.ImagesPath(candidate.ProfileImg.Id).Result,
@ -1952,8 +1968,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Number = candidate.Number, Number = candidate.Number,
ReviewPoint = candidate.ReviewPoint, ReviewPoint = candidate.ReviewPoint,
Review = candidate.Review, Review = candidate.Review,
AnnouncementDate = candidate.PeriodExam?.AnnouncementDate.AddYears(2), AnnouncementDate = candidate.PeriodExam?.AnnouncementDate?.AddYears(2),
Id = candidate.Id, Id = candidate.Id,
Position = positionName,
HighDegree = highDegree,
}; };
} }

View file

@ -227,6 +227,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
TypeName = b.TypeName, TypeName = b.TypeName,
PositionId = b.PositionId, PositionId = b.PositionId,
PositionName = b.PositionName, PositionName = b.PositionName,
HighDegree = b.HighDegree,
}).ToList(), }).ToList(),
Documents = x.PeriodExamDocuments.OrderBy(o => o.CreatedAt).Select(b => new FileListResponse 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, Name = periodExam.Name,
Round = periodExam.Round, Round = periodExam.Round,
Year = periodExam.Year, Year = periodExam.Year,
Status = DateTime.Now > periodExam.PaymentEndDate, Status = periodExam.PaymentEndDate == null ? true : DateTime.Now > periodExam.PaymentEndDate,
SetSeat = periodExam.SetSeat, SetSeat = periodExam.SetSeat,
}; };
} }
@ -380,6 +381,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
PeriodExam = periodExam, PeriodExam = periodExam,
PositionId = position.PositionId, PositionId = position.PositionId,
PositionName = position.PositionName, PositionName = position.PositionName,
HighDegree = position.HighDegree,
TypeId = position.TypeId, TypeId = position.TypeId,
TypeName = position.TypeName, TypeName = position.TypeName,
CreatedAt = DateTime.Now, CreatedAt = DateTime.Now,
@ -503,6 +505,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
{ {
position.PositionId = positionData.PositionId; position.PositionId = positionData.PositionId;
position.PositionName = positionData.PositionName; position.PositionName = positionData.PositionName;
position.HighDegree = positionData.HighDegree;
position.TypeId = positionData.TypeId; position.TypeId = positionData.TypeId;
position.TypeName = positionData.TypeName; position.TypeName = positionData.TypeName;
position.LastUpdatedAt = DateTime.Now; position.LastUpdatedAt = DateTime.Now;
@ -533,6 +536,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
PeriodExam = periodExam, PeriodExam = periodExam,
PositionId = position.PositionId, PositionId = position.PositionId,
PositionName = position.PositionName, PositionName = position.PositionName,
HighDegree = position.HighDegree,
TypeId = position.TypeId, TypeId = position.TypeId,
TypeName = position.TypeName, TypeName = position.TypeName,
CreatedAt = DateTime.Now, CreatedAt = DateTime.Now,
@ -655,7 +659,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var candidate = await _context.Candidates.AsQueryable() var candidate = await _context.Candidates.AsQueryable()
.Include(x => x.ProfileImg) .Include(x => x.ProfileImg)
.OrderByDescending(d => d.CreatedAt) .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(); .ToListAsync();
if (candidate.Where(x => x.Status == "done").FirstOrDefault() != null) if (candidate.Where(x => x.Status == "done").FirstOrDefault() != null)
candidate = candidate.OrderBy(x => Convert.ToInt32(x.Number)).ToList(); 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) 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) if (item != null)
{ {
@ -974,6 +980,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
foreach (var candidate in candidates) 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); var item = items.FirstOrDefault(x => x.CitizenId == candidate.CitizenId && x.ExamIdenNumber == candidate.ExamIdenNumber);
if (item != null) if (item != null)

File diff suppressed because it is too large Load diff