แยกประเภทขรก
This commit is contained in:
parent
811fa781b4
commit
b02f8bc2e6
7 changed files with 80 additions and 19 deletions
|
|
@ -245,6 +245,8 @@ namespace BMA.EHR.Domain.Models.Placement
|
||||||
|
|
||||||
[Comment("หมายเหตุแนวนอน")]
|
[Comment("หมายเหตุแนวนอน")]
|
||||||
public string? RemarkHorizontal { get; set; }
|
public string? RemarkHorizontal { get; set; }
|
||||||
|
[Comment("profileId")]
|
||||||
|
public string? profileId { get; set; }
|
||||||
public virtual List<PlacementCertificate> PlacementCertificates { get; set; } = new List<PlacementCertificate>();
|
public virtual List<PlacementCertificate> PlacementCertificates { get; set; } = new List<PlacementCertificate>();
|
||||||
public virtual List<PlacementEducation> PlacementEducations { get; set; } = new List<PlacementEducation>();
|
public virtual List<PlacementEducation> PlacementEducations { get; set; } = new List<PlacementEducation>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Request.Disables
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// วันเริ่มชำระเงิน
|
/// วันเริ่มชำระเงิน
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime PaymentStartDate { get; set; }
|
public DateTime? PaymentStartDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// วันสิ้นสุดชำระเงิน
|
/// วันสิ้นสุดชำระเงิน
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime PaymentEndDate { get; set; }
|
public DateTime? PaymentEndDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// วันเริ่มสมัครสอบ
|
/// วันเริ่มสมัครสอบ
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ using OfficeOpenXml;
|
||||||
using BMA.EHR.Domain.Models.Placement;
|
using BMA.EHR.Domain.Models.Placement;
|
||||||
using OfficeOpenXml.Style;
|
using OfficeOpenXml.Style;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
|
||||||
namespace BMA.EHR.Recurit.Exam.Service.Services
|
namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
{
|
{
|
||||||
|
|
@ -27,6 +29,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
private readonly MinIOService _minioService;
|
private readonly MinIOService _minioService;
|
||||||
private readonly MailService _mailService;
|
private readonly MailService _mailService;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
@ -36,13 +39,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
MetadataDbContext contextMetadata,
|
MetadataDbContext contextMetadata,
|
||||||
IHttpContextAccessor httpContextAccessor,
|
IHttpContextAccessor httpContextAccessor,
|
||||||
MinIOService minioService,
|
MinIOService minioService,
|
||||||
MailService mailService)
|
MailService mailService,
|
||||||
|
IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_contextMetadata = contextMetadata;
|
_contextMetadata = contextMetadata;
|
||||||
_httpContextAccessor = httpContextAccessor;
|
_httpContextAccessor = httpContextAccessor;
|
||||||
_minioService = minioService;
|
_minioService = minioService;
|
||||||
_mailService = mailService;
|
_mailService = mailService;
|
||||||
|
_configuration = configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -52,6 +57,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||||
|
|
||||||
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||||
|
private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"];
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
@ -2097,6 +2103,28 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
await _contextMetadata.Placements.AddAsync(placement);
|
await _contextMetadata.Placements.AddAsync(placement);
|
||||||
foreach (var candidate in periodExam.Candidate.Where(x => x.Status == "done" && x.Pass == "ได้"))
|
foreach (var candidate in periodExam.Candidate.Where(x => x.Status == "done" && x.Pass == "ได้"))
|
||||||
{
|
{
|
||||||
|
var IsOfficer = false;
|
||||||
|
dynamic org = null;
|
||||||
|
var apiUrl = $"{_configuration["API"]}org/profile/citizenid/position/{candidate.CitizenId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
org = JsonConvert.DeserializeObject<dynamic>(_result);
|
||||||
|
|
||||||
|
if (org == null || org.result == null)
|
||||||
|
{
|
||||||
|
IsOfficer = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IsOfficer = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var profile = await _contextMetadata.Profiles
|
var profile = await _contextMetadata.Profiles
|
||||||
.Include(x => x.Salaries)
|
.Include(x => x.Salaries)
|
||||||
.FirstOrDefaultAsync(p => p.CitizenId == candidate.CitizenId);
|
.FirstOrDefaultAsync(p => p.CitizenId == candidate.CitizenId);
|
||||||
|
|
@ -2187,6 +2215,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdateFullName = FullName ?? "",
|
LastUpdateFullName = FullName ?? "",
|
||||||
|
IsOfficer = IsOfficer,
|
||||||
|
profileId = org == null || org.result == null ? null : org.result.profileId,
|
||||||
};
|
};
|
||||||
await _contextMetadata.PlacementProfiles.AddAsync(placementProfile);
|
await _contextMetadata.PlacementProfiles.AddAsync(placementProfile);
|
||||||
|
|
||||||
|
|
@ -2254,6 +2284,27 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
foreach (var candidate in candidates)
|
foreach (var candidate in candidates)
|
||||||
{
|
{
|
||||||
|
var IsOfficer = false;
|
||||||
|
dynamic org = null;
|
||||||
|
var apiUrl = $"{_configuration["API"]}org/profile/citizenid/position/{candidate.CitizenId}";
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
|
||||||
|
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||||
|
var _res = await client.SendAsync(_req);
|
||||||
|
var _result = await _res.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
org = JsonConvert.DeserializeObject<dynamic>(_result);
|
||||||
|
|
||||||
|
if (org == null || org.result == null)
|
||||||
|
{
|
||||||
|
IsOfficer = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IsOfficer = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
var Address = candidate.Addresses.FirstOrDefault() == null ? null : $"{candidate.Addresses.FirstOrDefault().Address}";
|
var Address = candidate.Addresses.FirstOrDefault() == null ? null : $"{candidate.Addresses.FirstOrDefault().Address}";
|
||||||
var Moo = candidate.Addresses.FirstOrDefault() == null ? null : $" หมู่ {candidate.Addresses.FirstOrDefault().Moo}";
|
var Moo = candidate.Addresses.FirstOrDefault() == null ? null : $" หมู่ {candidate.Addresses.FirstOrDefault().Moo}";
|
||||||
var Soi = candidate.Addresses.FirstOrDefault() == null ? null : $" ซอย {candidate.Addresses.FirstOrDefault().Soi}";
|
var Soi = candidate.Addresses.FirstOrDefault() == null ? null : $" ซอย {candidate.Addresses.FirstOrDefault().Soi}";
|
||||||
|
|
@ -2359,6 +2410,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
|
||||||
LastUpdatedAt = DateTime.Now,
|
LastUpdatedAt = DateTime.Now,
|
||||||
LastUpdateUserId = UserId ?? "",
|
LastUpdateUserId = UserId ?? "",
|
||||||
LastUpdateFullName = FullName ?? "",
|
LastUpdateFullName = FullName ?? "",
|
||||||
|
IsOfficer = IsOfficer,
|
||||||
|
profileId = org == null || org.result == null ? null : org.result.profileId,
|
||||||
};
|
};
|
||||||
await _contextMetadata.PlacementProfiles.AddAsync(placementProfile);
|
await _contextMetadata.PlacementProfiles.AddAsync(placementProfile);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"MongoConnection": "mongodb://127.0.0.1:27017",
|
"MongoConnection": "mongodb://127.0.0.1:27017",
|
||||||
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
"MetadataConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
"MetadataConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "Hp3234M8rH1KjIdvhlUStayo6vIUOIeI76NKyIsiXJ8",
|
||||||
"Issuer": "https://identity.frappet.com/realms/bma-ehr"
|
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
|
||||||
},
|
},
|
||||||
"EPPlus": {
|
"EPPlus": {
|
||||||
"ExcelPackage": {
|
"ExcelPackage": {
|
||||||
|
|
@ -41,5 +41,7 @@
|
||||||
"MailFrom": "suphonchai.ph@gmail.com",
|
"MailFrom": "suphonchai.ph@gmail.com",
|
||||||
"Port": "587"
|
"Port": "587"
|
||||||
},
|
},
|
||||||
"Domain": "http://localhost:5173"
|
"Domain": "https://bma-ehr-exam.frappet.synology.me",
|
||||||
|
"Protocol": "HTTPS",
|
||||||
|
"API": "https://bma-ehr.frappet.synology.me/api/v1/"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"MongoConnection": "mongodb://admin:adminVM123@127.0.0.1:27017",
|
"MongoConnection": "mongodb://admin:adminVM123@127.0.0.1:27017",
|
||||||
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
"MetadataConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
"MetadataConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
|
|
@ -41,5 +41,6 @@
|
||||||
"MailFrom": "suphonchai.ph@gmail.com",
|
"MailFrom": "suphonchai.ph@gmail.com",
|
||||||
"Port": "587"
|
"Port": "587"
|
||||||
},
|
},
|
||||||
"Domain": "http://localhost:5173"
|
"Domain": "http://localhost:5173",
|
||||||
|
"API": "https://bma-ehr.frappet.synology.me/api/v1/"
|
||||||
}
|
}
|
||||||
|
|
@ -15,13 +15,13 @@
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"MongoConnection": "mongodb://127.0.0.1:27017",
|
"MongoConnection": "mongodb://127.0.0.1:27017",
|
||||||
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
"MetadataConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
"MetadataConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "Hp3234M8rH1KjIdvhlUStayo6vIUOIeI76NKyIsiXJ8",
|
||||||
"Issuer": "https://identity.frappet.com/realms/bma-ehr"
|
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
|
||||||
},
|
},
|
||||||
"EPPlus": {
|
"EPPlus": {
|
||||||
"ExcelPackage": {
|
"ExcelPackage": {
|
||||||
|
|
@ -41,5 +41,7 @@
|
||||||
"MailFrom": "suphonchai.ph@gmail.com",
|
"MailFrom": "suphonchai.ph@gmail.com",
|
||||||
"Port": "587"
|
"Port": "587"
|
||||||
},
|
},
|
||||||
"Domain": "http://localhost:5173"
|
"Domain": "https://bma-ehr-exam.frappet.synology.me",
|
||||||
|
"Protocol": "HTTPS",
|
||||||
|
"API": "https://bma-ehr.frappet.synology.me/api/v1/"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"MongoConnection": "mongodb://admin:adminVM123@127.0.0.1:27017",
|
"MongoConnection": "mongodb://admin:adminVM123@127.0.0.1:27017",
|
||||||
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
// "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
"DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_exam_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
|
||||||
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
// "MetadataConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
"MetadataConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
"MetadataConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
|
|
@ -41,5 +41,6 @@
|
||||||
"MailFrom": "suphonchai.ph@gmail.com",
|
"MailFrom": "suphonchai.ph@gmail.com",
|
||||||
"Port": "587"
|
"Port": "587"
|
||||||
},
|
},
|
||||||
"Domain": "http://localhost:5173"
|
"Domain": "http://localhost:5173",
|
||||||
|
"API": "https://bma-ehr.frappet.synology.me/api/v1/"
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue