Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67253337a9 | ||
|
|
b5567b5459 |
6 changed files with 1681 additions and 9 deletions
|
|
@ -480,6 +480,7 @@ namespace BMA.EHR.Recruit.Controllers
|
||||||
PaymentEndDate = req.PaymentEndDate,
|
PaymentEndDate = req.PaymentEndDate,
|
||||||
Note = req.Note,
|
Note = req.Note,
|
||||||
AnnouncementDate = req.AnnouncementDate,
|
AnnouncementDate = req.AnnouncementDate,
|
||||||
|
ScoreExpireDate = req.ScoreExpireDate,
|
||||||
OrganizationId = req.rootDnaId,
|
OrganizationId = req.rootDnaId,
|
||||||
CreatedAt = DateTime.Now,
|
CreatedAt = DateTime.Now,
|
||||||
CreatedUserId = UserId ?? "",
|
CreatedUserId = UserId ?? "",
|
||||||
|
|
@ -561,6 +562,8 @@ namespace BMA.EHR.Recruit.Controllers
|
||||||
data.ExamDate = req.ExamDate;
|
data.ExamDate = req.ExamDate;
|
||||||
data.Note = req.Note;
|
data.Note = req.Note;
|
||||||
data.AnnouncementDate = req.AnnouncementDate;
|
data.AnnouncementDate = req.AnnouncementDate;
|
||||||
|
if (req.ScoreExpireDate.HasValue)
|
||||||
|
data.ScoreExpireDate = req.ScoreExpireDate;
|
||||||
data.LastUpdatedAt = DateTime.Now;
|
data.LastUpdatedAt = DateTime.Now;
|
||||||
data.LastUpdateUserId = UserId ?? "";
|
data.LastUpdateUserId = UserId ?? "";
|
||||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||||
|
|
@ -686,7 +689,7 @@ namespace BMA.EHR.Recruit.Controllers
|
||||||
ImportYear = x.ScoreImport.Year,
|
ImportYear = x.ScoreImport.Year,
|
||||||
ImportDate = x.CreatedAt.Date.ToThaiShortDate(),
|
ImportDate = x.CreatedAt.Date.ToThaiShortDate(),
|
||||||
ScoreCount = x.ScoreImport.Scores.Count(),
|
ScoreCount = x.ScoreImport.Scores.Count(),
|
||||||
ResultCount = x.ScoreImport.Scores.Count(x => !string.IsNullOrEmpty(x.Number))
|
ResultCount = x.ScoreImport.Scores.Count(x => x.ExamStatus == "ผ่าน" && !string.IsNullOrEmpty(x.Number))
|
||||||
},
|
},
|
||||||
x.CreatedUserId,
|
x.CreatedUserId,
|
||||||
})
|
})
|
||||||
|
|
@ -1537,6 +1540,9 @@ namespace BMA.EHR.Recruit.Controllers
|
||||||
case "notpass":
|
case "notpass":
|
||||||
queryWithScores = queryWithScores.Where(x => x.score != null && x.score.ExamStatus == "ไม่ผ่าน");
|
queryWithScores = queryWithScores.Where(x => x.score != null && x.score.ExamStatus == "ไม่ผ่าน");
|
||||||
break;
|
break;
|
||||||
|
case "other":
|
||||||
|
queryWithScores = queryWithScores.Where(x => x.score != null && !new[] { "ขส.", "ผ่าน", "ไม่ผ่าน" }.Contains(x.score.ExamStatus));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1820,11 +1826,15 @@ namespace BMA.EHR.Recruit.Controllers
|
||||||
Score = score == null ? 0.0 : score.TotalScore,
|
Score = score == null ? 0.0 : score.TotalScore,
|
||||||
Number = score == null ? "" : score.Number,
|
Number = score == null ? "" : score.Number,
|
||||||
ExamCount = _recruitService.GetExamCount(recruit.CitizenId),
|
ExamCount = _recruitService.GetExamCount(recruit.CitizenId),
|
||||||
ScoreExpire = recruit.RecruitImport.AnnouncementDate == null
|
// เดิมคำนวณวันหมดอายุจาก AnnouncementDate + 2 ปี (เก็บไว้สำหรับอ้างอิงข้อมูลเก่า)
|
||||||
|
//ScoreExpire = recruit.RecruitImport.AnnouncementDate == null
|
||||||
|
// ? ""
|
||||||
|
// : recruit.RecruitImport.AnnouncementDate != DateTime.MinValue
|
||||||
|
// ? recruit.RecruitImport.AnnouncementDate.Value.AddYears(2).ToThaiShortDate()
|
||||||
|
// : "",
|
||||||
|
ScoreExpire = recruit.RecruitImport.ScoreExpireDate == null
|
||||||
? ""
|
? ""
|
||||||
: recruit.RecruitImport.AnnouncementDate != DateTime.MinValue
|
: recruit.RecruitImport.ScoreExpireDate.Value.ToThaiShortDate(),
|
||||||
? recruit.RecruitImport.AnnouncementDate.Value.AddYears(2).ToThaiShortDate()
|
|
||||||
: "",
|
|
||||||
typeTest = recruit.typeTest,
|
typeTest = recruit.typeTest,
|
||||||
ScoreResult = score == null ? null : new
|
ScoreResult = score == null ? null : new
|
||||||
{
|
{
|
||||||
|
|
@ -2651,11 +2661,15 @@ namespace BMA.EHR.Recruit.Controllers
|
||||||
T = score != null && score.TotalScore != null ? score.TotalScore.ToString().ToThaiNumber() : "",
|
T = score != null && score.TotalScore != null ? score.TotalScore.ToString().ToThaiNumber() : "",
|
||||||
Result = score == null ? "" : score.ExamStatus,
|
Result = score == null ? "" : score.ExamStatus,
|
||||||
Number = score != null && score.Number != null ? score.Number.ToString().ToThaiNumber() : "",
|
Number = score != null && score.Number != null ? score.Number.ToString().ToThaiNumber() : "",
|
||||||
Expire = recruit.RecruitImport.AnnouncementDate == null
|
// เดิมคำนวณวันหมดอายุจาก AnnouncementDate + 2 ปี (เก็บไว้สำหรับอ้างอิงข้อมูลเก่า)
|
||||||
|
//Expire = recruit.RecruitImport.AnnouncementDate == null
|
||||||
|
// ? ""
|
||||||
|
// : recruit.RecruitImport.AnnouncementDate != DateTime.MinValue
|
||||||
|
// ? recruit.RecruitImport.AnnouncementDate.Value.AddYears(2).ToThaiShortDate().ToString().ToThaiNumber()
|
||||||
|
// : "",
|
||||||
|
Expire = recruit.RecruitImport.ScoreExpireDate == null
|
||||||
? ""
|
? ""
|
||||||
: recruit.RecruitImport.AnnouncementDate != DateTime.MinValue
|
: recruit.RecruitImport.ScoreExpireDate.Value.ToThaiShortDate().ToString().ToThaiNumber(),
|
||||||
? recruit.RecruitImport.AnnouncementDate.Value.AddYears(2).ToThaiShortDate().ToString().ToThaiNumber()
|
|
||||||
: "",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = new
|
var result = new
|
||||||
|
|
|
||||||
1614
Migrations/20260701102418_update_RecruitImport_add_ScoreExpireDate.Designer.cs
generated
Normal file
1614
Migrations/20260701102418_update_RecruitImport_add_ScoreExpireDate.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Recruit.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class update_RecruitImport_add_ScoreExpireDate : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "ScoreExpireDate",
|
||||||
|
table: "RecruitImports",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true,
|
||||||
|
comment: "วันหมดอายุบัญชี")
|
||||||
|
.Annotation("Relational:ColumnOrder", 15);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ScoreExpireDate",
|
||||||
|
table: "RecruitImports");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -728,6 +728,11 @@ namespace BMA.EHR.Recruit.Migrations
|
||||||
.HasColumnOrder(10)
|
.HasColumnOrder(10)
|
||||||
.HasComment("วันเริ่มสมัครสอบ");
|
.HasComment("วันเริ่มสมัครสอบ");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ScoreExpireDate")
|
||||||
|
.HasColumnType("datetime(6)")
|
||||||
|
.HasColumnOrder(15)
|
||||||
|
.HasComment("วันหมดอายุบัญชี");
|
||||||
|
|
||||||
b.Property<int>("Year")
|
b.Property<int>("Year")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
.HasColumnOrder(1)
|
.HasColumnOrder(1)
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,9 @@ namespace BMA.EHR.Recruit.Models.Recruits
|
||||||
[Column(Order = 14), Comment("วันที่ประกาศผลสอบ")]
|
[Column(Order = 14), Comment("วันที่ประกาศผลสอบ")]
|
||||||
public DateTime? AnnouncementDate { get; set; }
|
public DateTime? AnnouncementDate { get; set; }
|
||||||
|
|
||||||
|
[Column(Order = 15), Comment("วันหมดอายุบัญชี")]
|
||||||
|
public DateTime? ScoreExpireDate { get; set; }
|
||||||
|
|
||||||
public Document ImportFile { get; set; } = new Document();
|
public Document ImportFile { get; set; } = new Document();
|
||||||
|
|
||||||
public List<Recruit> Recruits { get; set; } = new List<Recruit>();
|
public List<Recruit> Recruits { get; set; } = new List<Recruit>();
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,11 @@ namespace BMA.EHR.Recruit.Requests.Recruits
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? AnnouncementDate { get; set; }
|
public DateTime? AnnouncementDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// วันหมดอายุบัญชี
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? ScoreExpireDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// รหัส DNA หน่วยงาน
|
/// รหัส DNA หน่วยงาน
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue