เพิ่มฟิวประเภทสมัครสอบ
This commit is contained in:
parent
e830632ac6
commit
c48534e474
9 changed files with 1862 additions and 258 deletions
|
|
@ -1008,6 +1008,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(5)
|
||||
.HasComment("วันเริ่มประกาศ");
|
||||
|
||||
b.Property<string>("Category")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("สำนัก");
|
||||
|
||||
b.Property<bool>("CheckDisability")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("คนพิการ");
|
||||
|
|
|
|||
1535
Migrations/20230412061126_update table PeriodExams add category.Designer.cs
generated
Normal file
1535
Migrations/20230412061126_update table PeriodExams add category.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,30 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Recurit.Exam.Service.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetablePeriodExamsaddcategory : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Category",
|
||||
table: "PeriodExams",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "สำนัก")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Category",
|
||||
table: "PeriodExams");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -75,6 +75,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
|
|||
[Comment("ประกาศนี้มีสมัครสอบคัดเลือก")]
|
||||
public bool AnnouncementExam { get; set; } = false;
|
||||
|
||||
[Comment("สำนัก")]
|
||||
public string? Category { get; set; }
|
||||
|
||||
[Comment("รายชื่อคนสม้ครในรอบ")]
|
||||
public List<Candidate> Candidate { get; set; } = new List<Candidate>();
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Request
|
|||
public string? OrganizationName { get; set; }
|
||||
public string? PaymentKrungThai { get; set; }
|
||||
public bool AnnouncementExam { get; set; }
|
||||
public string? Category { get; set; }
|
||||
public string? Detail { get; set; }
|
||||
public string? Note { get; set; }
|
||||
public List<FormFile>? Doc { get; set; }
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
|
|||
public string? OrganizationName { get; set; }
|
||||
public string? PaymentKrungThai { get; set; }
|
||||
public bool AnnouncementExam { get; set; }
|
||||
public string? Category { get; set; }
|
||||
public string? Detail { get; set; }
|
||||
public string? Note { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
|
|
|||
|
|
@ -60,6 +60,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
|
||||
#region " Methods "
|
||||
|
||||
public string GetNameCategory(string? category)
|
||||
{
|
||||
if (category == null)
|
||||
return "-";
|
||||
switch (category)
|
||||
{
|
||||
case "hygiene":
|
||||
return "สำนักอนามัย";
|
||||
case "physician":
|
||||
return "สำนักการแพทย์";
|
||||
case "city":
|
||||
return "สำนักผังเมือง";
|
||||
case "culture":
|
||||
return "สำนักวัฒนธรรม กีฬา และการท่องเที่ยว";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
public async Task<CMSCandidate> GetsAsync()
|
||||
{
|
||||
var cms = await createCMS();
|
||||
|
|
@ -341,8 +359,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
.Select(x => new CMSExamResponseItem
|
||||
{
|
||||
Id = x.Id.ToString(),
|
||||
Category = "doctor",
|
||||
Category_id = "doctor",
|
||||
Category = GetNameCategory(x.Category),
|
||||
Category_id = x.Category,
|
||||
Start = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
End = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
Exam_date = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
|
|
@ -385,8 +403,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
.Select(x => new CMSExamResponseItem
|
||||
{
|
||||
Id = x.Id.ToString(),
|
||||
Category = "doctor",
|
||||
Category_id = "doctor",
|
||||
Category = GetNameCategory(x.Category),
|
||||
Category_id = x.Category,
|
||||
Start = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
End = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
Exam_date = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
|
|
@ -429,10 +447,18 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
.Select(x => new CMSExamResponseItem
|
||||
{
|
||||
Id = x.Id.ToString(),
|
||||
Category = "doctor",
|
||||
Category_id = "doctor",
|
||||
Category = GetNameCategory(x.Category),
|
||||
Category_id = x.Category,
|
||||
Start = x.AnnouncementStartDate.ToString("yyyy-MM-dd"),
|
||||
End = x.AnnouncementEndDate.ToString("yyyy-MM-dd"),
|
||||
Exam_date = x.ExamDate.ToString("yyyy-MM-dd"),
|
||||
Announcement_date = 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"),
|
||||
Title = x.Name,
|
||||
Detail = x.Detail,
|
||||
Images = x.PeriodExamImages.OrderBy(x => x.CreatedAt).Select(s => new HomePageLinkResponseItem
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
PaymentEndDate = x.PaymentEndDate,
|
||||
PaymentKrungThai = x.PaymentKrungThai,
|
||||
AnnouncementExam = x.AnnouncementExam,
|
||||
Category = x.Category,
|
||||
PaymentStartDate = x.PaymentStartDate,
|
||||
RegisterEndDate = x.RegisterEndDate,
|
||||
RegisterStartDate = x.RegisterStartDate,
|
||||
|
|
@ -111,6 +112,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
PaymentEndDate = x.PaymentEndDate,
|
||||
PaymentKrungThai = x.PaymentKrungThai,
|
||||
AnnouncementExam = x.AnnouncementExam,
|
||||
Category = x.Category,
|
||||
PaymentStartDate = x.PaymentStartDate,
|
||||
RegisterEndDate = x.RegisterEndDate,
|
||||
RegisterStartDate = x.RegisterStartDate,
|
||||
|
|
@ -238,6 +240,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
OrganizationName = inserted.OrganizationName,
|
||||
PaymentKrungThai = inserted.PaymentKrungThai,
|
||||
AnnouncementExam = inserted.AnnouncementExam,
|
||||
Category = inserted.Category,
|
||||
Detail = inserted.Detail,
|
||||
Note = inserted.Note,
|
||||
CreatedAt = DateTime.Now,
|
||||
|
|
@ -323,6 +326,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
periodExam.OrganizationName = updated.OrganizationName;
|
||||
periodExam.PaymentKrungThai = updated.PaymentKrungThai;
|
||||
// periodExam.AnnouncementExam = updated.AnnouncementExam;
|
||||
periodExam.Category = updated.Category;
|
||||
periodExam.Detail = updated.Detail;
|
||||
periodExam.Note = updated.Note;
|
||||
periodExam.LastUpdatedAt = DateTime.Now;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue