add authname
This commit is contained in:
parent
579d82a9df
commit
c1fcb04421
7 changed files with 3225 additions and 26 deletions
|
|
@ -493,6 +493,23 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdateFullName = FullName ?? "System Administrator",
|
LastUpdateFullName = FullName ?? "System Administrator",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var apiUrl = $"{_configuration["API"]}/org/find/head/officer";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
if (_res.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var org = JsonConvert.DeserializeObject<dynamic>(_result);
|
||||||
|
periodExam.AuthName = org.result.name == null ? "" : org.result.name;
|
||||||
|
periodExam.AuthPosition = org.result.position == null ? "" : org.result.position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await _context.PeriodExams.AddAsync(periodExam);
|
await _context.PeriodExams.AddAsync(periodExam);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
@ -1594,22 +1611,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
// ใช้ dictionary lookup แทน query DB ทีละรอบ
|
// ใช้ dictionary lookup แทน query DB ทีละรอบ
|
||||||
if (!string.IsNullOrEmpty(r.ExamId) && recruitsDict.TryGetValue(r.ExamId, out var recruit))
|
if (!string.IsNullOrEmpty(r.ExamId) && recruitsDict.TryGetValue(r.ExamId, out var recruit))
|
||||||
{
|
{
|
||||||
// var apiUrl = $"{_configuration["API"]}/org/find/head/officer";
|
|
||||||
// using (var client = new HttpClient())
|
|
||||||
// {
|
|
||||||
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
|
||||||
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
|
||||||
// var _res = await client.SendAsync(_req);
|
|
||||||
// var _result = await _res.Content.ReadAsStringAsync();
|
|
||||||
// if (_res.IsSuccessStatusCode)
|
|
||||||
// {
|
|
||||||
// var org = JsonConvert.DeserializeObject<dynamic>(_result);
|
|
||||||
// recruit.AuthName = org.result.name == null ? "" : org.result.name;
|
|
||||||
// recruit.AuthPosition = org.result.position == null ? "" : org.result.position;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
r.CitizenId = workSheet?.Cells[row, 3]?.GetValue<string>();
|
r.CitizenId = workSheet?.Cells[row, 3]?.GetValue<string>();
|
||||||
|
|
||||||
// ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง
|
// ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
||||||
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 == null ? null : p.PeriodExam.RegisterEndDate.Value.ToThaiFullDate3(),
|
EndDate = p.PeriodExam.RegisterEndDate == null ? null : p.PeriodExam.RegisterEndDate.Value.ToThaiFullDate3(),
|
||||||
AuthName = "นายณัฐพงศ์ ดิษยบุตร",
|
AuthName = p.PeriodExam.AuthName,
|
||||||
AuthPosition = "หัวหน้าสำนักงาน ก.ก."
|
AuthPosition = p.PeriodExam.AuthPosition,
|
||||||
})
|
})
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1007,12 +1007,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
||||||
b.Property<DateTime>("ApplyDate")
|
b.Property<DateTime>("ApplyDate")
|
||||||
.HasColumnType("datetime(6)");
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
b.Property<string>("AuthName")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<string>("AuthPosition")
|
|
||||||
.HasColumnType("longtext");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CitizenCardExpireDate")
|
b.Property<DateTime>("CitizenCardExpireDate")
|
||||||
.HasColumnType("datetime(6)");
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
|
@ -2229,6 +2223,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
||||||
.HasColumnOrder(6)
|
.HasColumnOrder(6)
|
||||||
.HasComment("วันเริ่มประกาศ");
|
.HasComment("วันเริ่มประกาศ");
|
||||||
|
|
||||||
|
b.Property<string>("AuthName")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<string>("AuthPosition")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
b.Property<string>("Category")
|
b.Property<string>("Category")
|
||||||
.HasColumnType("longtext")
|
.HasColumnType("longtext")
|
||||||
.HasComment("สำนัก");
|
.HasComment("สำนัก");
|
||||||
|
|
|
||||||
3134
Migrations/20250915085529_update_table_period_add_authname.Designer.cs
generated
Normal file
3134
Migrations/20250915085529_update_table_period_add_authname.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,62 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Recurit.Exam.Service.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class update_table_period_add_authname : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "AuthName",
|
||||||
|
table: "Disables");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "AuthPosition",
|
||||||
|
table: "Disables");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "AuthName",
|
||||||
|
table: "PeriodExams",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "AuthPosition",
|
||||||
|
table: "PeriodExams",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "AuthName",
|
||||||
|
table: "PeriodExams");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "AuthPosition",
|
||||||
|
table: "PeriodExams");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "AuthName",
|
||||||
|
table: "Disables",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "AuthPosition",
|
||||||
|
table: "Disables",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -80,8 +80,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
|
||||||
public string? PositionName { get; set; }//
|
public string? PositionName { get; set; }//
|
||||||
public string? PositionType { get; set; }
|
public string? PositionType { get; set; }
|
||||||
public string? PositionLevel { get; set; }
|
public string? PositionLevel { get; set; }
|
||||||
public string? AuthName { get; set; }
|
// public string? AuthName { get; set; }
|
||||||
public string? AuthPosition { get; set; }
|
// public string? AuthPosition { get; set; }
|
||||||
|
|
||||||
[Comment("บัญชีสอบ")]
|
[Comment("บัญชีสอบ")]
|
||||||
public string? HddPosition { get; set; } = string.Empty;
|
public string? HddPosition { get; set; } = string.Empty;
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
|
||||||
|
|
||||||
[Comment("Ref No1")]
|
[Comment("Ref No1")]
|
||||||
public string? RefNo1 { get; set; }
|
public string? RefNo1 { get; set; }
|
||||||
|
public string? AuthName { get; set; }
|
||||||
|
public string? AuthPosition { get; set; }
|
||||||
|
|
||||||
[Comment("รายชื่อคนสม้ครในรอบ")]
|
[Comment("รายชื่อคนสม้ครในรอบ")]
|
||||||
public List<Candidate> Candidate { get; set; } = new List<Candidate>();
|
public List<Candidate> Candidate { get; set; } = new List<Candidate>();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue