แก้สมัครสอบ

This commit is contained in:
kittapath 2025-01-05 21:59:15 +07:00
parent afc0cd830c
commit 07903d3b67
30 changed files with 3471 additions and 771 deletions

View file

@ -185,32 +185,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
throw;
}
}
private List<Guid?> GetAllIdByRoot(Guid id)
{
try
{
var ret = new List<Guid?>();
var oc = _contextMetadata.Organizations.FirstOrDefault(x => x.Id == id && x.IsActive);
if (oc != null)
ret.Add(oc.Id);
var child = _contextMetadata.Organizations.AsQueryable().Where(x => x.ParentId == id && x.IsActive).ToList();
if (child.Any())
{
foreach (var item in child)
{
ret.AddRange(GetAllIdByRoot(item.Id));
}
}
return ret;
}
catch
{
throw;
}
}
#endregion
@ -717,45 +691,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
x.CreatedUserId,
})
.ToListAsync();
var profileOrganizations = await _contextMetadata.ProfileOrganizations.AsQueryable()
.ToListAsync();
var _periodExams = (from x in data
join po in profileOrganizations on Guid.Parse(x.CreatedUserId) equals po?.UserId into poGroup
from po in poGroup.DefaultIfEmpty()
select new
{
x.Id,
x.Year,
x.Name,
x.Round,
x.ImportDate,
x.ExamCount,
x.Score,
x.CreatedUserId,
OcId = po == null ? null : po.OrganizationId,
}).AsQueryable()
.ToList();
var roles = _httpContextAccessor?.HttpContext?.User?.FindAll(ClaimTypes.Role)?.Select(c => c.Value).ToList();
// if (!roles.Contains("head"))
// {
// var criteria = new List<Guid?>();
// var profileOrganization = await _contextMetadata.ProfileOrganizations.AsQueryable()
// .FirstOrDefaultAsync(x => x.UserId == Guid.Parse(UserId));
// if (profileOrganization == null)
// return Success(new List<dynamic>());
// var ocId = _contextMetadata.Organizations.AsQueryable()
// .FirstOrDefault(x => x.Id == profileOrganization.OrganizationId);
// if (ocId == null)
// return Success(new List<dynamic>());
// criteria = GetAllIdByRoot(ocId.Id);
// if (criteria.Any())
// _periodExams = _periodExams.Where(x => x.CreatedUserId == UserId || criteria.Contains(x.OcId == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.OcId)).ToList();
// }
return Success(_periodExams);
return Success(data);
}
catch (Exception ex)
{
@ -867,6 +806,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue<DateTime>();
r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue<string>().IsNull("");
r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue<string>().IsNull("");
r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue<string>().IsNull("");
// address
@ -1229,6 +1170,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
r.CitizenCardExpireDate = Convert.ToDateTime(workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PersonalCardExpireDate)]?.GetValue<string>().ToDateTime(DateTimeFormat.Ymd, "-"));
r.ApplyDate = (DateTime)workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.ApplyDate)]?.GetValue<DateTime>();
r.PositionName = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionName)]?.GetValue<string>().IsNull("");
r.PositionType = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionType)]?.GetValue<string>().IsNull("");
r.PositionLevel = workSheet?.Cells[row, GetColumnIndex(cols, CandidateFileHeader.PositionLevel)]?.GetValue<string>().IsNull("");
// address
r.Addresses.Add(new DisableAddress()
@ -1626,6 +1569,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
applyDate = dr["applydate"] == null ? "" : Convert.ToDateTime(dr["applydate"]).ToThaiShortDate(),
university = dr["university"].ToString(),
position_name = dr["position_name"].ToString(),
position_level = dr["position_level"].ToString(),
position_type = dr["position_type"].ToString(),
exam_name = dr["exam_name"].ToString(),
exam_order = dr["exam_order"].ToString(),
score_year = Convert.ToInt32(dr["score_year"]).ToThaiYear().ToString(),
@ -1722,6 +1667,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
Remark = p.Remark,
University = p.Educations.First().University,
PositionName = p.PositionName,
PositionType = p.PositionType,
PositionLevel = p.PositionLevel,
ExamName = p.PeriodExam.Name,
ExamOrder = p.PeriodExam.Round,
ExamYear = p.PeriodExam.Year == null ? 0 : p.PeriodExam.Year.Value.ToThaiYear(),
@ -1820,7 +1767,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
ExamId = x.ExamId,
CitizenId = x.CitizenId,
Fullname = $"{x.Prefix}{x.FirstName} {x.LastName}",
PositionName = x.PositionName
PositionName = x.PositionName,
PositionType = x.PositionType,
PositionLevel = x.PositionLevel
})
.ToList();
@ -1835,69 +1784,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
}
};
return Success(_data);
//var template_dir = Path.Combine(_webHostEnvironment.ContentRootPath, "Templates");
//var template_file = Path.Combine(template_dir, "ExamList.xlsx");
//var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp");
//if (!Directory.Exists(tmpDir))
// Directory.CreateDirectory(tmpDir);
//var exportFile = Path.Combine(tmpDir, $"ExamList_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx");
//try
//{
// // copy template
// System.IO.File.Copy(template_file, exportFile);
// using (var excel = new ExcelPackage(new FileInfo(exportFile)))
// {
// var workSheet = excel.Workbook.Worksheets[0];
// workSheet.Cells[1, 2].Value = header;
// var disables = data.Disables.OrderBy(x => x.ExamId).ToList();
// var row = 4; // start at row 4
// foreach (var item in disables)
// {
// workSheet.Cells[row, 1].Value = item.ExamId;
// workSheet.Cells[row, 2].Value = item.CitizenId;
// workSheet.Cells[row, 3].Value = $"{item.Prefix}{item.FirstName} {item.LastName}";
// workSheet.Cells[row, 4].Value = item.PositionName;
// row++;
// }
// excel.Save();
// using (FileStream fs = new FileStream(exportFile, FileMode.Open, FileAccess.Read))
// {
// byte[] bytes = System.IO.File.ReadAllBytes(exportFile);
// fs.Read(bytes, 0, System.Convert.ToInt32(fs.Length));
// fs.Close();
// var fname = Path.GetFileName(exportFile);
// Response.Headers["Content-Disposition"] = $"inline; filename={fname}";
// var ret = new FileContentResult(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
// {
// FileDownloadName = fname
// };
// return ret;
// }
// }
//}
//catch (Exception ex)
//{
// return Error(ex, "ไม่สามารถส่งออกรายชื่อผู้มีสิทธิ์สอบได้!!");
//}
//finally
//{
// if (System.IO.File.Exists(exportFile))
// System.IO.File.Delete(exportFile);
//}
}
[HttpGet("export/pass-exam/{id:length(36)}")]
@ -1928,9 +1814,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
r.ExamId,
r.CitizenId,
r.Prefix,
r.FirstName,
r.LastName,
Fullname = $"{r.Prefix}{r.FirstName} {r.LastName}",
s.FullA,
s.SumA,
s.AStatus,
@ -1946,87 +1830,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
}
};
return Success(_data);
//var template_dir = Path.Combine(_webHostEnvironment.ContentRootPath, "Templates");
//var template_file = Path.Combine(template_dir, "PassAExamList.xlsx");
//var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp");
//if (!Directory.Exists(tmpDir))
// Directory.CreateDirectory(tmpDir);
//var exportFile = Path.Combine(tmpDir, $"PassExamList_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx");
//try
//{
// var result = (from r in data.Disables.ToList()
// join s in data_pass.ScoreImport.Scores.Where(x => x.AStatus == "ผ่าน").ToList() on r.ExamId equals s.ExamId
// select new
// {
// r.ExamId,
// r.CitizenId,
// r.Prefix,
// r.FirstName,
// r.LastName,
// s.FullA,
// s.SumA,
// s.AStatus,
// }).ToList();
// // copy template
// System.IO.File.Copy(template_file, exportFile);
// using (var excel = new ExcelPackage(new FileInfo(exportFile)))
// {
// var workSheet = excel.Workbook.Worksheets[0];
// workSheet.Cells[1, 2].Value = header;
// var disables = data.Disables.OrderBy(x => x.ExamId).ToList();
// var row = 4; // start at row 4
// foreach (var item in result)
// {
// workSheet.Cells[row, 1].Value = item.ExamId;
// workSheet.Cells[row, 2].Value = item.CitizenId;
// workSheet.Cells[row, 3].Value = $"{item.Prefix}{item.FirstName} {item.LastName}";
// workSheet.Cells[row, 4].Value = item.FullA;
// workSheet.Cells[row, 5].Value = item.SumA;
// workSheet.Cells[row, 6].Value = item.AStatus;
// row++;
// }
// excel.Save();
// using (FileStream fs = new FileStream(exportFile, FileMode.Open, FileAccess.Read))
// {
// byte[] bytes = System.IO.File.ReadAllBytes(exportFile);
// fs.Read(bytes, 0, System.Convert.ToInt32(fs.Length));
// fs.Close();
// var fname = Path.GetFileName(exportFile);
// Response.Headers["Content-Disposition"] = $"inline; filename={fname}";
// var ret = new FileContentResult(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
// {
// FileDownloadName = fname
// };
// return ret;
// }
// }
//}
//catch (Exception ex)
//{
// return Error(ex, "ไม่สามารถส่งออกรายชื่อผู้สอบผ่านได้!!");
//}
//finally
//{
// if (System.IO.File.Exists(exportFile))
// System.IO.File.Delete(exportFile);
//}
}
[HttpGet("export/pass/{id:length(36)}")]
@ -2060,8 +1863,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
Full = s.FullA + s.FullB + s.FullC,
Sum = s.SumA + s.SumB + s.SumC,
Status = s.ExamStatus,
Number = s.Number,
PositionName = r.PositionName,
s.Number,
r.PositionName,
r.PositionType,
r.PositionLevel,
}).ToList()
.OrderBy(x => x.ExamId)
.ThenBy(x => x.PositionName)
@ -2078,90 +1883,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
}
};
return Success(_data);
//var template_dir = Path.Combine(_webHostEnvironment.ContentRootPath, "Templates");
//var template_file = Path.Combine(template_dir, "PassExamList.xlsx");
//var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp");
//if (!Directory.Exists(tmpDir))
// Directory.CreateDirectory(tmpDir);
//var exportFile = Path.Combine(tmpDir, $"PassExamList_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx");
//try
//{
// var result = (from r in data.Disables.ToList()
// join s in data_pass.ScoreImport.Scores.Where(x => x.ExamStatus == "ผ่าน").ToList() on r.ExamId equals s.ExamId
// select new
// {
// r.ExamId,
// r.CitizenId,
// r.Prefix,
// r.FirstName,
// r.LastName,
// Full = s.FullA + s.FullB + s.FullC,
// Sum = s.SumA + s.SumB + s.SumC,
// Status = s.ExamStatus,
// r.PositionName,
// s.Number
// }).ToList();
// // copy template
// System.IO.File.Copy(template_file, exportFile);
// using (var excel = new ExcelPackage(new FileInfo(exportFile)))
// {
// var workSheet = excel.Workbook.Worksheets[0];
// workSheet.Cells[1, 2].Value = header;
// var disables = data.Disables.OrderBy(x => x.ExamId).ToList();
// var row = 4; // start at row 4
// foreach (var item in result)
// {
// workSheet.Cells[row, 1].Value = item.ExamId;
// workSheet.Cells[row, 2].Value = item.CitizenId;
// workSheet.Cells[row, 3].Value = $"{item.Prefix}{item.FirstName} {item.LastName}";
// workSheet.Cells[row, 4].Value = item.Full;
// workSheet.Cells[row, 5].Value = item.Sum;
// workSheet.Cells[row, 6].Value = item.Status;
// workSheet.Cells[row, 7].Value = item.Number;
// workSheet.Cells[row, 8].Value = item.PositionName;
// row++;
// }
// excel.Save();
// using (FileStream fs = new FileStream(exportFile, FileMode.Open, FileAccess.Read))
// {
// byte[] bytes = System.IO.File.ReadAllBytes(exportFile);
// fs.Read(bytes, 0, System.Convert.ToInt32(fs.Length));
// fs.Close();
// var fname = Path.GetFileName(exportFile);
// Response.Headers["Content-Disposition"] = $"inline; filename={fname}";
// var ret = new FileContentResult(bytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
// {
// FileDownloadName = fname
// };
// return ret;
// }
// }
//}
//catch (Exception ex)
//{
// return Error(ex, "ไม่สามารถส่งออกรายชื่อผู้สอบผ่านได้!!");
//}
//finally
//{
// if (System.IO.File.Exists(exportFile))
// System.IO.File.Delete(exportFile);
//}
}
/// <summary>

View file

@ -179,6 +179,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
ExamResult = sr == null ? "" : sr.ExamStatus,
University = p.Educations.First().University,
PositionName = p.PositionName,
PositionType = p.PositionType,
PositionLevel = p.PositionLevel,
ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}",
Number = sr == null ? "" : sr.Number,
// ExamCount = 10,

View file

@ -34,36 +34,36 @@ namespace BMA.EHR.Recurit.Exam.Service.Data
}
}
public DbSet<BMA.EHR.Profile.Service.Models.HR.ProfileOrganization> ProfileOrganizations { get; set; }
public DbSet<BMA.EHR.Profile.Service.Models.HR.Profile> Profiles { get; set; }
public DbSet<BMA.EHR.Profile.Service.Models.HR.ProfileSalary> ProfileSalaries { get; set; }
public DbSet<BMA.EHR.Profile.Service.Models.HR.OrganizationEntity> Organizations { get; set; }
// public DbSet<BMA.EHR.Profile.Service.Models.HR.ProfileOrganization> ProfileOrganizations { get; set; }
// public DbSet<BMA.EHR.Profile.Service.Models.HR.Profile> Profiles { get; set; }
// public DbSet<BMA.EHR.Profile.Service.Models.HR.ProfileSalary> ProfileSalaries { get; set; }
// public DbSet<BMA.EHR.Profile.Service.Models.HR.OrganizationEntity> Organizations { get; set; }
public DbSet<Prefix> Prefixes { get; set; }
// public DbSet<Prefix> Prefixes { get; set; }
public DbSet<Religion> Religions { get; set; }
// public DbSet<Religion> Religions { get; set; }
public DbSet<EducationLevel> EducationLevels { get; set; }
// public DbSet<EducationLevel> EducationLevels { get; set; }
public DbSet<Relationship> Relationships { get; set; }
// public DbSet<Relationship> Relationships { get; set; }
public DbSet<Province> Provinces { get; set; }
// public DbSet<Province> Provinces { get; set; }
public DbSet<District> Districts { get; set; }
// public DbSet<District> Districts { get; set; }
public DbSet<SubDistrict> SubDistricts { get; set; }
// public DbSet<SubDistrict> SubDistricts { get; set; }
public DbSet<OrganizationOrganization> OrganizationOrganizations { get; set; }
// public DbSet<OrganizationOrganization> OrganizationOrganizations { get; set; }
public DbSet<OrganizationShortName> OrganizationShortNames { get; set; }
// public DbSet<OrganizationShortName> OrganizationShortNames { get; set; }
public DbSet<Placement> Placements { get; set; }
public DbSet<PlacementCertificate> PlacementCertificates { get; set; }
public DbSet<PlacementEducation> PlacementEducations { get; set; }
public DbSet<PlacementIsProperty> PlacementIsProperties { get; set; }
public DbSet<PlacementProfile> PlacementProfiles { get; set; }
public DbSet<PlacementType> PlacementTypes { get; set; }
public DbSet<PositionPath> PositionPaths { get; set; }
public DbSet<Gender> Genders { get; set; }
// public DbSet<PositionPath> PositionPaths { get; set; }
// public DbSet<Gender> Genders { get; set; }
public DbSet<Document> Documents { get; set; }
}
}

View file

@ -1146,9 +1146,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid?>("PeriodExamId")
.HasColumnType("char(36)");
b.Property<string>("PositionLevel")
.HasColumnType("longtext");
b.Property<string>("PositionName")
.HasColumnType("longtext");
b.Property<string>("PositionType")
.HasColumnType("longtext");
b.Property<string>("Prefix")
.IsRequired()
.HasMaxLength(50)
@ -2727,7 +2733,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Career", b =>
{
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate")
.WithMany()
.WithMany("Careers")
.HasForeignKey("CandidateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@ -2938,6 +2944,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b =>
{
b.Navigation("Careers");
b.Navigation("Educations");
});

46
Data/OrgDbContext.cs Normal file
View file

@ -0,0 +1,46 @@
using BMA.EHR.Recurit.Exam.Service.Models;
using BMA.EHR.Recurit.Exam.Service.Models.Documents;
using Microsoft.EntityFrameworkCore;
using BMA.EHR.Domain.Models.Placement;
namespace BMA.EHR.Recurit.Exam.Service.Data
{
public class OrgDbContext : DbContext
{
public OrgDbContext(DbContextOptions<OrgDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
// The following configures EF to create a Sqlite database file in the
// special "local" folder for your platform.
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
if (!options.IsConfigured)
{
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production";
var configurationBuilder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true, true)
.AddJsonFile($"appsettings.{environment}.json", true, true)
.AddEnvironmentVariables()
.Build();
var historyConnection = configurationBuilder.GetConnectionString("HistoryConnection");
options.UseMySql(historyConnection, ServerVersion.AutoDetect(historyConnection));
}
}
public DbSet<Prefix> prefixe { get; set; }
public DbSet<Religion> religion { get; set; }
public DbSet<EducationLevel> educationLevel { get; set; }
public DbSet<Relationship> relationship { get; set; }
public DbSet<Province> province { get; set; }
public DbSet<District> district { get; set; }
public DbSet<SubDistrict> subDistrict { get; set; }
public DbSet<Gender> gender { get; set; }
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
/// <inheritdoc />
public partial class updatetableDisableaddpostype : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PositionLevel",
table: "Disables",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionType",
table: "Disables",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PositionLevel",
table: "Disables");
migrationBuilder.DropColumn(
name: "PositionType",
table: "Disables");
}
}
}

View file

@ -78,5 +78,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
public DateTime ApplyDate { get; set; }
public string? PositionName { get; set; }//
public string? PositionType { get; set; }
public string? PositionLevel { get; set; }
}
}

View file

@ -7,13 +7,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public class District : EntityBase
{
[Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
[Column(Order = 2), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 2), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
public virtual List<SubDistrict> SubDistricts { get; set; } = new();
// public virtual List<SubDistrict> SubDistricts { get; set; } = new();
public virtual Province? Province { get; set; }
// public virtual Province? Province { get; set; }
}
}

View file

@ -7,9 +7,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public class EducationLevel : EntityBase
{
[Required, MaxLength(100), Column(Order = 1), Comment("ระดับการศึกษา")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
[Column(Order = 2), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 2), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
}
}

View file

@ -29,7 +29,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
[Column(Order = 105), Comment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), MaxLength(200)]
public string LastUpdateFullName { get; set; } = string.Empty;
[Column(Order = 106), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 106), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
}
}

View file

@ -7,6 +7,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public class Gender : EntityBase
{
[Required, MaxLength(20), Column(Order = 1), Comment("เพศ")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
}
}

View file

@ -23,6 +23,9 @@ namespace BMA.EHR.Domain.Models.Placement
[Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
[Comment("Id การสอบ")]
public Guid? RefId { get; set; }
public virtual List<PlacementProfile> PlacementProfiles { get; set; } = new List<PlacementProfile>();
}
}

View file

@ -9,7 +9,9 @@ namespace BMA.EHR.Domain.Models.Placement
[Required, Comment("Id ผู้สมัคร")]
public virtual PlacementProfile? PlacementProfile { get; set; }
[Comment("Idวุฒิที่ได้รับ")]
public virtual EducationLevel? EducationLevel { get; set; }
public Guid? EducationLevelId { get; set; }
[Comment("วุฒิที่ได้รับ")]
public string? EducationLevelName { get; set; }
[MaxLength(1000), Comment("สถานศึกษา")]
public string? Institute { get; set; }
[MaxLength(200), Comment("วุฒิการศึกษา")]

View file

@ -19,13 +19,9 @@ namespace BMA.EHR.Domain.Models.Placement
[Comment("Id เพศ")]
public string? Gender { get; set; }
[Comment("Id ตำแหน่งที่สอบได้")]
public PositionPath? PositionCandidate { get; set; }
[Comment("ตำแหน่งที่สอบได้")]
public string? positionName { get; set; }
// [Comment("Id เลขที่ตำแหน่ง")]
// public OrganizationPositionEntity? OrganizationPosition { get; set; }
[Comment("วันที่บรรจุ")]
public DateTime? RecruitDate { get; set; }
[Comment("วันที่รายงานตัว")]
@ -50,8 +46,6 @@ namespace BMA.EHR.Domain.Models.Placement
public bool IsRelief { get; set; } = false;
[Comment("เหตุผลผ่อนผัน")]
public string? ReliefReason { get; set; }
// [Comment("Id เอกสารผ่อนผัน")]
// public Document? ReliefDoc { get; set; }
[Comment("การคัดกรองคุณสมบัติ")]
public string? IsProperty { get; set; }
@ -66,8 +60,6 @@ namespace BMA.EHR.Domain.Models.Placement
[Comment("Id สถานภาพ")]
public string? Relationship { get; set; }
// [Comment("Id กลุ่มเลือด")]
// public BloodGroup? BloodGroup { get; set; }
[Comment("Id ศาสนา")]
public string? Religion { get; set; }
@ -78,10 +70,10 @@ namespace BMA.EHR.Domain.Models.Placement
public string? CitizenId { get; set; }
[Comment("Id เขตที่ออกบัตรประชาชน")]
public string? CitizenDistrictId { get; set; }
public Guid? CitizenDistrictId { get; set; }
[Comment("Id จังหวัดที่ออกบัตรประชาชน")]
public string? CitizenProvinceId { get; set; }
public Guid? CitizenProvinceId { get; set; }
[Comment("วันที่ออกบัตร")]
public DateTime? CitizenDate { get; set; }
@ -99,13 +91,13 @@ namespace BMA.EHR.Domain.Models.Placement
public string? RegistAddress { get; set; }
[Comment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน")]
public string? RegistProvinceId { get; set; }
public Guid? RegistProvinceId { get; set; }
[Comment("Id อำเภอที่อยู่ตามทะเบียนบ้าน")]
public string? RegistDistrictId { get; set; }
public Guid? RegistDistrictId { get; set; }
[Comment("Id ตำบลที่อยู่ตามทะเบียนบ้าน")]
public string? RegistSubDistrictId { get; set; }
public Guid? RegistSubDistrictId { get; set; }
[MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน")]
public string? RegistZipCode { get; set; }
@ -117,13 +109,13 @@ namespace BMA.EHR.Domain.Models.Placement
public string? CurrentAddress { get; set; }
[Comment("Id จังหวัดที่อยู่ปัจจุบัน")]
public string? CurrentProvinceId { get; set; }
public Guid? CurrentProvinceId { get; set; }
[Comment("Id อำเภอที่อยู่ปัจจุบัน")]
public string? CurrentDistrictId { get; set; }
public Guid? CurrentDistrictId { get; set; }
[Comment("Id ตำบลที่อยู่ปัจจุบัน")]
public string? CurrentSubDistrictId { get; set; }
public Guid? CurrentSubDistrictId { get; set; }
[MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน")]
public string? CurrentZipCode { get; set; }
@ -192,25 +184,15 @@ namespace BMA.EHR.Domain.Models.Placement
[MaxLength(20), Comment("ตำแหน่งปัจจุบัน เบอร์โทรที่ทำงาน")]
public string? OccupationTelephone { get; set; }
// [Comment("Id ตำแหน่งเลขที่")]
// public PositionNumberEntity? PositionNumber { get; set; }
// [Comment("Id ตำแหน่ง")]
// public PositionPath? PositionPath { get; set; }
// [Comment("Id ด้าน/สาขา")]
// public PositionPathSide? PositionPathSide { get; set; }
[Comment("ตำแหน่งสอบ")]
public string? PositionCandidate { get; set; }
[Comment("ประเภทตำแหน่ง")]
public string? PositionType { get; set; }
// [Comment("Id สายงาน")]
// public PositionLine? PositionLine { get; set; }
[Comment("ระดับ")]
public string? PositionLevel { get; set; }
[Comment("คะแนนเต็มภาค ก")]
public double? PointTotalA { get; set; }

View file

@ -7,9 +7,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public class Prefix : EntityBase
{
[Required, MaxLength(50), Column(Order = 2), Comment("รายละเอียดคำนำหน้า")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
[Column(Order = 3), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 3), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
}
}

View file

@ -7,11 +7,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public class Province : EntityBase
{
[Required, MaxLength(150), Column(Order = 1), Comment("จังหวัด")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
[Column(Order = 2), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 2), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
public virtual List<District> Districts { get; set; } = new();
// public virtual List<District> Districts { get; set; } = new();
}
}

View file

@ -7,8 +7,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Models;
public class Relationship : EntityBase
{
[Required, MaxLength(50), Column(Order = 1), Comment("ชื่อความสัมพันธ์")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
[Column(Order = 2), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 2), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
}

View file

@ -7,9 +7,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public class Religion : EntityBase
{
[Required, MaxLength(100), Column(Order = 1), Comment("ศาสนา")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
[Column(Order = 2), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 2), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
}
}

View file

@ -7,14 +7,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Models
public class SubDistrict : EntityBase
{
[Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")]
public string Name { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
[Required, MaxLength(10), Column(Order = 2), Comment("รหัสไปรษณีย์")]
public string ZipCode { get; set; } = string.Empty;
public string zipCode { get; set; } = string.Empty;
[Column(Order = 3), Comment("สถานะการใช้งาน")]
public bool IsActive { get; set; } = true;
// [Column(Order = 3), Comment("สถานะการใช้งาน")]
// public bool IsActive { get; set; } = true;
public virtual District? District { get; set; }
// public virtual District? District { get; set; }
}
}

View file

@ -65,6 +65,9 @@ builder.Host.UseSerilog();
var examConnection = builder.Configuration.GetConnectionString("ExamConnection");
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseMySql(examConnection, ServerVersion.AutoDetect(examConnection)));
var orgConnection = builder.Configuration.GetConnectionString("OrgConnection");
builder.Services.AddDbContext<OrgDbContext>(options =>
options.UseMySql(orgConnection, ServerVersion.AutoDetect(orgConnection)));
var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDbContext<MetadataDbContext>(options =>
options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection)));

View file

@ -19,6 +19,8 @@
public static string PersonalCardExpireDate = "CusIDExpireDate";
public static string ApplyDate = "DateTime";
public static string PositionName = "PositionName";
public static string PositionType = "PositionType";
public static string PositionLevel = "PositionLevel";
// Address
public static string Address = "Address";

View file

@ -11,7 +11,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
public bool CheckDisability { get; set; }
public int? Round { get; set; }
public int? Year { get; set; }
public Guid? OcId { get; set; }
public string CreatedUserId { get; set; }
public float? Fee { get; set; }
public DateTime? RegisterStartDate { get; set; }

View file

@ -19,7 +19,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
#region " Fields "
private readonly ApplicationDbContext _context;
private readonly MetadataDbContext _contextMetadata;
private readonly OrgDbContext _contextOrg;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly MinIOService _minioService;
@ -28,12 +28,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
#region " Constructor and Destructor "
public CMSCandidateService(ApplicationDbContext context,
MetadataDbContext contextMetadata,
OrgDbContext contextOrg,
IHttpContextAccessor httpContextAccessor,
MinIOService minioService)
{
_context = context;
_contextMetadata = contextMetadata;
_contextOrg = contextOrg;
_httpContextAccessor = httpContextAccessor;
_minioService = minioService;
}
@ -139,39 +139,39 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (updated.ProvinceId != null)
{
var province = await _contextMetadata.Provinces.AsQueryable()
var province = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ProvinceId));
if (province == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
cms.ProvinceId = province.Id;
cms.ProvinceName = province.Name;
cms.ProvinceName = province.name;
}
if (updated.DistrictId != null)
{
var pistrict = await _contextMetadata.Districts.AsQueryable()
var pistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.DistrictId));
if (pistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
cms.DistrictId = pistrict.Id;
cms.DistrictName = pistrict.Name;
cms.DistrictName = pistrict.name;
}
if (updated.SubDistrictId != null)
{
var subDistrict = await _contextMetadata.SubDistricts.AsQueryable()
var subDistrict = await _contextOrg.subDistrict.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.SubDistrictId));
if (subDistrict == null)
throw new Exception(GlobalMessages.SubDistrictNotFound);
cms.SubDistrictId = subDistrict.Id;
cms.SubDistrictName = subDistrict.Name;
cms.ZipCode = subDistrict.ZipCode;
cms.SubDistrictName = subDistrict.name;
cms.ZipCode = subDistrict.zipCode;
}
cms.About = updated.About;

View file

@ -1,5 +1,4 @@
using System.Security.Claims;
using BMA.EHR.Domain.Models.Placement;
using BMA.EHR.Recurit.Exam.Service.Extensions;
using BMA.EHR.Recurit.Exam.Service.Core;
using BMA.EHR.Recurit.Exam.Service.Data;
@ -7,7 +6,6 @@ using BMA.EHR.Recurit.Exam.Service.Models;
using BMA.EHR.Recurit.Exam.Service.Request;
using BMA.EHR.Recurit.Exam.Service.Response;
using BMA.EHR.Recurit.Exam.Service.Responses.Document;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace BMA.EHR.Recurit.Exam.Service.Services
@ -17,7 +15,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
#region " Fields "
private readonly ApplicationDbContext _context;
private readonly MetadataDbContext _contextMetadata;
private readonly OrgDbContext _contextOrg;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly MinIOService _minioService;
private readonly MailService _mailService;
@ -27,13 +25,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
#region " Constructor and Destructor "
public CandidateService(ApplicationDbContext context,
MetadataDbContext contextMetadata,
OrgDbContext contextOrg,
IHttpContextAccessor httpContextAccessor,
MinIOService minioService,
MailService mailService)
{
_context = context;
_contextMetadata = contextMetadata;
_contextOrg = contextOrg;
_httpContextAccessor = httpContextAccessor;
_minioService = minioService;
_mailService = mailService;
@ -742,112 +740,112 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (updated.PrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.PrefixId));
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.PrefixId = prefix.Id;
candidate.PrefixName = prefix.Name;
candidate.PrefixName = prefix.name;
}
if (updated.ContactPrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.ContactPrefixId);
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.ContactPrefixId = prefix.Id;
candidate.ContactPrefixName = prefix.Name;
candidate.ContactPrefixName = prefix.name;
}
if (updated.ReligionId != null)
{
var religion = await _contextMetadata.Religions.AsQueryable()
var religion = await _contextOrg.religion.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ReligionId));
if (religion == null)
throw new Exception(GlobalMessages.ReligionNotFound);
candidate.ReligionId = religion.Id;
candidate.ReligionName = religion.Name;
candidate.ReligionName = religion.name;
}
if (updated.RegistProvinceId != null)
{
var registProvince = await _contextMetadata.Provinces.AsQueryable()
var registProvince = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistProvinceId));
if (registProvince == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
candidate.RegistProvinceId = registProvince.Id;
candidate.RegistProvinceName = registProvince.Name;
candidate.RegistProvinceName = registProvince.name;
}
if (updated.RegistDistrictId != null)
{
var registDistrict = await _contextMetadata.Districts.AsQueryable()
var registDistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistDistrictId));
if (registDistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
candidate.RegistDistrictId = registDistrict.Id;
candidate.RegistDistrictName = registDistrict.Name;
candidate.RegistDistrictName = registDistrict.name;
}
if (updated.RegistSubDistrictId != null)
{
var registSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
var registSubDistrict = await _contextOrg.subDistrict.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistSubDistrictId));
if (registSubDistrict == null)
throw new Exception(GlobalMessages.SubDistrictNotFound);
candidate.RegistSubDistrictId = registSubDistrict.Id;
candidate.RegistSubDistrictName = registSubDistrict.Name;
candidate.RegistZipCode = registSubDistrict.ZipCode;
candidate.RegistSubDistrictName = registSubDistrict.name;
candidate.RegistZipCode = registSubDistrict.zipCode;
}
if (updated.CurrentProvinceId != null)
{
var currentProvince = await _contextMetadata.Provinces.AsQueryable()
var currentProvince = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentProvinceId));
if (currentProvince == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
candidate.CurrentProvinceId = currentProvince.Id;
candidate.CurrentProvinceName = currentProvince.Name;
candidate.CurrentProvinceName = currentProvince.name;
}
if (updated.CurrentDistrictId != null)
{
var currentDistrict = await _contextMetadata.Districts.AsQueryable()
var currentDistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentDistrictId));
if (currentDistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
candidate.CurrentDistrictId = currentDistrict.Id;
candidate.CurrentDistrictName = currentDistrict.Name;
candidate.CurrentDistrictName = currentDistrict.name;
}
if (updated.CurrentSubDistrictId != null)
{
var currentSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
var currentSubDistrict = await _contextOrg.subDistrict.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentSubDistrictId));
if (currentSubDistrict == null)
throw new Exception(GlobalMessages.SubDistrictNotFound);
candidate.CurrentSubDistrictId = currentSubDistrict.Id;
candidate.CurrentSubDistrictName = currentSubDistrict.Name;
candidate.CurrentZipCode = currentSubDistrict.ZipCode;
candidate.CurrentSubDistrictName = currentSubDistrict.name;
candidate.CurrentZipCode = currentSubDistrict.zipCode;
}
candidate.FirstName = updated.FirstName;
@ -896,24 +894,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
};
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelExamId = educationLevelExam.Id;
education.EducationLevelExamName = educationLevelExam.Name;
education.EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelHighId = educationLevelHigh.Id;
education.EducationLevelHighName = educationLevelHigh.Name;
education.EducationLevelHighName = educationLevelHigh.name;
}
await _context.Educations.AddAsync(education);
}
@ -930,24 +928,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? "";
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name;
}
}
@ -966,112 +964,112 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (updated.PrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.PrefixId));
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.PrefixId = prefix.Id;
candidate.PrefixName = prefix.Name;
candidate.PrefixName = prefix.name;
}
if (updated.ContactPrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.ContactPrefixId);
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.ContactPrefixId = prefix.Id;
candidate.ContactPrefixName = prefix.Name;
candidate.ContactPrefixName = prefix.name;
}
if (updated.ReligionId != null)
{
var religion = await _contextMetadata.Religions.AsQueryable()
var religion = await _contextOrg.religion.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.ReligionId));
if (religion == null)
throw new Exception(GlobalMessages.ReligionNotFound);
candidate.ReligionId = religion.Id;
candidate.ReligionName = religion.Name;
candidate.ReligionName = religion.name;
}
if (updated.RegistProvinceId != null)
{
var registProvince = await _contextMetadata.Provinces.AsQueryable()
var registProvince = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistProvinceId));
if (registProvince == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
candidate.RegistProvinceId = registProvince.Id;
candidate.RegistProvinceName = registProvince.Name;
candidate.RegistProvinceName = registProvince.name;
}
if (updated.RegistDistrictId != null)
{
var registDistrict = await _contextMetadata.Districts.AsQueryable()
var registDistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistDistrictId));
if (registDistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
candidate.RegistDistrictId = registDistrict.Id;
candidate.RegistDistrictName = registDistrict.Name;
candidate.RegistDistrictName = registDistrict.name;
}
if (updated.RegistSubDistrictId != null)
{
var registSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
var registSubDistrict = await _contextOrg.subDistrict.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistSubDistrictId));
if (registSubDistrict == null)
throw new Exception(GlobalMessages.SubDistrictNotFound);
candidate.RegistSubDistrictId = registSubDistrict.Id;
candidate.RegistSubDistrictName = registSubDistrict.Name;
candidate.RegistZipCode = registSubDistrict.ZipCode;
candidate.RegistSubDistrictName = registSubDistrict.name;
candidate.RegistZipCode = registSubDistrict.zipCode;
}
if (updated.CurrentProvinceId != null)
{
var currentProvince = await _contextMetadata.Provinces.AsQueryable()
var currentProvince = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentProvinceId));
if (currentProvince == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
candidate.CurrentProvinceId = currentProvince.Id;
candidate.CurrentProvinceName = currentProvince.Name;
candidate.CurrentProvinceName = currentProvince.name;
}
if (updated.CurrentDistrictId != null)
{
var currentDistrict = await _contextMetadata.Districts.AsQueryable()
var currentDistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentDistrictId));
if (currentDistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
candidate.CurrentDistrictId = currentDistrict.Id;
candidate.CurrentDistrictName = currentDistrict.Name;
candidate.CurrentDistrictName = currentDistrict.name;
}
if (updated.CurrentSubDistrictId != null)
{
var currentSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
var currentSubDistrict = await _contextOrg.subDistrict.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentSubDistrictId));
if (currentSubDistrict == null)
throw new Exception(GlobalMessages.SubDistrictNotFound);
candidate.CurrentSubDistrictId = currentSubDistrict.Id;
candidate.CurrentSubDistrictName = currentSubDistrict.Name;
candidate.CurrentZipCode = currentSubDistrict.ZipCode;
candidate.CurrentSubDistrictName = currentSubDistrict.name;
candidate.CurrentZipCode = currentSubDistrict.zipCode;
}
candidate.FirstName = updated.FirstName;
@ -1121,24 +1119,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
};
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelExamId = educationLevelExam.Id;
education.EducationLevelExamName = educationLevelExam.Name;
education.EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelHighId = educationLevelHigh.Id;
education.EducationLevelHighName = educationLevelHigh.Name;
education.EducationLevelHighName = educationLevelHigh.name;
}
await _context.Educations.AddAsync(education);
}
@ -1155,24 +1153,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? "";
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name;
}
}
await _context.SaveChangesAsync();
@ -1190,50 +1188,50 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (updated.PrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.PrefixId));
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.PrefixId = prefix.Id;
candidate.PrefixName = prefix.Name;
candidate.PrefixName = prefix.name;
}
if (updated.RelationshipId != null)
{
var relationship = await _contextMetadata.Relationships.AsQueryable()
var relationship = await _contextOrg.relationship.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RelationshipId));
if (relationship == null)
throw new Exception(GlobalMessages.RelationshipNotFound);
candidate.RelationshipId = relationship.Id;
candidate.RelationshipName = relationship.Name;
candidate.RelationshipName = relationship.name;
}
if (updated.CitizenProvinceId != null)
{
var citizenProvince = await _contextMetadata.Provinces.AsQueryable()
var citizenProvince = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenProvinceId));
if (citizenProvince == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
candidate.CitizenProvinceId = citizenProvince.Id;
candidate.CitizenProvinceName = citizenProvince.Name;
candidate.CitizenProvinceName = citizenProvince.name;
}
if (updated.CitizenDistrictId != null)
{
var citizenDistrict = await _contextMetadata.Districts.AsQueryable()
var citizenDistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CitizenDistrictId));
if (citizenDistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
candidate.CitizenDistrictId = citizenDistrict.Id;
candidate.CitizenDistrictName = citizenDistrict.Name;
candidate.CitizenDistrictName = citizenDistrict.name;
}
candidate.FirstName = updated.FirstName;
@ -1310,76 +1308,76 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (updated.RegistProvinceId != null)
{
var registProvince = await _contextMetadata.Provinces.AsQueryable()
var registProvince = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistProvinceId));
if (registProvince == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
candidate.RegistProvinceId = registProvince.Id;
candidate.RegistProvinceName = registProvince.Name;
candidate.RegistProvinceName = registProvince.name;
}
if (updated.RegistDistrictId != null)
{
var registDistrict = await _contextMetadata.Districts.AsQueryable()
var registDistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistDistrictId));
if (registDistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
candidate.RegistDistrictId = registDistrict.Id;
candidate.RegistDistrictName = registDistrict.Name;
candidate.RegistDistrictName = registDistrict.name;
}
if (updated.RegistSubDistrictId != null)
{
var registSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
var registSubDistrict = await _contextOrg.subDistrict.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.RegistSubDistrictId));
if (registSubDistrict == null)
throw new Exception(GlobalMessages.SubDistrictNotFound);
candidate.RegistSubDistrictId = registSubDistrict.Id;
candidate.RegistSubDistrictName = registSubDistrict.Name;
candidate.RegistZipCode = registSubDistrict.ZipCode;
candidate.RegistSubDistrictName = registSubDistrict.name;
candidate.RegistZipCode = registSubDistrict.zipCode;
}
if (updated.CurrentProvinceId != null)
{
var currentProvince = await _contextMetadata.Provinces.AsQueryable()
var currentProvince = await _contextOrg.province.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentProvinceId));
if (currentProvince == null)
throw new Exception(GlobalMessages.ProvinceNotFound);
candidate.CurrentProvinceId = currentProvince.Id;
candidate.CurrentProvinceName = currentProvince.Name;
candidate.CurrentProvinceName = currentProvince.name;
}
if (updated.CurrentDistrictId != null)
{
var currentDistrict = await _contextMetadata.Districts.AsQueryable()
var currentDistrict = await _contextOrg.district.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentDistrictId));
if (currentDistrict == null)
throw new Exception(GlobalMessages.DistrictNotFound);
candidate.CurrentDistrictId = currentDistrict.Id;
candidate.CurrentDistrictName = currentDistrict.Name;
candidate.CurrentDistrictName = currentDistrict.name;
}
if (updated.CurrentSubDistrictId != null)
{
var currentSubDistrict = await _contextMetadata.SubDistricts.AsQueryable()
var currentSubDistrict = await _contextOrg.subDistrict.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.CurrentSubDistrictId));
if (currentSubDistrict == null)
throw new Exception(GlobalMessages.SubDistrictNotFound);
candidate.CurrentSubDistrictId = currentSubDistrict.Id;
candidate.CurrentSubDistrictName = currentSubDistrict.Name;
candidate.CurrentZipCode = currentSubDistrict.ZipCode;
candidate.CurrentSubDistrictName = currentSubDistrict.name;
candidate.CurrentZipCode = currentSubDistrict.zipCode;
}
candidate.RegistAddress = updated.RegistAddress;
@ -1401,38 +1399,38 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (updated.MarryPrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MarryPrefixId));
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.MarryPrefixId = prefix.Id;
candidate.MarryPrefixName = prefix.Name;
candidate.MarryPrefixName = prefix.name;
}
if (updated.FatherPrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.FatherPrefixId));
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.FatherPrefixId = prefix.Id;
candidate.FatherPrefixName = prefix.Name;
candidate.FatherPrefixName = prefix.name;
}
if (updated.MotherPrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.MotherPrefixId));
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.MotherPrefixId = prefix.Id;
candidate.MotherPrefixName = prefix.Name;
candidate.MotherPrefixName = prefix.name;
}
candidate.Marry = updated.Marry == null ? null : updated.Marry;
@ -1485,14 +1483,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (updated.ContactPrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
var prefix = await _contextOrg.prefixe.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.ContactPrefixId);
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.ContactPrefixId = prefix.Id;
candidate.ContactPrefixName = prefix.Name;
candidate.ContactPrefixName = prefix.name;
}
candidate.ContactFirstname = updated.ContactFirstname;
candidate.ContactLastname = updated.ContactLastname;
@ -1681,24 +1679,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
};
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelExamId = educationLevelExam.Id;
education.EducationLevelExamName = educationLevelExam.Name;
education.EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelHighId = educationLevelHigh.Id;
education.EducationLevelHighName = educationLevelHigh.Name;
education.EducationLevelHighName = educationLevelHigh.name;
}
await _context.Educations.AddAsync(education);
}
@ -1715,24 +1713,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? "";
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name;
}
}
@ -1767,24 +1765,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
};
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelExamId = educationLevelExam.Id;
education.EducationLevelExamName = educationLevelExam.Name;
education.EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
education.EducationLevelHighId = educationLevelHigh.Id;
education.EducationLevelHighName = educationLevelHigh.Name;
education.EducationLevelHighName = educationLevelHigh.name;
}
await _context.Educations.AddAsync(education);
}
@ -1801,24 +1799,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
candidate.Educations.FirstOrDefault().LastUpdateFullName = FullName ?? "";
if (updated.EducationLevelExamId != null)
{
var educationLevelExam = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelExam = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelExamId);
if (educationLevelExam == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelExamId = educationLevelExam.Id;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.Name;
candidate.Educations.FirstOrDefault().EducationLevelExamName = educationLevelExam.name;
}
if (updated.EducationLevelHighId != null)
{
var educationLevelHigh = await _contextMetadata.EducationLevels.AsQueryable()
var educationLevelHigh = await _contextOrg.educationLevel.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.EducationLevelHighId);
if (educationLevelHigh == null)
throw new Exception(GlobalMessages.EducationLevelNotFound);
candidate.Educations.FirstOrDefault().EducationLevelHighId = educationLevelHigh.Id;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.Name;
candidate.Educations.FirstOrDefault().EducationLevelHighName = educationLevelHigh.name;
}
}
await _context.SaveChangesAsync();
@ -1868,7 +1866,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
// if (education == null)
// throw new Exception(GlobalMessages.EducationNotFound);
// var educationLevel = await _contextMetadata.EducationLevels.AsQueryable()
// var educationLevel = await _contextOrg.educationLevel.AsQueryable()
// .FirstOrDefaultAsync(x => x.Id == Guid.Parse(updated.EducationLevelId));
// if (educationLevel == null)

View file

@ -1,18 +1,14 @@
using System.Security.Claims;
using System.Text.Json;
using BMA.EHR.Domain.Models.Placement;
using BMA.EHR.Recurit.Exam.Service.Extensions;
using BMA.EHR.Recurit.Exam.Service.Core;
using BMA.EHR.Recurit.Exam.Service.Data;
using BMA.EHR.Recurit.Exam.Service.Models;
using BMA.EHR.Recurit.Exam.Service.Models.Documents;
using BMA.EHR.Recurit.Exam.Service.Request;
using BMA.EHR.Recurit.Exam.Service.Response;
using BMA.EHR.Recurit.Exam.Service.Responses.Document;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json.Linq;
using OfficeOpenXml;
using BMA.EHR.Domain.Models.Placement;
using OfficeOpenXml.Style;
using System.Text;
using Newtonsoft.Json;
@ -26,6 +22,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
private readonly ApplicationDbContext _context;
private readonly MetadataDbContext _contextMetadata;
private readonly OrgDbContext _contextOrg;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly MinIOService _minioService;
private readonly MailService _mailService;
@ -37,6 +34,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
public PeriodExamService(ApplicationDbContext context,
MetadataDbContext contextMetadata,
OrgDbContext contextOrg,
IHttpContextAccessor httpContextAccessor,
MinIOService minioService,
MailService mailService,
@ -44,6 +42,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
{
_context = context;
_contextMetadata = contextMetadata;
_contextOrg = contextOrg;
_httpContextAccessor = httpContextAccessor;
_minioService = minioService;
_mailService = mailService;
@ -92,33 +91,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
}
}
private List<Guid?> GetAllIdByRoot(Guid id)
{
try
{
var ret = new List<Guid?>();
var oc = _contextMetadata.Organizations.FirstOrDefault(x => x.Id == id && x.IsActive);
if (oc != null)
ret.Add(oc.Id);
var child = _contextMetadata.Organizations.AsQueryable().Where(x => x.ParentId == id && x.IsActive).ToList();
if (child.Any())
{
foreach (var item in child)
{
ret.AddRange(GetAllIdByRoot(item.Id));
}
}
return ret;
}
catch
{
throw;
}
}
public async Task<IEnumerable<PeriodExamCandidateResponseItem>> GetsAsync(string type, bool showAll = true)
{
var periodExams = await _context.PeriodExams.AsQueryable()
@ -126,11 +98,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
.Where(p => p.CheckDisability == false)
.Where(p => type.ToUpper() == "ALL" ? (p.AnnouncementExam == true || p.AnnouncementExam == false) : (type.ToUpper() == "EXAM" ? p.AnnouncementExam == true : p.AnnouncementExam == false))
.OrderByDescending(d => d.CreatedAt).ToListAsync();
var profileOrganizations = await _contextMetadata.ProfileOrganizations.AsQueryable()
.ToListAsync();
var _periodExams = (from x in periodExams
join po in profileOrganizations on Guid.Parse(x.CreatedUserId) equals po?.UserId into poGroup
from po in poGroup.DefaultIfEmpty()
select new PeriodExamCandidateResponseItem
{
ExamDate = x.ExamDate,
@ -161,30 +129,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Round = x.Round,
SetSeat = x.SetSeat,
Year = x.Year,
OcId = po == null ? null : po.OrganizationId,
CreatedUserId = x.CreatedUserId,
}).AsQueryable()
.ToList();
var roles = _httpContextAccessor?.HttpContext?.User?.FindAll(ClaimTypes.Role)?.Select(c => c.Value).ToList();
// if (!roles.Contains("head"))
// {
// var criteria = new List<Guid?>();
// var profileOrganization = await _contextMetadata.ProfileOrganizations.AsQueryable()
// .FirstOrDefaultAsync(x => x.UserId == Guid.Parse(UserId));
// if (profileOrganization == null)
// return new List<PeriodExamCandidateResponseItem>();
// var ocId = _contextMetadata.Organizations.AsQueryable()
// .FirstOrDefault(x => x.Id == profileOrganization.OrganizationId);
// if (ocId == null)
// return new List<PeriodExamCandidateResponseItem>();
// criteria = GetAllIdByRoot(ocId.Id);
// if (criteria.Any())
// _periodExams = _periodExams.Where(x => x.CreatedUserId == UserId || criteria.Contains(x.OcId == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.OcId)).ToList();
// }
return _periodExams;
}
@ -1810,7 +1759,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
}
if (careers.Count == 0)
row++;
Console.WriteLine(num);
num = num + 1;
}
summarySheet.Cells[summarySheet.Dimension.Address].AutoFitColumns();
@ -2080,13 +2028,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
throw new Exception(GlobalMessages.ExamNotFound);
var _placement = await _contextMetadata.Placements.AsQueryable()
.FirstOrDefaultAsync(x => x.Name == periodExam.Name && x.Year == ((int)(periodExam.Year == null ? 0 : periodExam.Year)));
.FirstOrDefaultAsync(x => x.PlacementType.Name == "สอบคัดเลือก" && x.RefId == periodExam.Id);
if (_placement != null)
throw new Exception("รอบการสอบนี้ได้ทำการบรรจุไปแล้ว");
var placement = new Placement
{
Name = periodExam.Name,
RefId = periodExam.Id,
Round = periodExam.Round == null ? "" : periodExam.Round.ToString(),
Year = (int)(periodExam.Year == null ? 0 : periodExam.Year),
Number = periodExam.Candidate.Where(x => x.Status.Contains("done")).Count(),
@ -2126,65 +2075,50 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
}
}
var profile = await _contextMetadata.Profiles
.Include(x => x.Salaries)
.FirstOrDefaultAsync(p => p.CitizenId == candidate.CitizenId);
var Prefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.PrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.PrefixId).FirstOrDefaultAsync();
var Religion = await _contextMetadata.Religions.Where(x => x.Id == candidate.ReligionId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.ReligionId).FirstOrDefaultAsync();
var CitizenDistrict = await _contextMetadata.Districts.Where(x => x.Id == candidate.CitizenDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CitizenDistrictId).FirstOrDefaultAsync();
var CitizenProvince = await _contextMetadata.Provinces.Where(x => x.Id == candidate.CitizenProvinceId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CitizenProvinceId).FirstOrDefaultAsync();
var RegistProvince = await _contextMetadata.Provinces.Where(x => x.Id == candidate.RegistProvinceId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.RegistProvinceId).FirstOrDefaultAsync();
var RegistDistrict = await _contextMetadata.Districts.Where(x => x.Id == candidate.RegistDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.RegistDistrictId).FirstOrDefaultAsync();
var RegistSubDistrict = await _contextMetadata.SubDistricts.Where(x => x.Id == candidate.RegistSubDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.RegistSubDistrictId).FirstOrDefaultAsync();
var CurrentProvince = await _contextMetadata.Provinces.Where(x => x.Id == candidate.CurrentProvinceId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CurrentProvinceId).FirstOrDefaultAsync();
var CurrentDistrict = await _contextMetadata.Districts.Where(x => x.Id == candidate.CurrentDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CurrentDistrictId).FirstOrDefaultAsync();
var CurrentSubDistrict = await _contextMetadata.SubDistricts.Where(x => x.Id == candidate.CurrentSubDistrictId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.CurrentSubDistrictId).FirstOrDefaultAsync();
var MarryPrefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MarryPrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MarryPrefixId).FirstOrDefaultAsync();
var FatherPrefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.FatherPrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.FatherPrefixId).FirstOrDefaultAsync();
var MotherPrefix = await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MotherPrefixId).FirstOrDefaultAsync() == null ? null : await _contextMetadata.Prefixes.Where(x => x.Id == candidate.MotherPrefixId).FirstOrDefaultAsync();
var placementProfile = new PlacementProfile
{
Placement = placement,
PositionCandidate = await _contextMetadata.PositionPaths.FirstOrDefaultAsync(x => x.Id == (candidate.PositionExam == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : candidate.PositionExam.PositionId)),
positionName = candidate.PositionExam.PositionName,
Prefix = Prefix == null ? null : Prefix.Name,
ProfileImg = candidate.ProfileImg,
PositionCandidate = candidate?.PositionExam?.PositionName ?? null,
PositionLevel = candidate?.PositionExam?.PositionLevelName ?? null,
PositionType = candidate.PositionExam == null ? null : (candidate.PositionExam.HighDegree == null ? null : (candidate.PositionExam.HighDegree == true ? "วิชาการ" : "ทั่วไป")),
Prefix = candidate.PrefixName,
// ProfileImg = candidate.ProfileImg,
Firstname = candidate.FirstName,
Lastname = candidate.LastName,
Nationality = candidate.Nationality,
DateOfBirth = candidate.DateOfBirth,
Religion = Religion == null ? null : Religion.Name,
Religion = candidate.ReligionName,
Email = candidate.Email,
CitizenId = candidate.CitizenId,
CitizenDistrictId = CitizenDistrict == null ? null : CitizenDistrict.Id.ToString(),
CitizenProvinceId = CitizenProvince == null ? null : CitizenProvince.Id.ToString(),
CitizenDistrictId = candidate.CitizenDistrictId,
CitizenProvinceId = candidate.CitizenProvinceId,
CitizenDate = candidate.CitizenDate,
Telephone = candidate.Telephone,
MobilePhone = candidate.MobilePhone,
Knowledge = candidate.Knowledge,
RegistAddress = candidate.RegistAddress,
RegistProvinceId = RegistProvince == null ? null : RegistProvince.Id.ToString(),
RegistDistrictId = RegistDistrict == null ? null : RegistDistrict.Id.ToString(),
RegistSubDistrictId = RegistSubDistrict == null ? null : RegistSubDistrict.Id.ToString(),
RegistProvinceId = candidate.RegistProvinceId,
RegistDistrictId = candidate.RegistDistrictId,
RegistSubDistrictId = candidate.RegistSubDistrictId,
RegistZipCode = candidate.RegistZipCode,
RegistSame = candidate.RegistSame,
CurrentAddress = candidate.CurrentAddress,
CurrentProvinceId = CurrentProvince == null ? null : CurrentProvince.Id.ToString(),
CurrentDistrictId = CurrentDistrict == null ? null : CurrentDistrict.Id.ToString(),
CurrentSubDistrictId = CurrentSubDistrict == null ? null : CurrentSubDistrict.Id.ToString(),
CurrentProvinceId = candidate.CurrentProvinceId,
CurrentDistrictId = candidate.CurrentDistrictId,
CurrentSubDistrictId = candidate.CurrentSubDistrictId,
CurrentZipCode = candidate.CurrentZipCode,
Marry = candidate.Marry,
MarryPrefix = MarryPrefix == null ? null : MarryPrefix.Name,
MarryPrefix = candidate.MarryPrefixName,
MarryFirstName = candidate.MarryFirstName,
MarryLastName = candidate.MarryLastName,
MarryOccupation = candidate.MarryOccupation,
MarryNationality = candidate.MarryNationality,
FatherPrefix = FatherPrefix == null ? null : FatherPrefix.Name,
FatherPrefix = candidate.FatherPrefixName,
FatherFirstName = candidate.FatherFirstName,
FatherLastName = candidate.FatherLastName,
FatherOccupation = candidate.FatherOccupation,
FatherNationality = candidate.FatherNationality,
MotherPrefix = MotherPrefix == null ? null : MotherPrefix.Name,
MotherPrefix = candidate.MotherPrefixName,
MotherFirstName = candidate.MotherFirstName,
MotherLastName = candidate.MotherLastName,
MotherOccupation = candidate.MotherOccupation,
@ -2195,8 +2129,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
OccupationSalary = candidate.OccupationSalary,
OccupationPosition = candidate.OccupationPosition,
OccupationPositionType = candidate.OccupationPositionType,
PositionLevel = candidate.PositionExam.PositionLevelName,
PositionType = candidate.PositionExam == null ? null : (candidate.PositionExam.HighDegree == null ? null : (candidate.PositionExam.HighDegree == true ? "วิชาการ":"ทั่วไป")),
OccupationTelephone = candidate.OccupationTelephone,
PointTotalA = candidate.PointTotalA == null ? null : Convert.ToDouble(candidate.PointTotalA),
PointA = candidate.PointA == null ? null : Convert.ToDouble(candidate.PointA),
@ -2210,9 +2142,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
PlacementStatus = "UN-CONTAIN",
Pass = candidate.Pass,
RemarkHorizontal = "โดยมีเงื่อนไขว่าต้องปฏิบัติงานให้กรุงเทพมหานครเป็นระยะเวลาไม่น้อยกว่า ๕ ปี นับแต่วันที่ได้รับการบรรจุและแต่งตั้ง โดยห้ามโอนไปหน่วยงานหรือส่วนราชการอื่น เว้นเเต่ลาออกจากราชการ",
Amount = org == null || org.result == null ? null : org.result.amount,
PositionSalaryAmount = org == null || org.result == null ? null : org.result.positionSalaryAmount,
MouthSalaryAmount = org == null || org.result == null ? null : org.result.mouthSalaryAmount,
Amount = org?.result?.amount ?? null,
PositionSalaryAmount = org?.result?.positionSalaryAmount ?? null,
MouthSalaryAmount = org?.result?.mouthSalaryAmount ?? null,
CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "",
@ -2220,36 +2152,34 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
LastUpdateUserId = UserId ?? "",
LastUpdateFullName = FullName ?? "",
IsOfficer = IsOfficer,
profileId = org == null || org.result == null ? null : org.result.profileId,
profileId = org?.result?.profileId ?? null,
IsOld = org == null || org.result == null ? false : true,
AmountOld = org == null || org.result == null ? null : org.result.AmountOld,
nodeOld = org == null || org.result == null ? null : org.result.node,
nodeIdOld = org == null || org.result == null ? null : org.result.nodeId,
posmasterIdOld = org == null || org.result == null ? null : org.result.posmasterId,
rootOld = org == null || org.result == null ? null : org.result.root,
rootIdOld = org == null || org.result == null ? null : org.result.rootId,
rootShortNameOld = org == null || org.result == null ? null : org.result.rootShortName,
child1Old = org == null || org.result == null ? null : org.result.child1,
child1IdOld = org == null || org.result == null ? null : org.result.child1Id,
child1ShortNameOld = org == null || org.result == null ? null : org.result.child1ShortName,
child2Old = org == null || org.result == null ? null : org.result.child2,
child2IdOld = org == null || org.result == null ? null : org.result.child2Id,
child2ShortNameOld = org == null || org.result == null ? null : org.result.child2ShortName,
child3Old = org == null || org.result == null ? null : org.result.child3,
child3IdOld = org == null || org.result == null ? null : org.result.child3Id,
child3ShortNameOld = org == null || org.result == null ? null : org.result.child3ShortName,
child4Old = org == null || org.result == null ? null : org.result.child4,
child4IdOld = org == null || org.result == null ? null : org.result.child4Id,
child4ShortNameOld = org == null || org.result == null ? null : org.result.child4ShortName,
orgRevisionIdOld = org == null || org.result == null ? null : org.result.orgRevisionId,
// positionIdOld = org == null || org.result == null ? null : org.result.positionIdOld,
posMasterNoOld = org == null || org.result == null ? null : org.result.posMasterNo,
positionNameOld = org == null || org.result == null ? null : org.result.position,
// positionFieldOld = org == null || org.result == null ? null : org.result.positionFieldOld,
posTypeIdOld = org == null || org.result == null ? null : org.result.posTypeId,
posTypeNameOld = org == null || org.result == null ? null : org.result.posTypeName,
posLevelIdOld = org == null || org.result == null ? null : org.result.posLevelId,
posLevelNameOld = org == null || org.result == null ? null : org.result.posLevelName,
AmountOld = org?.result?.AmountOld ?? null,
nodeOld = org?.result?.node ?? null,
nodeIdOld = org?.result?.nodeId ?? null,
posmasterIdOld = org?.result?.posmasterId ?? null,
rootOld = org?.result?.root ?? null,
rootIdOld = org?.result?.rootId ?? null,
rootShortNameOld = org?.result?.rootShortName ?? null,
child1Old = org?.result?.child1 ?? null,
child1IdOld = org?.result?.child1Id ?? null,
child1ShortNameOld = org?.result?.child1ShortName ?? null,
child2Old = org?.result?.child2 ?? null,
child2IdOld = org?.result?.child2Id ?? null,
child2ShortNameOld = org?.result?.child2ShortName ?? null,
child3Old = org?.result?.child3 ?? null,
child3IdOld = org?.result?.child3Id ?? null,
child3ShortNameOld = org?.result?.child3ShortName ?? null,
child4Old = org?.result?.child4 ?? null,
child4IdOld = org?.result?.child4Id ?? null,
child4ShortNameOld = org?.result?.child4ShortName ?? null,
orgRevisionIdOld = org?.result?.orgRevisionId ?? null,
posMasterNoOld = org?.result?.posMasterNo ?? null,
positionNameOld = org?.result?.position ?? null,
posTypeIdOld = org?.result?.posTypeId ?? null,
posTypeNameOld = org?.result?.posTypeName ?? null,
posLevelIdOld = org?.result?.posLevelId ?? null,
posLevelNameOld = org?.result?.posLevelName ?? null,
};
await _contextMetadata.PlacementProfiles.AddAsync(placementProfile);
@ -2258,7 +2188,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var placementEducation = new PlacementEducation
{
PlacementProfile = placementProfile,
EducationLevel = await _contextMetadata.EducationLevels.FirstOrDefaultAsync(x => x.Id == education.EducationLevelExamId),
EducationLevelId = education.EducationLevelExamId,
EducationLevelName = education.EducationLevelExamName,
Field = education.EducationMajor,
Gpa = education.EducationScores,
Institute = education.EducationLocation,
@ -2287,13 +2218,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
throw new Exception(GlobalMessages.ExamNotFound);
var _placement = await _contextMetadata.Placements.AsQueryable()
.FirstOrDefaultAsync(x => x.Name == periodExam.Name && x.Year == ((int)(periodExam.Year == null ? 0 : periodExam.Year)));
.FirstOrDefaultAsync(x => x.PlacementType.Name == "คัดเลือกคนพิการ" && x.RefId == periodExam.Id);
if (_placement != null)
throw new Exception("รอบการสอบนี้ได้ทำการบรรจุไปแล้ว");
var placement = new Placement
{
Name = periodExam.Name,
RefId = periodExam.Id,
Round = periodExam.Round == null ? "" : periodExam.Round.ToString(),
Year = (int)(periodExam.Year == null ? 0 : periodExam.Year),
Number = await _context.Disables.AsQueryable().Where(x => x.PeriodExam == periodExam).CountAsync(),
@ -2356,21 +2288,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
.FirstOrDefaultAsync(x => x.ExamId == candidate.ExamId && x.ScoreImport == scoreImport);
if (disableScore == null)
continue;
var profile = await _contextMetadata.Profiles
.Include(x => x.Salaries)
.FirstOrDefaultAsync(p => p.CitizenId == candidate.CitizenId);
var CitizenProvince = await _contextMetadata.Provinces.Where(x => x.Name == candidate.CitizenCardIssuer).FirstOrDefaultAsync();
var RegistProvince = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Provinces.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Province).FirstOrDefaultAsync();
var RegistDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Districts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().District).FirstOrDefaultAsync();
var RegistSubDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.SubDistricts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Amphur).FirstOrDefaultAsync();
var CurrentProvince = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Provinces.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Province1).FirstOrDefaultAsync();
var CurrentDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.Districts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().District1).FirstOrDefaultAsync();
var CurrentSubDistrict = candidate.Addresses.FirstOrDefault() == null ? null : await _contextMetadata.SubDistricts.Where(x => x.Name == candidate.Addresses.FirstOrDefault().Amphur1).FirstOrDefaultAsync();
var placementProfile = new PlacementProfile
{
Placement = placement,
PositionCandidate = await _contextMetadata.PositionPaths.FirstOrDefaultAsync(x => x.Name == candidate.PositionName),
positionName = candidate.PositionName,
PositionCandidate = candidate.PositionName,
PositionType = candidate.PositionType,
PositionLevel = candidate.PositionLevel,
Prefix = candidate.Prefix,
Firstname = candidate.FirstName,
Lastname = candidate.LastName,
@ -2380,48 +2303,27 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Religion = candidate.Religion,
DateOfBirth = candidate.DateOfBirth,
Relationship = candidate.Marry,
// Email = candidate.Email,
CitizenId = candidate.CitizenId,
// CitizenDistrict = await _contextMetadata.Districts.FirstOrDefaultAsync(x => x.Id == candidate.CitizenDistrictId),
CitizenProvinceId = CitizenProvince == null ? null : CitizenProvince.Id.ToString(),
CitizenProvinceId = _contextOrg.province.FirstOrDefault(x => x.name == candidate.CitizenCardIssuer)?.Id ?? null,
CitizenDate = candidate.CitizenCardExpireDate,
Telephone = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().Telephone,
MobilePhone = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().Mobile,
// Knowledge = candidate.Knowledge,
Telephone = candidate?.Addresses?.FirstOrDefault()?.Telephone ?? null,
MobilePhone = candidate?.Addresses?.FirstOrDefault()?.Mobile ?? null,
RegistAddress = $"{Address}{Moo}{Soi}{Road}",
RegistProvinceId = RegistProvince == null ? null : RegistProvince.Id.ToString(),
RegistDistrictId = RegistDistrict == null ? null : RegistDistrict.Id.ToString(),
RegistSubDistrictId = RegistSubDistrict == null ? null : RegistSubDistrict.Id.ToString(),
RegistZipCode = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().ZipCode,
RegistProvinceId = _contextOrg.province.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Province ?? ""))?.Id ?? null,
RegistDistrictId = _contextOrg.district.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.District ?? ""))?.Id ?? null,
RegistSubDistrictId = _contextOrg.subDistrict.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Soi ?? ""))?.Id ?? null,
RegistZipCode = candidate?.Addresses?.FirstOrDefault()?.ZipCode ?? null,
RegistSame = false,
CurrentAddress = $"{Address1}{Moo1}{Soi1}{Road1}",
CurrentProvinceId = CurrentProvince == null ? null : CurrentProvince.Id.ToString(),
CurrentDistrictId = CurrentDistrict == null ? null : CurrentDistrict.Id.ToString(),
CurrentSubDistrictId = CurrentSubDistrict == null ? null : CurrentSubDistrict.Id.ToString(),
CurrentZipCode = candidate.Addresses.FirstOrDefault() == null ? null : candidate.Addresses.FirstOrDefault().ZipCode1,
Marry = candidate.Marry.Contains("สมรส"),
// MarryPrefix = await _contextMetadata.Prefixes.FirstOrDefaultAsync(x => x.Id == candidate.MarryPrefixId),
// MarryFirstName = candidate.MarryFirstName,
// MarryLastName = candidate.MarryLastName,
// MarryOccupation = candidate.MarryOccupation,
// MarryNationality = candidate.MarryNationality,
// FatherPrefix = await _contextMetadata.Prefixes.FirstOrDefaultAsync(x => x.Id == candidate.FatherPrefixId),
// FatherFirstName = candidate.FatherFirstName,
// FatherLastName = candidate.FatherLastName,
// FatherOccupation = candidate.FatherOccupation,
// FatherNationality = candidate.FatherNationality,
// MotherPrefix = await _contextMetadata.Prefixes.FirstOrDefaultAsync(x => x.Id == candidate.MotherPrefixId),
// MotherFirstName = candidate.MotherFirstName,
// MotherLastName = candidate.MotherLastName,
// MotherOccupation = candidate.MotherOccupation,
// MotherNationality = candidate.MotherNationality,
CurrentProvinceId = _contextOrg.province.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Province1 ?? ""))?.Id ?? null,
CurrentDistrictId = _contextOrg.district.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.District1 ?? ""))?.Id ?? null,
CurrentSubDistrictId = _contextOrg.subDistrict.FirstOrDefault(x => x.name == (candidate!.Addresses!.FirstOrDefault()!.Soi1 ?? ""))?.Id ?? null,
CurrentZipCode = candidate?.Addresses?.FirstOrDefault()?.ZipCode1 ?? null,
Marry = candidate?.Marry?.Contains("สมรส") ?? false,
OccupationPositionType = "other",
// OccupationCompany = candidate.OccupationCompany,
// OccupationDepartment = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Workplace,
// OccupationEmail = candidate.OccupationEmail,
OccupationTelephone = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Telephone,
OccupationPosition = candidate.Occupations.FirstOrDefault() == null ? null : candidate.Occupations.FirstOrDefault().Position,
OccupationTelephone = candidate?.Occupations?.FirstOrDefault()?.Telephone ?? null,
OccupationPosition = candidate?.Occupations?.FirstOrDefault()?.Position ?? null,
PointTotalA = disableScore == null ? null : Convert.ToDouble(disableScore.FullA),
PointA = disableScore == null ? null : Convert.ToDouble(disableScore.SumA),
@ -2435,10 +2337,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
PlacementStatus = "UN-CONTAIN",
Pass = disableScore == null ? null : disableScore.ExamStatus,
RemarkHorizontal = "โดยมีเงื่อนไขว่าต้องปฏิบัติงานให้กรุงเทพมหานครเป็นระยะเวลาไม่น้อยกว่า ๕ ปี นับแต่วันที่ได้รับการบรรจุและแต่งตั้ง โดยห้ามโอนไปหน่วยงานหรือส่วนราชการอื่น เว้นเเต่ลาออกจากราชการ",
// ReportingDate = DateTime.Now,
Amount = org == null || org.result == null ? null : org.result.amount,
PositionSalaryAmount = org == null || org.result == null ? null : org.result.positionSalaryAmount,
MouthSalaryAmount = org == null || org.result == null ? null : org.result.mouthSalaryAmount,
Amount = org?.result?.amount ?? null,
PositionSalaryAmount = org?.result?.positionSalaryAmount ?? null,
MouthSalaryAmount = org?.result?.mouthSalaryAmount ?? null,
CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "",
@ -2446,56 +2347,48 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
LastUpdateUserId = UserId ?? "",
LastUpdateFullName = FullName ?? "",
IsOfficer = IsOfficer,
profileId = org == null || org.result == null ? null : org.result.profileId,
profileId = org?.result?.profileId ?? null,
IsOld = org == null || org.result == null ? false : true,
AmountOld = org == null || org.result == null ? null : org.result.AmountOld,
nodeOld = org == null || org.result == null ? null : org.result.node,
nodeIdOld = org == null || org.result == null ? null : org.result.nodeId,
posmasterIdOld = org == null || org.result == null ? null : org.result.posmasterId,
rootOld = org == null || org.result == null ? null : org.result.root,
rootIdOld = org == null || org.result == null ? null : org.result.rootId,
rootShortNameOld = org == null || org.result == null ? null : org.result.rootShortName,
child1Old = org == null || org.result == null ? null : org.result.child1,
child1IdOld = org == null || org.result == null ? null : org.result.child1Id,
child1ShortNameOld = org == null || org.result == null ? null : org.result.child1ShortName,
child2Old = org == null || org.result == null ? null : org.result.child2,
child2IdOld = org == null || org.result == null ? null : org.result.child2Id,
child2ShortNameOld = org == null || org.result == null ? null : org.result.child2ShortName,
child3Old = org == null || org.result == null ? null : org.result.child3,
child3IdOld = org == null || org.result == null ? null : org.result.child3Id,
child3ShortNameOld = org == null || org.result == null ? null : org.result.child3ShortName,
child4Old = org == null || org.result == null ? null : org.result.child4,
child4IdOld = org == null || org.result == null ? null : org.result.child4Id,
child4ShortNameOld = org == null || org.result == null ? null : org.result.child4ShortName,
orgRevisionIdOld = org == null || org.result == null ? null : org.result.orgRevisionId,
// positionIdOld = org == null || org.result == null ? null : org.result.positionIdOld,
posMasterNoOld = org == null || org.result == null ? null : org.result.posMasterNo,
positionNameOld = org == null || org.result == null ? null : org.result.position,
// positionFieldOld = org == null || org.result == null ? null : org.result.positionFieldOld,
posTypeIdOld = org == null || org.result == null ? null : org.result.posTypeId,
posTypeNameOld = org == null || org.result == null ? null : org.result.posTypeName,
posLevelIdOld = org == null || org.result == null ? null : org.result.posLevelId,
posLevelNameOld = org == null || org.result == null ? null : org.result.posLevelName,
AmountOld = org?.result?.AmountOld ?? null,
nodeOld = org?.result?.node ?? null,
nodeIdOld = org?.result?.nodeId ?? null,
posmasterIdOld = org?.result?.posmasterId ?? null,
rootOld = org?.result?.root ?? null,
rootIdOld = org?.result?.rootId ?? null,
rootShortNameOld = org?.result?.rootShortName ?? null,
child1Old = org?.result?.child1 ?? null,
child1IdOld = org?.result?.child1Id ?? null,
child1ShortNameOld = org?.result?.child1ShortName ?? null,
child2Old = org?.result?.child2 ?? null,
child2IdOld = org?.result?.child2Id ?? null,
child2ShortNameOld = org?.result?.child2ShortName ?? null,
child3Old = org?.result?.child3 ?? null,
child3IdOld = org?.result?.child3Id ?? null,
child3ShortNameOld = org?.result?.child3ShortName ?? null,
child4Old = org?.result?.child4 ?? null,
child4IdOld = org?.result?.child4Id ?? null,
child4ShortNameOld = org?.result?.child4ShortName ?? null,
orgRevisionIdOld = org?.result?.orgRevisionId ?? null,
posMasterNoOld = org?.result?.posMasterNo ?? null,
positionNameOld = org?.result?.position ?? null,
posTypeIdOld = org?.result?.posTypeId ?? null,
posTypeNameOld = org?.result?.posTypeName ?? null,
posLevelIdOld = org?.result?.posLevelId ?? null,
posLevelNameOld = org?.result?.posLevelName ?? null,
};
await _contextMetadata.PlacementProfiles.AddAsync(placementProfile);
var placementEducation = new PlacementEducation
{
PlacementProfile = placementProfile,
EducationLevel = await _contextMetadata.EducationLevels.FirstOrDefaultAsync(x => x.Name == (candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().HighDegree)),
Field = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().Major,
Gpa = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().GPA.ToString(),
Institute = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().University,
Degree = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().Degree,
// Country = education.Name,
// Duration = education.Name,
// Other = education.Name,
// FundName = education.Name,
// DurationYear = education.Name,
FinishDate = candidate.Educations.FirstOrDefault() == null ? null : candidate.Educations.FirstOrDefault().BachelorDate,
EducationLevelId = _contextOrg.educationLevel.FirstOrDefault(x => x.name == (candidate!.Educations!.FirstOrDefault()!.HighDegree ?? ""))?.Id ?? null,
EducationLevelName = _contextOrg.educationLevel.FirstOrDefault(x => x.name == (candidate!.Educations!.FirstOrDefault()!.HighDegree ?? ""))?.name ?? null,
Field = candidate?.Educations?.FirstOrDefault()?.Major ?? null,
Gpa = candidate?.Educations?.FirstOrDefault()?.GPA!.ToString() ?? null,
Institute = candidate?.Educations?.FirstOrDefault()?.University ?? null,
Degree = candidate?.Educations?.FirstOrDefault()?.Degree ?? null,
FinishDate = candidate?.Educations?.FirstOrDefault()?.BachelorDate ?? null,
IsDate = true,
// StartDate = education.DurationStart,
// EndDate = education.DurationEnd,
CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
@ -2508,11 +2401,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var placementCertificate = new PlacementCertificate
{
PlacementProfile = placementProfile,
CertificateNo = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().CertificateNo,
// Issuer = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().Issuer,
IssueDate = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().IssueDate,
ExpireDate = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().ExpiredDate,
CertificateType = candidate.Certificates.FirstOrDefault() == null ? null : candidate.Certificates.FirstOrDefault().Description,
CertificateNo = candidate?.Certificates?.FirstOrDefault()?.CertificateNo ?? null,
IssueDate = candidate?.Certificates?.FirstOrDefault()?.IssueDate ?? null,
ExpireDate = candidate?.Certificates?.FirstOrDefault()?.ExpiredDate ?? null,
CertificateType = candidate?.Certificates?.FirstOrDefault()?.Description ?? null,
CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,

View file

@ -13,16 +13,17 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;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_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "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;",
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
},
"Jwt": {
"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
},
"EPPlus": {
"ExcelPackage": {
@ -30,10 +31,10 @@
}
},
"MinIO": {
"Endpoint": "https://hrms-s3.chin.in.th/",
"AccessKey": "QtXsmeR4mBqOO5RFisKo",
"SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA",
"BucketName": "hrms-fpt"
"Endpoint": "http://127.0.0.1:9000",
"AccessKey": "ZQOGEjHxDesiVIHR",
"SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6",
"BucketName": "bma-recruit"
},
"Protocol": "HTTPS",
"KeycloakCron": {
@ -75,8 +76,8 @@
}
]
},
"APIPROBATION": "https://hrms.chin.in.th/api/v1/probation",
"API": "https://hrms.chin.in.th/api/v1",
"APIV2": "https://hrms.chin.in.th/api/v2",
"APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation",
"API": "https://bma-ehr.frappet.synology.me/api/v1",
"APIV2": "https://bma-ehr.frappet.synology.me/api/v2",
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
}

View file

@ -13,16 +13,17 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;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_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "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;",
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
},
"Jwt": {
"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
},
"EPPlus": {
"ExcelPackage": {
@ -30,10 +31,10 @@
}
},
"MinIO": {
"Endpoint": "https://hrms-s3.chin.in.th/",
"AccessKey": "QtXsmeR4mBqOO5RFisKo",
"SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA",
"BucketName": "hrms-fpt"
"Endpoint": "http://127.0.0.1:9000",
"AccessKey": "ZQOGEjHxDesiVIHR",
"SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6",
"BucketName": "bma-recruit"
},
"Protocol": "HTTPS",
"KeycloakCron": {
@ -75,8 +76,8 @@
}
]
},
"APIPROBATION": "https://hrms.chin.in.th/api/v1/probation",
"API": "https://hrms.chin.in.th/api/v1",
"APIV2": "https://hrms.chin.in.th/api/v2",
"APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation",
"API": "https://bma-ehr.frappet.synology.me/api/v1",
"APIV2": "https://bma-ehr.frappet.synology.me/api/v2",
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
}

View file

@ -13,16 +13,17 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;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_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "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;",
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
},
"Jwt": {
"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
},
"EPPlus": {
"ExcelPackage": {
@ -30,10 +31,10 @@
}
},
"MinIO": {
"Endpoint": "https://hrms-s3.chin.in.th/",
"AccessKey": "QtXsmeR4mBqOO5RFisKo",
"SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA",
"BucketName": "hrms-fpt"
"Endpoint": "http://127.0.0.1:9000",
"AccessKey": "ZQOGEjHxDesiVIHR",
"SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6",
"BucketName": "bma-recruit"
},
"Protocol": "HTTPS",
"KeycloakCron": {
@ -75,8 +76,8 @@
}
]
},
"APIPROBATION": "https://hrms.chin.in.th/api/v1/probation",
"API": "https://hrms.chin.in.th/api/v1",
"APIV2": "https://hrms.chin.in.th/api/v2",
"APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation",
"API": "https://bma-ehr.frappet.synology.me/api/v1",
"APIV2": "https://bma-ehr.frappet.synology.me/api/v2",
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
}

View file

@ -13,16 +13,17 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"LeaveConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_leave;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_discipline;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=hrms.chin.in.th;user=root;password=ey2qVVyyqGYw8CyA7h8X72559r2Ad84K;port=53636;database=hrms_history;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_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"ExamConnection": "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;",
"LeaveConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_leave_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"DisciplineConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_discipline_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"RecruitConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_recruit_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"OrgConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_organization_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;",
"HistoryConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database==bma_ehr_history_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
},
"Jwt": {
"Key": "j7C9RO_p4nRtuwCH4z9Db_A_6We42tkD_p4lZtDrezc",
"Issuer": "https://hrms-id.chin.in.th/realms/hrms"
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
"Issuer": "https://id.frappet.synology.me/realms/bma-ehr"
},
"EPPlus": {
"ExcelPackage": {
@ -30,10 +31,10 @@
}
},
"MinIO": {
"Endpoint": "https://hrms-s3.chin.in.th/",
"AccessKey": "QtXsmeR4mBqOO5RFisKo",
"SecretKey": "Fdu7UDCr9Js7iP9SFMT44GjcldD3Ud0SU32PvCOA",
"BucketName": "hrms-fpt"
"Endpoint": "http://127.0.0.1:9000",
"AccessKey": "ZQOGEjHxDesiVIHR",
"SecretKey": "vKTpcxY0Wjjp775aDwNn1q6VWJu8EFb6",
"BucketName": "bma-recruit"
},
"Protocol": "HTTPS",
"KeycloakCron": {
@ -75,8 +76,8 @@
}
]
},
"APIPROBATION": "https://hrms.chin.in.th/api/v1/probation",
"API": "https://hrms.chin.in.th/api/v1",
"APIV2": "https://hrms.chin.in.th/api/v2",
"APIPROBATION": "https://bma-ehr.frappet.synology.me/api/v1/probation",
"API": "https://bma-ehr.frappet.synology.me/api/v1",
"APIV2": "https://bma-ehr.frappet.synology.me/api/v2",
"API_KEY": "fKRL16yyEgbyTEJdsMw2h64tGSCmkW685PRtM3CygzX1JOSdptT9UJtpgWwKM8FybRTJups3GTFwj27ZRvlPdIkv3XgCoVJaD5LmR06ozuEPvCCRSdp2WFthg08V5xHc56fTPfZLpr1VmXrhd6dvYhHIqKkQUJR02Rlkss11cLRWEQOssEFVA4xdu2J5DIRO1EM5m7wRRvEwcDB4mYRXD9HH52SMq6iYqUWEWsMwLdbk7QW9yYESUEuzMW5gWrb6vIeWZxJV5bTz1PcWUyR7eO9Fyw1F5DiQYc9JgzTC1mW7cv31fEtTtrfbJYKIb5EbWilqIEUKC6A0UKBDDek35ML0006cqRVm0pvdOH6jeq7VQyYrhdXe59dBEyhYGUIfozoVBvW7Up4QBuOMjyPjSqJPlMBKwaseptfrblxQV1AOOivSBpf1ZcQyOZ8JktRtKUDSuXsmG0lsXwFlI3JCeSHdpVdgZWFYcJPegqfrB6KotR02t9AVkpLs1ZWrixwz"
}