เพิ่มฟอร์มชำระเงิน
This commit is contained in:
parent
47d0f72f30
commit
1cfa4336fd
11 changed files with 3906 additions and 107 deletions
|
|
@ -260,6 +260,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
{
|
||||
await _periodExamService.UpdateImgAsync(examId, files);
|
||||
}
|
||||
else if (type == "barcode")
|
||||
{
|
||||
await _periodExamService.UpdateBarcodeAsync(examId, files);
|
||||
}
|
||||
else if (type == "qrcode")
|
||||
{
|
||||
await _periodExamService.UpdateQrcodeAsync(examId, files);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _periodExamService.UpdateDocAsync(examId, files);
|
||||
|
|
@ -735,7 +743,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
|
||||
//string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx";
|
||||
//return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName);
|
||||
|
||||
|
||||
var data = await _periodExamService.NewDownloadCandidateAsync(examId);
|
||||
return Success(data);
|
||||
}
|
||||
|
|
@ -765,7 +773,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
|
||||
//string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx";
|
||||
//return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName);
|
||||
|
||||
|
||||
var data = await _periodExamService.NewDownloadCandidateAllAsync(examId);
|
||||
return Success(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data
|
|||
public DbSet<PeriodExamDocument> PeriodExamDocuments { get; set; }
|
||||
|
||||
public DbSet<PeriodExamImage> PeriodExamImages { get; set; }
|
||||
public DbSet<PeriodExamBarCode> PeriodExamBarCodes { get; set; }
|
||||
public DbSet<PeriodExamQrCode> PeriodExamQrCodes { get; set; }
|
||||
|
||||
public DbSet<CMSCandidate> CMSCandidates { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -59,11 +59,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -124,11 +119,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -214,11 +204,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("อำเภอ");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -319,11 +304,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -520,11 +500,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(1)
|
||||
.HasComment("ชื่อจริง");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("Knowledge")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ความสามารถพิเศษ");
|
||||
|
|
@ -892,11 +867,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<Guid>("DocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -971,11 +941,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(4)
|
||||
.HasComment("กลุ่ม/ฝ่าย");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -1096,11 +1061,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasMaxLength(20)
|
||||
.HasColumnType("varchar(20)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("Isspecial")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1)
|
||||
|
|
@ -1253,11 +1213,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -1388,11 +1343,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<DateTime>("ExpiredDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<DateTime>("IssueDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
|
|
@ -1459,11 +1409,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<Guid>("DocumentFileId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -1539,11 +1484,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -1629,11 +1569,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(1)
|
||||
.HasComment("รายละเอียดการนำเข้า");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -1694,11 +1629,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<Guid>("DisableId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -1819,11 +1749,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<Guid>("DisableId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -1957,11 +1882,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<int>("FullC")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -2054,11 +1974,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<Guid>("ImportFileId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -2199,11 +2114,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnType("longtext")
|
||||
.HasComment("ประเภทสถานศึกษา");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -2270,6 +2180,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("ตรวจสอบเอกสารหลังประกาศผลสอบ");
|
||||
|
||||
b.Property<string>("CompanyCode")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("Company code");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
|
|
@ -2289,6 +2203,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CustomerName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("Customer name");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("รายละเอียดสมัครสอบ");
|
||||
|
|
@ -2376,6 +2294,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(3)
|
||||
.HasComment("วันเริ่มชำระเงิน");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.HasColumnType("text")
|
||||
.HasComment("หมายเหตุ");
|
||||
|
||||
b.Property<string>("RefNo1")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("Ref No1");
|
||||
|
||||
b.Property<DateTime?>("RegisterEndDate")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(2)
|
||||
|
|
@ -2386,6 +2312,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(1)
|
||||
.HasComment("วันเริ่มสมัครสอบ");
|
||||
|
||||
b.Property<string>("Remark")
|
||||
.HasColumnType("text")
|
||||
.HasComment("remark");
|
||||
|
||||
b.Property<int?>("Round")
|
||||
.HasColumnType("int")
|
||||
.HasColumnOrder(9)
|
||||
|
|
@ -2406,6 +2336,68 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.ToTable("PeriodExams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamBarCode", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<Guid>("DocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<Guid>("PeriodExamId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DocumentId");
|
||||
|
||||
b.HasIndex("PeriodExamId");
|
||||
|
||||
b.ToTable("PeriodExamBarCodes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -2437,11 +2429,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<Guid>("DocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -2504,11 +2491,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Property<Guid>("DocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -2540,6 +2522,68 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.ToTable("PeriodExamImages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamQrCode", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<Guid>("DocumentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<Guid>("PeriodExamId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DocumentId");
|
||||
|
||||
b.HasIndex("PeriodExamId");
|
||||
|
||||
b.ToTable("PeriodExamQrCodes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -2576,11 +2620,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("ปริญญาบัตรขึ้นไป");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(106)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
|
@ -2886,6 +2925,25 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Navigation("ImportFile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamBarCode", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document")
|
||||
.WithMany()
|
||||
.HasForeignKey("DocumentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam")
|
||||
.WithMany("PeriodExamBarCodes")
|
||||
.HasForeignKey("PeriodExamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Document");
|
||||
|
||||
b.Navigation("PeriodExam");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document")
|
||||
|
|
@ -2924,6 +2982,25 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Navigation("PeriodExam");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamQrCode", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "Document")
|
||||
.WithMany()
|
||||
.HasForeignKey("DocumentId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam")
|
||||
.WithMany("PeriodExamQrCodes")
|
||||
.HasForeignKey("PeriodExamId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Document");
|
||||
|
||||
b.Navigation("PeriodExam");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PositionExam", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam")
|
||||
|
|
@ -2979,10 +3056,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
|
||||
b.Navigation("ImportHostories");
|
||||
|
||||
b.Navigation("PeriodExamBarCodes");
|
||||
|
||||
b.Navigation("PeriodExamDocuments");
|
||||
|
||||
b.Navigation("PeriodExamImages");
|
||||
|
||||
b.Navigation("PeriodExamQrCodes");
|
||||
|
||||
b.Navigation("PositionExam");
|
||||
|
||||
b.Navigation("ScoreImport");
|
||||
|
|
|
|||
3077
Migrations/20250127060832_update table period add qrcode.Designer.cs
generated
Normal file
3077
Migrations/20250127060832_update table period add qrcode.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
450
Migrations/20250127060832_update table period add qrcode.cs
Normal file
450
Migrations/20250127060832_update table period add qrcode.cs
Normal file
|
|
@ -0,0 +1,450 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Recurit.Exam.Service.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatetableperiodaddqrcode : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "ScoreImports");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "PositionExams");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "PeriodExamImages");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "PeriodExamDocuments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "Educations");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisableScores");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "Disables");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisablePayments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisableOccupations");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisableImportHistories");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisableEducations");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisableDocuments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisableCertificates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "DisableAddresses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "CMSGovernments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "CMSCandidates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "CMSAgencys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "Careers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "Candidates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "CandidateDocuments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsActive",
|
||||
table: "BankExams");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CompanyCode",
|
||||
table: "PeriodExams",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "Company code")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CustomerName",
|
||||
table: "PeriodExams",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "Customer name")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Reason",
|
||||
table: "PeriodExams",
|
||||
type: "text",
|
||||
nullable: true,
|
||||
comment: "หมายเหตุ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "RefNo1",
|
||||
table: "PeriodExams",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "Ref No1")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Remark",
|
||||
table: "PeriodExams",
|
||||
type: "text",
|
||||
nullable: true,
|
||||
comment: "remark")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PeriodExamBarCodes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PeriodExamId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PeriodExamBarCodes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PeriodExamBarCodes_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PeriodExamBarCodes_PeriodExams_PeriodExamId",
|
||||
column: x => x.PeriodExamId,
|
||||
principalTable: "PeriodExams",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PeriodExamQrCodes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PeriodExamId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PeriodExamQrCodes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PeriodExamQrCodes_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PeriodExamQrCodes_PeriodExams_PeriodExamId",
|
||||
column: x => x.PeriodExamId,
|
||||
principalTable: "PeriodExams",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PeriodExamBarCodes_DocumentId",
|
||||
table: "PeriodExamBarCodes",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PeriodExamBarCodes_PeriodExamId",
|
||||
table: "PeriodExamBarCodes",
|
||||
column: "PeriodExamId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PeriodExamQrCodes_DocumentId",
|
||||
table: "PeriodExamQrCodes",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PeriodExamQrCodes_PeriodExamId",
|
||||
table: "PeriodExamQrCodes",
|
||||
column: "PeriodExamId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PeriodExamBarCodes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PeriodExamQrCodes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompanyCode",
|
||||
table: "PeriodExams");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CustomerName",
|
||||
table: "PeriodExams");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Reason",
|
||||
table: "PeriodExams");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RefNo1",
|
||||
table: "PeriodExams");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Remark",
|
||||
table: "PeriodExams");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "ScoreImports",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "PositionExams",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "PeriodExamImages",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "PeriodExamDocuments",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "Educations",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisableScores",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "Disables",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisablePayments",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisableOccupations",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisableImportHistories",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisableEducations",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisableDocuments",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisableCertificates",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "DisableAddresses",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "CMSGovernments",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "CMSCandidates",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "CMSAgencys",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "Careers",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "Candidates",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "CandidateDocuments",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsActive",
|
||||
table: "BankExams",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
comment: "สถานะการใช้งาน")
|
||||
.Annotation("Relational:ColumnOrder", 106);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -89,6 +89,21 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
|
|||
[Comment("สำนัก")]
|
||||
public string? Category { get; set; }
|
||||
|
||||
[Comment("remark"), Column(TypeName = "text")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[Comment("Company code")]
|
||||
public string? CompanyCode { get; set; }
|
||||
|
||||
[Comment("Customer name")]
|
||||
public string? CustomerName { get; set; }
|
||||
|
||||
[Comment("หมายเหตุ"), Column(TypeName = "text")]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
[Comment("Ref No1")]
|
||||
public string? RefNo1 { get; set; }
|
||||
|
||||
[Comment("รายชื่อคนสม้ครในรอบ")]
|
||||
public List<Candidate> Candidate { get; set; } = new List<Candidate>();
|
||||
|
||||
|
|
@ -103,6 +118,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
|
|||
|
||||
[Comment("รูป")]
|
||||
public virtual List<PeriodExamImage> PeriodExamImages { get; set; } = new();
|
||||
|
||||
[Comment("qr code")]
|
||||
public virtual List<PeriodExamQrCode> PeriodExamQrCodes { get; set; } = new();
|
||||
|
||||
[Comment("bar code")]
|
||||
public virtual List<PeriodExamBarCode> PeriodExamBarCodes { get; set; } = new();
|
||||
public Document? ImportFile { get; set; } = new Document();
|
||||
public List<Disable> Disables { get; set; } = new List<Disable>();
|
||||
public ScoreImport? ScoreImport { get; set; }
|
||||
|
|
|
|||
15
Models/PeriodExamBarCode.cs
Normal file
15
Models/PeriodExamBarCode.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using BMA.EHR.Recurit.Exam.Service.Models.Documents;
|
||||
|
||||
namespace BMA.EHR.Recurit.Exam.Service.Models
|
||||
{
|
||||
public class PeriodExamBarCode : EntityBase
|
||||
{
|
||||
[Required, Comment("Id รอบสมัครสอบ")]
|
||||
public virtual PeriodExam? PeriodExam { get; set; }
|
||||
[Required, Comment("Id ไฟล์รูป")]
|
||||
public virtual Document? Document { get; set; }
|
||||
}
|
||||
}
|
||||
15
Models/PeriodExamQrCode.cs
Normal file
15
Models/PeriodExamQrCode.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using BMA.EHR.Recurit.Exam.Service.Models.Documents;
|
||||
|
||||
namespace BMA.EHR.Recurit.Exam.Service.Models
|
||||
{
|
||||
public class PeriodExamQrCode : EntityBase
|
||||
{
|
||||
[Required, Comment("Id รอบสมัครสอบ")]
|
||||
public virtual PeriodExam? PeriodExam { get; set; }
|
||||
[Required, Comment("Id ไฟล์รูป")]
|
||||
public virtual Document? Document { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -29,6 +29,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Request
|
|||
public string? EditorCondition { get; set; }
|
||||
public string? EditorConfirm { get; set; }
|
||||
public string? Note { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? CompanyCode { get; set; }
|
||||
public string? CustomerName { get; set; }
|
||||
public string? Reason { get; set; }
|
||||
public string? RefNo1 { get; set; }
|
||||
|
||||
public List<FormFile>? Doc { get; set; }
|
||||
public List<FormFile>? Image { get; set; }
|
||||
public List<RequestBankExam> BankExam { get; set; } = new();
|
||||
|
|
|
|||
|
|
@ -34,10 +34,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
|
|||
public string? Note { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public bool SetSeat { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public string? CompanyCode { get; set; }
|
||||
public string? CustomerName { get; set; }
|
||||
public string? Reason { get; set; }
|
||||
public string? RefNo1 { get; set; }
|
||||
public List<Models.Candidate> Candidate { get; set; } = new List<Models.Candidate>();
|
||||
public List<Models.PositionExam> PositionExam { get; set; } = new List<Models.PositionExam>();
|
||||
public List<Models.BankExam> BankExam { get; set; } = new List<Models.BankExam>();
|
||||
public List<FileListResponse> Documents { get; set; } = new List<FileListResponse>();
|
||||
public List<FileListResponse> Images { get; set; } = new List<FileListResponse>();
|
||||
public List<FileListResponse> BarCodes { get; set; } = new List<FileListResponse>();
|
||||
public List<FileListResponse> QrCodes { get; set; } = new List<FileListResponse>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
IsActive = x.IsActive,
|
||||
Name = x.Name,
|
||||
Note = x.Note,
|
||||
Remark = x.Remark,
|
||||
CompanyCode = x.CompanyCode,
|
||||
CustomerName = x.CustomerName,
|
||||
Reason = x.Reason,
|
||||
RefNo1 = x.RefNo1,
|
||||
OrganizationCodeId = x.OrganizationCodeId,
|
||||
OrganizationCodeName = x.OrganizationCodeName,
|
||||
OrganizationId = x.OrganizationId,
|
||||
|
|
@ -160,6 +165,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
IsActive = x.IsActive,
|
||||
Name = x.Name,
|
||||
Note = x.Note,
|
||||
Remark = x.Remark,
|
||||
CompanyCode = x.CompanyCode,
|
||||
CustomerName = x.CustomerName,
|
||||
Reason = x.Reason,
|
||||
RefNo1 = x.RefNo1,
|
||||
OrganizationCodeId = x.OrganizationCodeId,
|
||||
OrganizationCodeName = x.OrganizationCodeName,
|
||||
OrganizationId = x.OrganizationId,
|
||||
|
|
@ -209,6 +219,22 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
FileType = b.Document == null ? "" : b.Document.FileType,
|
||||
Detail = b.Document == null ? "" : b.Document.Id.ToString(),
|
||||
}).ToList(),
|
||||
BarCodes = x.PeriodExamBarCodes.OrderBy(o => o.CreatedAt).Select(b => new FileListResponse
|
||||
{
|
||||
Id = b.Document == null ? "" : b.Document.Id.ToString(),
|
||||
FileName = b.Document == null ? "" : b.Document.FileName,
|
||||
FileSize = b.Document == null ? 0 : b.Document.FileSize,
|
||||
FileType = b.Document == null ? "" : b.Document.FileType,
|
||||
Detail = b.Document == null ? "" : b.Document.Id.ToString(),
|
||||
}).ToList(),
|
||||
QrCodes = x.PeriodExamQrCodes.OrderBy(o => o.CreatedAt).Select(b => new FileListResponse
|
||||
{
|
||||
Id = b.Document == null ? "" : b.Document.Id.ToString(),
|
||||
FileName = b.Document == null ? "" : b.Document.FileName,
|
||||
FileSize = b.Document == null ? 0 : b.Document.FileSize,
|
||||
FileType = b.Document == null ? "" : b.Document.FileType,
|
||||
Detail = b.Document == null ? "" : b.Document.Id.ToString(),
|
||||
}).ToList(),
|
||||
})
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId));
|
||||
|
||||
|
|
@ -229,6 +255,20 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
periodExam.Documents[i].Detail = _minioService.ImagesPath(Guid.Parse(periodExam.Documents[i].Detail)).Result;
|
||||
i++;
|
||||
}
|
||||
i = 0;
|
||||
foreach (var item in periodExam.QrCodes)
|
||||
{
|
||||
if (periodExam.QrCodes[i].Detail != null && periodExam.QrCodes[i].Detail != "")
|
||||
periodExam.QrCodes[i].Detail = _minioService.ImagesPath(Guid.Parse(periodExam.QrCodes[i].Detail)).Result;
|
||||
i++;
|
||||
}
|
||||
i = 0;
|
||||
foreach (var item in periodExam.BarCodes)
|
||||
{
|
||||
if (periodExam.BarCodes[i].Detail != null && periodExam.BarCodes[i].Detail != "")
|
||||
periodExam.BarCodes[i].Detail = _minioService.ImagesPath(Guid.Parse(periodExam.BarCodes[i].Detail)).Result;
|
||||
i++;
|
||||
}
|
||||
|
||||
return periodExam;
|
||||
}
|
||||
|
|
@ -319,6 +359,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
EditorCondition = inserted.EditorCondition,
|
||||
EditorConfirm = inserted.EditorConfirm,
|
||||
Note = inserted.Note,
|
||||
Remark = inserted.Remark,
|
||||
CompanyCode = inserted.CompanyCode,
|
||||
CustomerName = inserted.CustomerName,
|
||||
Reason = inserted.Reason,
|
||||
RefNo1 = inserted.RefNo1,
|
||||
CreatedAt = DateTime.Now,
|
||||
CreatedUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
|
|
@ -415,6 +460,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
periodExam.EditorCondition = updated.EditorCondition;
|
||||
periodExam.EditorConfirm = updated.EditorConfirm;
|
||||
periodExam.Note = updated.Note;
|
||||
periodExam.Remark = updated.Remark;
|
||||
periodExam.CompanyCode = updated.CompanyCode;
|
||||
periodExam.CustomerName = updated.CustomerName;
|
||||
periodExam.Reason = updated.Reason;
|
||||
periodExam.RefNo1 = updated.RefNo1;
|
||||
periodExam.LastUpdatedAt = DateTime.Now;
|
||||
periodExam.LastUpdateUserId = UserId ?? "";
|
||||
periodExam.LastUpdateFullName = FullName ?? "";
|
||||
|
|
@ -599,6 +649,73 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
|||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateBarcodeAsync(string examId, IFormFileCollection files)
|
||||
{
|
||||
var periodExam = await _context.PeriodExams.AsQueryable()
|
||||
.Include(x => x.PeriodExamBarCodes)
|
||||
.ThenInclude(x => x.Document)
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId));
|
||||
|
||||
if (periodExam == null)
|
||||
throw new Exception(GlobalMessages.ExamNotFound);
|
||||
if (periodExam.PeriodExamBarCodes != null && periodExam.PeriodExamBarCodes[0] != null && periodExam.PeriodExamBarCodes[0].Document != null)
|
||||
await _minioService.DeleteFileAsync(periodExam.PeriodExamBarCodes[0].Document.Id);
|
||||
foreach (var file in files)
|
||||
{
|
||||
var doc = await _minioService.UploadFileAsync(file);
|
||||
|
||||
var document = await _context.Documents.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Id == doc.Id);
|
||||
|
||||
if (document == null)
|
||||
throw new Exception(GlobalMessages.NoFileToUpload);
|
||||
|
||||
var periodExamBarCode = new PeriodExamBarCode
|
||||
{
|
||||
PeriodExam = periodExam,
|
||||
Document = document,
|
||||
};
|
||||
|
||||
await _context.PeriodExamBarCodes.AddAsync(periodExamBarCode);
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateQrcodeAsync(string examId, IFormFileCollection files)
|
||||
{
|
||||
var periodExam = await _context.PeriodExams.AsQueryable()
|
||||
.Include(x => x.PeriodExamBarCodes)
|
||||
.ThenInclude(x => x.Document)
|
||||
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId));
|
||||
|
||||
if (periodExam == null)
|
||||
throw new Exception(GlobalMessages.ExamNotFound);
|
||||
if (periodExam.PeriodExamBarCodes != null && periodExam.PeriodExamBarCodes[0] != null && periodExam.PeriodExamBarCodes[0].Document != null)
|
||||
await _minioService.DeleteFileAsync(periodExam.PeriodExamBarCodes[0].Document.Id);
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
var doc = await _minioService.UploadFileAsync(file);
|
||||
|
||||
var document = await _context.Documents.AsQueryable()
|
||||
.FirstOrDefaultAsync(x => x.Id == doc.Id);
|
||||
|
||||
if (document == null)
|
||||
throw new Exception(GlobalMessages.NoFileToUpload);
|
||||
|
||||
var periodExamQrCode = new PeriodExamQrCode
|
||||
{
|
||||
PeriodExam = periodExam,
|
||||
Document = document,
|
||||
};
|
||||
|
||||
await _context.PeriodExamQrCodes.AddAsync(periodExamQrCode);
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteDocument(string documentId)
|
||||
{
|
||||
await _minioService.DeleteFileAsync(Guid.Parse(documentId));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue