From b817b781d278adf1063a9b9cc108908b82d6d363 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Wed, 10 May 2023 20:11:47 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A2=E0=B9=89=E0=B8=B2=E0=B8=A2=E0=B8=A1?= =?UTF-8?q?=E0=B8=B2=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=9C=E0=B9=88=E0=B8=B2=E0=B8=99?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMA.EHR.Report.Service.csproj | 19 +- Controllers/ExamReportController.cs | 254 ++++++++ Controllers/OrganizationReportController.cs | 11 + Controllers/ProfileReportController.cs | 552 ++++++++++++++++++ Core/GlobalMessages.cs | 11 + Data/ApplicationDbContext.cs | 9 +- Data/EHRDbContext.cs | 225 +++++++ Data/ExamDbContext.cs | 79 +++ Models/AvailablePositionLevelEntity.cs | 25 + Models/Exam/BankExam.cs | 20 + Models/Exam/CMSAgency.cs | 17 + Models/Exam/CMSCandidate.cs | 64 ++ Models/Exam/CMSGovernment.cs | 17 + Models/Exam/Candidate.cs | 256 ++++++++ Models/Exam/CandidateDocument.cs | 16 + Models/Exam/Career.cs | 30 + Models/Exam/Disable/Disable.cs | 82 +++ Models/Exam/Disable/DisableAddress.cs | 63 ++ Models/Exam/Disable/DisableCertificate.cs | 19 + Models/Exam/Disable/DisableDocument.cs | 13 + Models/Exam/Disable/DisableEducation.cs | 33 ++ Models/Exam/Disable/DisableImportHistory.cs | 14 + Models/Exam/Disable/DisableOccupation.cs | 24 + Models/Exam/Disable/DisablePayment.cs | 56 ++ Models/Exam/Disable/DisableScore.cs | 54 ++ Models/Exam/Disable/ScoreImport.cs | 19 + Models/Exam/District.cs | 19 + Models/Exam/Education.cs | 33 ++ Models/Exam/EducationLevel.cs | 15 + Models/Exam/EntityBase.cs | 32 + Models/Exam/OrganizationOrganization.cs | 15 + Models/Exam/OrganizationShortName.cs | 19 + Models/Exam/PeriodExam.cs | 105 ++++ Models/Exam/PeriodExamDocument.cs | 14 + Models/Exam/PeriodExamImage.cs | 14 + Models/Exam/PositionExam.cs | 23 + Models/Exam/Prefix.cs | 15 + Models/Exam/Province.cs | 17 + Models/Exam/Relationship.cs | 14 + Models/Exam/Religion.cs | 15 + Models/Exam/SubDistrict.cs | 20 + Models/HR/Profile.cs | 264 +++++++++ Models/HR/ProfileAbility.cs | 44 ++ Models/HR/ProfileAbilityHistory.cs | 43 ++ Models/HR/ProfileAddressHistory.cs | 33 ++ Models/HR/ProfileAssessment.cs | 15 + Models/HR/ProfileAssessmentHistory.cs | 14 + Models/HR/ProfileAvatarHistory.cs | 18 + Models/HR/ProfileCertificate.cs | 28 + Models/HR/ProfileCertificateHistory.cs | 23 + Models/HR/ProfileChildren.cs | 16 + Models/HR/ProfileChildrenHistory.cs | 14 + Models/HR/ProfileCoupleHistory.cs | 30 + Models/HR/ProfileCurrentAddressHistory.cs | 33 ++ Models/HR/ProfileDiscipline.cs | 28 + Models/HR/ProfileDisciplineHistory.cs | 23 + Models/HR/ProfileDuty.cs | 16 + Models/HR/ProfileDutyHistory.cs | 15 + Models/HR/ProfileEducation.cs | 44 ++ Models/HR/ProfileEducationHistory.cs | 32 + Models/HR/ProfileFamilyHistory.cs | 32 + Models/HR/ProfileFatherHistory.cs | 30 + Models/HR/ProfileGovernmentHistory.cs | 37 ++ Models/HR/ProfileHistory.cs | 42 ++ Models/HR/ProfileHonor.cs | 28 + Models/HR/ProfileHonorHistory.cs | 21 + Models/HR/ProfileInsignia.cs | 50 ++ Models/HR/ProfileInsigniaHistory.cs | 40 ++ Models/HR/ProfileLeave.cs | 58 ++ Models/HR/ProfileLeaveHistory.cs | 53 ++ Models/HR/ProfileMotherHistory.cs | 30 + Models/HR/ProfileNopaid.cs | 26 + Models/HR/ProfileNopaidHistory.cs | 14 + Models/HR/ProfileOther.cs | 15 + Models/HR/ProfileOtherHistory.cs | 14 + Models/HR/ProfilePaper.cs | 18 + .../HR/ProfileRegistrationAddressHistory.cs | 33 ++ Models/HR/ProfileSalary.cs | 25 + Models/HR/ProfileSalaryHistory.cs | 34 ++ Models/HR/ProfileSalaryOrganization.cs | 19 + Models/HR/ProfileSalaryPosition.cs | 19 + Models/HR/ProfileSalaryPositionLevel.cs | 20 + Models/HR/ProfileSalaryPositionNumber.cs | 19 + Models/HR/ProfileSalaryPositionType.cs | 22 + Models/HR/ProfileTraining.cs | 34 ++ Models/HR/ProfileTrainingHistory.cs | 33 ++ Models/MetaData/BloodGroup.cs | 15 + Models/MetaData/District.cs | 20 + Models/MetaData/EducationLevel.cs | 15 + Models/MetaData/EntityBase.cs | 32 + Models/MetaData/Gendor.cs | 15 + Models/MetaData/Holiday.cs | 27 + Models/MetaData/Insignia.cs | 23 + Models/MetaData/InsigniaType.cs | 16 + Models/MetaData/OrganizationAgency.cs | 15 + Models/MetaData/OrganizationFax.cs | 15 + .../MetaData/OrganizationGovernmentAgency.cs | 15 + Models/MetaData/OrganizationLevel.cs | 15 + Models/MetaData/OrganizationOrganization.cs | 15 + Models/MetaData/OrganizationShortName.cs | 19 + Models/MetaData/OrganizationStatus.cs | 15 + Models/MetaData/OrganizationTelExternal.cs | 15 + Models/MetaData/OrganizationTelInternal.cs | 15 + Models/MetaData/OrganizationType.cs | 15 + Models/MetaData/PhysicalStatus.cs | 16 + Models/MetaData/Position.cs | 36 ++ Models/MetaData/PositionEmployeeGroup.cs | 15 + Models/MetaData/PositionEmployeeLevel.cs | 15 + Models/MetaData/PositionEmployeeLine.cs | 15 + Models/MetaData/PositionEmployeePosition.cs | 15 + .../MetaData/PositionEmployeePositionSide.cs | 15 + Models/MetaData/PositionEmployeeStatus.cs | 15 + Models/MetaData/PositionExecutive.cs | 15 + Models/MetaData/PositionExecutiveSide.cs | 16 + Models/MetaData/PositionLevel.cs | 18 + Models/MetaData/PositionLine.cs | 15 + Models/MetaData/PositionPath.cs | 15 + Models/MetaData/PositionPathSide.cs | 16 + Models/MetaData/PositionStatus.cs | 15 + Models/MetaData/PositionType.cs | 15 + Models/MetaData/Prefix.cs | 15 + Models/MetaData/Province.cs | 17 + Models/MetaData/Relationship.cs | 14 + Models/MetaData/Religion.cs | 16 + Models/MetaData/Royal.cs | 18 + Models/MetaData/RoyalHierarchy.cs | 15 + Models/MetaData/RoyalType.cs | 15 + Models/MetaData/SubDistrict.cs | 21 + Models/OrganizationEntity.cs | 73 +++ Models/OrganizationPositionEntity.cs | 31 + Models/PositionMasterEntity.cs | 72 +++ Models/PositionNumberEntity.cs | 20 + Models/ProfilePosition.cs | 19 + Program.cs | 128 ++-- Report/Organization/rptAccount1.trdp | Bin 0 -> 2238 bytes Report/Profile/rptKK1Summary.trbp | Bin 0 -> 600 bytes Report/Profile/rptKK1_Page1.trdp | Bin 0 -> 9194 bytes Report/Profile/rptKK1_Page2.trdp | Bin 0 -> 2192 bytes Report/Profile/rptShortKp7.trdp | Bin 0 -> 7201 bytes Responses/Document/FileDownloadResponse.cs | 11 + Services/MinIOService.cs | 222 +++++++ Services/ProfileService.cs | 485 +++++++++++++++ appsettings.Development.json | 4 +- appsettings.json | 5 +- 144 files changed, 5573 insertions(+), 63 deletions(-) create mode 100644 Controllers/ExamReportController.cs create mode 100644 Controllers/OrganizationReportController.cs create mode 100644 Controllers/ProfileReportController.cs create mode 100644 Core/GlobalMessages.cs create mode 100644 Data/EHRDbContext.cs create mode 100644 Data/ExamDbContext.cs create mode 100644 Models/AvailablePositionLevelEntity.cs create mode 100644 Models/Exam/BankExam.cs create mode 100644 Models/Exam/CMSAgency.cs create mode 100644 Models/Exam/CMSCandidate.cs create mode 100644 Models/Exam/CMSGovernment.cs create mode 100644 Models/Exam/Candidate.cs create mode 100644 Models/Exam/CandidateDocument.cs create mode 100644 Models/Exam/Career.cs create mode 100644 Models/Exam/Disable/Disable.cs create mode 100644 Models/Exam/Disable/DisableAddress.cs create mode 100644 Models/Exam/Disable/DisableCertificate.cs create mode 100644 Models/Exam/Disable/DisableDocument.cs create mode 100644 Models/Exam/Disable/DisableEducation.cs create mode 100644 Models/Exam/Disable/DisableImportHistory.cs create mode 100644 Models/Exam/Disable/DisableOccupation.cs create mode 100644 Models/Exam/Disable/DisablePayment.cs create mode 100644 Models/Exam/Disable/DisableScore.cs create mode 100644 Models/Exam/Disable/ScoreImport.cs create mode 100644 Models/Exam/District.cs create mode 100644 Models/Exam/Education.cs create mode 100644 Models/Exam/EducationLevel.cs create mode 100644 Models/Exam/EntityBase.cs create mode 100644 Models/Exam/OrganizationOrganization.cs create mode 100644 Models/Exam/OrganizationShortName.cs create mode 100644 Models/Exam/PeriodExam.cs create mode 100644 Models/Exam/PeriodExamDocument.cs create mode 100644 Models/Exam/PeriodExamImage.cs create mode 100644 Models/Exam/PositionExam.cs create mode 100644 Models/Exam/Prefix.cs create mode 100644 Models/Exam/Province.cs create mode 100644 Models/Exam/Relationship.cs create mode 100644 Models/Exam/Religion.cs create mode 100644 Models/Exam/SubDistrict.cs create mode 100644 Models/HR/Profile.cs create mode 100644 Models/HR/ProfileAbility.cs create mode 100644 Models/HR/ProfileAbilityHistory.cs create mode 100644 Models/HR/ProfileAddressHistory.cs create mode 100644 Models/HR/ProfileAssessment.cs create mode 100644 Models/HR/ProfileAssessmentHistory.cs create mode 100644 Models/HR/ProfileAvatarHistory.cs create mode 100644 Models/HR/ProfileCertificate.cs create mode 100644 Models/HR/ProfileCertificateHistory.cs create mode 100644 Models/HR/ProfileChildren.cs create mode 100644 Models/HR/ProfileChildrenHistory.cs create mode 100644 Models/HR/ProfileCoupleHistory.cs create mode 100644 Models/HR/ProfileCurrentAddressHistory.cs create mode 100644 Models/HR/ProfileDiscipline.cs create mode 100644 Models/HR/ProfileDisciplineHistory.cs create mode 100644 Models/HR/ProfileDuty.cs create mode 100644 Models/HR/ProfileDutyHistory.cs create mode 100644 Models/HR/ProfileEducation.cs create mode 100644 Models/HR/ProfileEducationHistory.cs create mode 100644 Models/HR/ProfileFamilyHistory.cs create mode 100644 Models/HR/ProfileFatherHistory.cs create mode 100644 Models/HR/ProfileGovernmentHistory.cs create mode 100644 Models/HR/ProfileHistory.cs create mode 100644 Models/HR/ProfileHonor.cs create mode 100644 Models/HR/ProfileHonorHistory.cs create mode 100644 Models/HR/ProfileInsignia.cs create mode 100644 Models/HR/ProfileInsigniaHistory.cs create mode 100644 Models/HR/ProfileLeave.cs create mode 100644 Models/HR/ProfileLeaveHistory.cs create mode 100644 Models/HR/ProfileMotherHistory.cs create mode 100644 Models/HR/ProfileNopaid.cs create mode 100644 Models/HR/ProfileNopaidHistory.cs create mode 100644 Models/HR/ProfileOther.cs create mode 100644 Models/HR/ProfileOtherHistory.cs create mode 100644 Models/HR/ProfilePaper.cs create mode 100644 Models/HR/ProfileRegistrationAddressHistory.cs create mode 100644 Models/HR/ProfileSalary.cs create mode 100644 Models/HR/ProfileSalaryHistory.cs create mode 100644 Models/HR/ProfileSalaryOrganization.cs create mode 100644 Models/HR/ProfileSalaryPosition.cs create mode 100644 Models/HR/ProfileSalaryPositionLevel.cs create mode 100644 Models/HR/ProfileSalaryPositionNumber.cs create mode 100644 Models/HR/ProfileSalaryPositionType.cs create mode 100644 Models/HR/ProfileTraining.cs create mode 100644 Models/HR/ProfileTrainingHistory.cs create mode 100644 Models/MetaData/BloodGroup.cs create mode 100644 Models/MetaData/District.cs create mode 100644 Models/MetaData/EducationLevel.cs create mode 100644 Models/MetaData/EntityBase.cs create mode 100644 Models/MetaData/Gendor.cs create mode 100644 Models/MetaData/Holiday.cs create mode 100644 Models/MetaData/Insignia.cs create mode 100644 Models/MetaData/InsigniaType.cs create mode 100644 Models/MetaData/OrganizationAgency.cs create mode 100644 Models/MetaData/OrganizationFax.cs create mode 100644 Models/MetaData/OrganizationGovernmentAgency.cs create mode 100644 Models/MetaData/OrganizationLevel.cs create mode 100644 Models/MetaData/OrganizationOrganization.cs create mode 100644 Models/MetaData/OrganizationShortName.cs create mode 100644 Models/MetaData/OrganizationStatus.cs create mode 100644 Models/MetaData/OrganizationTelExternal.cs create mode 100644 Models/MetaData/OrganizationTelInternal.cs create mode 100644 Models/MetaData/OrganizationType.cs create mode 100644 Models/MetaData/PhysicalStatus.cs create mode 100644 Models/MetaData/Position.cs create mode 100644 Models/MetaData/PositionEmployeeGroup.cs create mode 100644 Models/MetaData/PositionEmployeeLevel.cs create mode 100644 Models/MetaData/PositionEmployeeLine.cs create mode 100644 Models/MetaData/PositionEmployeePosition.cs create mode 100644 Models/MetaData/PositionEmployeePositionSide.cs create mode 100644 Models/MetaData/PositionEmployeeStatus.cs create mode 100644 Models/MetaData/PositionExecutive.cs create mode 100644 Models/MetaData/PositionExecutiveSide.cs create mode 100644 Models/MetaData/PositionLevel.cs create mode 100644 Models/MetaData/PositionLine.cs create mode 100644 Models/MetaData/PositionPath.cs create mode 100644 Models/MetaData/PositionPathSide.cs create mode 100644 Models/MetaData/PositionStatus.cs create mode 100644 Models/MetaData/PositionType.cs create mode 100644 Models/MetaData/Prefix.cs create mode 100644 Models/MetaData/Province.cs create mode 100644 Models/MetaData/Relationship.cs create mode 100644 Models/MetaData/Religion.cs create mode 100644 Models/MetaData/Royal.cs create mode 100644 Models/MetaData/RoyalHierarchy.cs create mode 100644 Models/MetaData/RoyalType.cs create mode 100644 Models/MetaData/SubDistrict.cs create mode 100644 Models/OrganizationEntity.cs create mode 100644 Models/OrganizationPositionEntity.cs create mode 100644 Models/PositionMasterEntity.cs create mode 100644 Models/PositionNumberEntity.cs create mode 100644 Models/ProfilePosition.cs create mode 100644 Report/Organization/rptAccount1.trdp create mode 100644 Report/Profile/rptKK1Summary.trbp create mode 100644 Report/Profile/rptKK1_Page1.trdp create mode 100644 Report/Profile/rptKK1_Page2.trdp create mode 100644 Report/Profile/rptShortKp7.trdp create mode 100644 Responses/Document/FileDownloadResponse.cs create mode 100644 Services/MinIOService.cs create mode 100644 Services/ProfileService.cs diff --git a/BMA.EHR.Report.Service.csproj b/BMA.EHR.Report.Service.csproj index d5863cc..fa7c82e 100644 --- a/BMA.EHR.Report.Service.csproj +++ b/BMA.EHR.Report.Service.csproj @@ -26,14 +26,15 @@ + + - @@ -56,11 +57,27 @@ + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/Controllers/ExamReportController.cs b/Controllers/ExamReportController.cs new file mode 100644 index 0000000..31bb248 --- /dev/null +++ b/Controllers/ExamReportController.cs @@ -0,0 +1,254 @@ +using BMA.EHR.Profile.Service.Controllers; +using BMA.EHR.Report.Service.Data; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Swashbuckle.AspNetCore.Annotations; +using Telerik.Reporting.Processing; +using Telerik.Reporting; +using BMA.EHR.Report.Service.Responses; +using BMA.EHR.Extensions; + +namespace BMA.EHR.Report.Service.Controllers +{ + [Route("api/v{version:apiVersion}/report/exam")] + [ApiVersion("1.0")] + [ApiController] + [Produces("application/json")] + [Authorize] + [SwaggerTag("รายงานข้อมูลการสอบคัดเลือก")] + public class ExamReportController : BaseController + { + #region " Fields " + + private readonly ExamDbContext _context; + private readonly IWebHostEnvironment _hostingEnvironment; + private readonly IConfiguration _configuration; + private readonly string space = "ㅤ"; + + #endregion + + #region " Constructor and Destructor " + + public ExamReportController(ExamDbContext context, + IWebHostEnvironment hostingEnvironment, + IConfiguration configuration) + { + this._context = context; + this._hostingEnvironment = hostingEnvironment; + this._configuration = configuration; + } + + #endregion + + #region " Methods " + + #region " Privates " + + private int GetExamCountTes(string citizenId) + { + try + { + var count = _context.Candidates.AsQueryable() + .Where(x => x.CitizenId == citizenId) + .Count(); + + return count; + } + catch + { + throw; + } + } + + #endregion + + /// + /// แสดงหนังสือรับรอง + /// + /// รหัสรอบการสอบ + /// เลขประจำตัวผู้สมัครสอบ + /// ชนิดของรายงาน + /// + /// เมื่อแสดงรายงานสำเร็จ + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + + [HttpGet("certificate/{type:int}/{id:length(36)}/{examId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> GetCertificateReportAsync(Guid id, string examId, int type) + { + try + { + var data = await _context.Disables.AsQueryable() + .Include(x => x.PeriodExam) + .Where(x => x.PeriodExam.Id == id) + .Where(x => x.ExamId == examId) + .Join(_context.DisableScores.AsQueryable() + .Include(x => x.ScoreImport), + rc => new { rc.PeriodExam.Year, rc.ExamId }, + sc => new { sc.ScoreImport.Year, sc.ExamId }, + (p, sr) => new + { + ExamID = p.ExamId, + p.CitizenId, + Order = p.PeriodExam.Round, + Year = p.PeriodExam.Year.Value.ToThaiYear(), + FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", + ExamResult = sr == null ? "" : sr.ExamStatus, + EndDate = p.PeriodExam.RegisterEndDate.ToThaiFullDate3(), + AuthName = "นายณัฐพงศ์ ดิษยบุตร", + AuthPosition = "หัวหน้าสำนักงาน ก.ก." + }) + .FirstOrDefaultAsync(); + + var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", $"rptCertificate{type}.trdp"); + + ReportPackager reportPackager = new ReportPackager(); + Telerik.Reporting.Report? report = null; + using (var sourceStream = System.IO.File.OpenRead(rptFile)) + { + report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream); + } + + report.DataSource = data; + System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); + + InstanceReportSource instanceReportSource = new InstanceReportSource() + { + ReportDocument = report + }; + + + ReportProcessor reportProcessor = new ReportProcessor(_configuration); + RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo); + + var content = result.DocumentBytes; + return File(content, "application/pdf", $"หนังสือรับรอง_{data.CitizenId}_{data.FullName}.pdf"); + + } + catch (Exception ex) + { + return Error(ex, "เกิดข้อผิดพลาดในการแสดงรายงาน"); + } + } + + /// + /// แสดงเอกสารผลสอบ + /// + /// รหัสรอบการสอบ + /// เลขประจำตัวผู้สมัครสอบ + /// + /// เมื่อแสดงรายงานสำเร็จ + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpGet("score/{id:length(36)}/{examId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> GetScoreReportAsync(Guid id, string examId) + { + try + { + var data = await _context.Disables.AsQueryable() + .Include(x => x.PeriodExam) + .Include(x => x.Documents) + .ThenInclude(x => x.DocumentFile) + .Where(x => x.PeriodExam.Id == id) + .Where(x => x.ExamId == examId) + .Join(_context.DisableScores.AsQueryable() + .Include(x => x.ScoreImport), + rc => new { rc.PeriodExam.Year, rc.ExamId }, + sc => new { sc.ScoreImport.Year, sc.ExamId }, + (p, sr) => new + { + ExamId = p.ExamId, + CitizenId = p.CitizenId, + p.Prefix, + FullName = $"{p.Prefix}{p.FirstName} {p.LastName}", + DateOfBirth = p.DateOfBirth.ToThaiShortDate(), + Gender = p.Gendor, + Degree = p.Educations.First().Degree, + Major = p.Educations.First().Major, + ExamResult = sr == null ? "" : sr.ExamStatus, + University = p.Educations.First().University, + PositionName = p.PositionName, + ExamName = $"{p.PeriodExam.Name} ครั้งที่ {p.PeriodExam.Round}/{p.PeriodExam.Year.Value.ToThaiYear()}", + Number = sr == null ? "" : sr.Number, + // ExamCount = 10, + // ExamCount = GetExamCountTes(p.CitizenId), + ScoreExpire = p.PeriodExam.AnnouncementDate == null ? "" : p.PeriodExam.AnnouncementDate.AddYears(2).ToThaiShortDate(), + FullA = sr == null ? 0 : sr.FullA, + SumA = sr == null ? 0 : sr.SumA, + FullB = sr == null ? 0 : sr.FullB, + SumB = sr == null ? 0 : sr.SumB, + FullC = sr == null ? 0 : sr.FullC, + SumC = sr == null ? 0 : sr.SumC, + }) + .FirstOrDefaultAsync(); + var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Recruit", $"rptExamResult.trdp"); + ReportPackager reportPackager = new ReportPackager(); + Telerik.Reporting.Report? report = null; + using (var sourceStream = System.IO.File.OpenRead(rptFile)) + { + report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream); + } + + report.DataSource = data; + if (data != null) + { + var _data = new + { + ExamId = data.ExamId, + CitizenId = data.CitizenId, + Prefix = data.Prefix, + FullName = data.FullName, + DateOfBirth = data.DateOfBirth, + Gender = data.Gender, + Degree = data.Degree, + Major = data.Major, + ExamResult = data.ExamResult, + University = data.University, + PositionName = data.PositionName, + ExamName = data.ExamName, + Number = data.Number, + ExamCount = GetExamCountTes(data.CitizenId), + ScoreExpire = data.ScoreExpire, + FullA = data.FullA, + SumA = data.SumA, + FullB = data.FullB, + SumB = data.SumB, + FullC = data.FullC, + SumC = data.SumC, + }; + report.DataSource = _data; + } + System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); + + InstanceReportSource instanceReportSource = new InstanceReportSource() + { + ReportDocument = report + }; + + + ReportProcessor reportProcessor = new ReportProcessor(_configuration); + RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo); + + var content = result.DocumentBytes; + return File(content, "application/pdf", $"ผลคะแนนสอบ_{data.CitizenId}_{data.FullName}.pdf"); + } + catch (Exception ex) + { + return Error(ex, "เกิดข้อผิดพลาดในการแสดงรายงาน"); + } + } + + #endregion + } +} diff --git a/Controllers/OrganizationReportController.cs b/Controllers/OrganizationReportController.cs new file mode 100644 index 0000000..895eab2 --- /dev/null +++ b/Controllers/OrganizationReportController.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace BMA.EHR.Report.Service.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class OrganizationReportController : ControllerBase + { + } +} diff --git a/Controllers/ProfileReportController.cs b/Controllers/ProfileReportController.cs new file mode 100644 index 0000000..3ba7629 --- /dev/null +++ b/Controllers/ProfileReportController.cs @@ -0,0 +1,552 @@ +using BMA.EHR.Extensions; +using BMA.EHR.Profile.Service.Controllers; +using BMA.EHR.Report.Service.Data; +using BMA.EHR.Report.Service.Responses; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Swashbuckle.AspNetCore.Annotations; +using System.Runtime.Versioning; +using System.Linq; +using BMA.EHR.Profile.Service.Services; +using Telerik.Reporting.Processing; +using Telerik.Reporting; +using System.Security.Cryptography.Pkcs; +using static System.Runtime.InteropServices.JavaScript.JSType; +using BMA.EHR.Recruit.Service.Services; +using System.Drawing; +using iText.Kernel.Pdf; +using Microsoft.CodeAnalysis; +using Telerik.Reporting.Drawing; +using GreatFriends.ThaiBahtText; +using BMA.EHR.Core; + +namespace BMA.EHR.Report.Service.Controllers +{ + [Route("api/v{version:apiVersion}/report/profile")] + [ApiVersion("1.0")] + [ApiController] + [Produces("application/json")] + //[Authorize] + [SwaggerTag("รายงานระบบทะเบียนประวัติ")] + public class ProfileReportController : BaseController + { + #region " Fields " + + private readonly EHRDbContext _context; + private readonly IWebHostEnvironment _hostingEnvironment; + private readonly IConfiguration _configuration; + private readonly string space = "ㅤ"; + private readonly ProfileService _profileService; + private readonly MinIOService _minioService; + + + #endregion + + #region " Constructor and Destructor " + + public ProfileReportController(EHRDbContext context, + IWebHostEnvironment hostingEnvironment, + IConfiguration configuration, + ProfileService profileService, + MinIOService minioService) + { + this._context = context; + this._hostingEnvironment = hostingEnvironment; + this._configuration = configuration; + this._profileService = profileService; + this._minioService = minioService; + } + + #endregion + + #region " Methods " + + /// + /// แสดงหนังสือรับรอง + /// + /// รหัสข้อมูลข้าราชการ + /// + /// เมื่อแสดงรายงานสำเร็จ + /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + + [HttpGet("kp7-short/{id:length(36)}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> GetKp7ShortReport(Guid id) + { + try + { + var profile_salaries = (from ps in _context.ProfileSalaries.ToList() + join pos in _context.PositionPaths.ToList() + on ps.PositionId equals pos.Id + where ps.Profile.Id == id + select new + { + ProfileId = ps.Profile.Id, + PositionName = pos.Name, + ps.OcId, + SalaryDateAnnounce = ps.Date, + ps.Amount, + ps.PositionSalaryAmount + }).ToList(); + + var profile = (from p in _context.Profiles.ToList() + join pf in _context.Prefixes.ToList() on p.PrefixId equals pf.Id + + where p.Id == id + select new + { + CitizenId = p.CitizenId, + Prefix = pf.Name, + p.FirstName, + p.LastName, + DateOfBirth = p.BirthDate.ToThaiShortDate(), + RegistrationAddress = "-", + OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false), + DateAppoint = p.DateAppoint == null ? "" : p.DateAppoint.Value.ToThaiShortDate(), + Salaries = profile_salaries, + SalaryAmount = p.Salaries.Count == 0 ? "-" + : $"{p.Salaries.OrderByDescending(s => s.Date.Value).FirstOrDefault().Amount.Value.ToString("#,##0")}", + Education = p.Educations.Count == 0 ? "-" + : $"{p.Educations.OrderByDescending(e => e.EndDate.Value.Year).FirstOrDefault().Degree} {p.Educations.OrderByDescending(e => e.EndDate.Value.Year).FirstOrDefault().Field}" + }).FirstOrDefault(); + + var data = new List(); + var c = 1; + if (profile.Salaries.Count == 0) + { + var ret2 = new + { + CitizenId = profile.CitizenId, + Prefix = profile.Prefix, + FirstName = profile.FirstName, + LastName = profile.LastName, + DateOfBirth = profile.DateOfBirth, + RegistrationAddress = profile.RegistrationAddress, + SalaryAmount = profile.SalaryAmount, + Education = profile.Education, + AppointText = "", + SalaryDate = profile.DateAppoint, + PositionName = "", + OCFullPath = profile.OcFullPath + }; + data.Add(ret2); + } + var old_date = DateTime.Now; + var old_position = ""; + var old_ocid = Guid.NewGuid(); + dynamic ret; + + foreach (var s in profile.Salaries) + { + //if((old_date.Date != s.SalaryDateAnnounce.Value.Date)) + //{ + // old_date = s.SalaryDateAnnounce.Value; + // old_position= s.PositionName; + // old_ocid = s.OcId; + + // ret = new + // { + // CitizenId = profile.CitizenId, + // Prefix = profile.Prefix, + // FirstName = profile.FirstName, + // LastName = profile.LastName, + // DateOfBirth = profile.DateOfBirth, + // RegistrationAddress = profile.RegistrationAddress, + // SalaryAmount = profile.SalaryAmount, + // Education = profile.Education, + // AppointText = c == 1 ? "(เริ่มรับราชการ)" : "", + // SalaryDate = s.SalaryDateAnnounce.Value.ToThaiShortDate(), + // PositionName = s.PositionName, + // OCFullPath = CoreCommandReport.GetOrganizationNameFullPath(s.OcId, false, false) + // }; + // data.Add(ret); + //} + if (old_position != s.PositionName) + { + old_date = s.SalaryDateAnnounce.Value; + old_position = s.PositionName; + old_ocid = s.OcId.Value; + ret = new + { + CitizenId = profile.CitizenId, + Prefix = profile.Prefix, + FirstName = profile.FirstName, + LastName = profile.LastName, + DateOfBirth = profile.DateOfBirth, + RegistrationAddress = profile.RegistrationAddress, + SalaryAmount = profile.SalaryAmount, + Education = profile.Education, + AppointText = c == 1 ? "(เริ่มรับราชการ)" : "", + SalaryDate = s.SalaryDateAnnounce.Value.ToThaiShortDate(), + PositionName = s.PositionName, + OCFullPath = _profileService.GetOrganizationNameFullPath(s.OcId.Value, false, false) + }; + data.Add(ret); + } + else if (old_ocid != s.OcId) + { + old_date = s.SalaryDateAnnounce.Value; + old_position = s.PositionName; + old_ocid = s.OcId.Value; + ret = new + { + CitizenId = profile.CitizenId, + Prefix = profile.Prefix, + FirstName = profile.FirstName, + LastName = profile.LastName, + DateOfBirth = profile.DateOfBirth, + RegistrationAddress = profile.RegistrationAddress, + SalaryAmount = profile.SalaryAmount, + Education = profile.Education, + AppointText = c == 1 ? "(เริ่มรับราชการ)" : "", + SalaryDate = s.SalaryDateAnnounce.Value.ToThaiShortDate(), + PositionName = s.PositionName, + OCFullPath = _profileService.GetOrganizationNameFullPath(s.OcId.Value, false, false) + }; + data.Add(ret); + } + + c++; + } + + var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptShortKp7.trdp"); + + ReportPackager reportPackager = new ReportPackager(); + Telerik.Reporting.Report? report = null; + using (var sourceStream = System.IO.File.OpenRead(rptFile)) + { + report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream); + } + + report.DataSource = data; + System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); + + InstanceReportSource instanceReportSource = new InstanceReportSource() + { + ReportDocument = report + }; + + + ReportProcessor reportProcessor = new ReportProcessor(_configuration); + RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo); + + var content = result.DocumentBytes; + return File(content, "application/pdf", $"ประวัติการรับราชการอย่างย่อ_{data.First().CitizenId}.pdf"); + + + + } + catch (Exception ex) + { + return Error(ex, "ไม่สามารถแสดงผลรายงานได้!!!"); + } + } + + + [HttpGet("kk1/{id:length(36)}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> GetKK1Report(Guid id) + { + try + { + var profile = (from p in _context.Profiles + join pf in _context.Prefixes on p.PrefixId equals pf.Id into p_pf_join + from p_pf in p_pf_join.DefaultIfEmpty() + join cpf in _context.Prefixes on p.CouplePrefixId equals cpf.Id into c_pf_join + from c_pf in c_pf_join.DefaultIfEmpty() + join fpf in _context.Prefixes on p.FatherPrefixId equals fpf.Id into f_pf_join + from f_pf in f_pf_join.DefaultIfEmpty() + join mpf in _context.Prefixes on p.MotherPrefixId equals mpf.Id into m_pf_join + from m_pf in m_pf_join.DefaultIfEmpty() + where p.Id == id + select new + { + p.CitizenId, + Prefix = p_pf == null ? "" : p_pf.Name, + p.FirstName, + p.LastName, + FullName = $"{p.FirstName} {p.LastName}", + BirthDay = p.BirthDate.Day, + BirthDayText = Convert.ToDecimal(p.BirthDate.Day).ThaiBahtText(UsesEt.Always, GreatFriends.ThaiBahtText.Unit.Baht, 2, false).Replace("บาท", ""), + BirthMonth = p.BirthDate.Month.ToThaiMonth(), + BirthYear = p.BirthDate.Year.ToThaiYear(), + BirthYearText = Convert.ToDecimal(p.BirthDate.Year.ToThaiYear()).ThaiBahtText(UsesEt.Always, GreatFriends.ThaiBahtText.Unit.Baht, 2, false).Replace("บาท", ""), + Address = "", + District = "", + Area = "", + Province = "", + Telephone = p.TelephoneNumber, + CouplePrefix = c_pf == null ? "" : c_pf.Name, + CoupleFullName = $"{p.CoupleFirstName} {p.CoupleLastName}".Trim(), + FatherPrefix = f_pf == null ? "" : f_pf.Name, + FatherFullName = $"{p.FatherFirstName} {p.FatherLastName}".Trim(), + MotherPrefix = m_pf == null ? "" : m_pf.Name, + MotherFullName = $"{p.MotherFirstName} {p.MotherLastName}".Trim(), + OcId = p.OcId, + OcFullPath = _profileService.GetOrganizationNameFullPath(p.OcId.Value, false, false), + Division = "", + Institute = "", + StartDate = p.DateStart == null ? "" : p.DateStart.Value.ToThaiShortDate(), + AppointDate = p.DateAppoint == null ? "" : p.DateAppoint.Value.ToThaiShortDate(), + BirthDate = p.BirthDate.ToThaiShortDate(), + RetireDate = p.BirthDate.CalculateRetireDate().ToThaiShortDate(), + }).ToList(); + + if (!profile.Any()) + return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound); + + // certificate + var cert = (from c in _context.ProfileCertificates.AsQueryable() + where c.Profile.Id == id + orderby c.IssueDate.Value.Year + select new + { + c.CertificateType, + c.Issuer, + c.CertificateNo, + IssueDate = c.IssueDate == null ? "" : c.IssueDate.Value.ToThaiShortDate() + }).ToList(); + + // add temp rows + while (cert.Count < 3) + { + cert.Add(new + { + CertificateType = "", + Issuer = "", + CertificateNo = "", + IssueDate = "" + }); + } + + // training + var training = (from t in _context.ProfileTrainings.AsQueryable() + where t.Profile.Id == id + orderby t.StartDate.Value.Year + select new + { + Institute = t.Host, + Start = t.StartDate == null ? "" : t.StartDate.Value.Year.ToThaiYear().ToString(), + End = t.EndDate == null ? "" : t.EndDate.Value.Year.ToThaiYear().ToString(), + Level = "", + Degree = t.Subject, + Field = "" + }).ToList(); + + while (training.Count < 3) + { + training.Add(new + { + Institute = "", + Start = "", + End = "", + Level = "", + Degree = "", + Field = "" + }); + } + + // disciplines + var discipline = (from d in _context.ProfileDisciplines.AsQueryable() + where d.Profile.Id == id + orderby d.Date.Value.Year + select new + { + DisciplineYear = d.Date == null ? "" : d.Date.Value.Year.ToThaiYear().ToString(), + DisciplineDetail = d.Detail, + RefNo = d.RefCommandNo + }).ToList(); + + while (discipline.Count < 3) + { + discipline.Add(new + { + DisciplineYear = "", + DisciplineDetail = "", + RefNo = "" + }); + } + + // education + var education = (from e in _context.ProfileEducations.AsQueryable() + where e.Profile.Id == id + orderby e.StartDate.Value.Year + select new + { + Institute = e.Institute, + Start = e.StartDate == null ? "" : e.StartDate.Value.Year.ToThaiYear().ToString(), + End = e.EndDate == null ? "" : e.EndDate.Value.Year.ToThaiYear().ToString(), + Level = e.EducationLevel, + Degree = e.Degree, + Field = e.Field.Trim() == "-" ? "" : e.Field + }).ToList(); + + while (education.Count < 4) + { + education.Add(new + { + Institute = "", + Start = "", + End = "", + Level = "", + Degree = "", + Field = "" + }); + } + + + + + + + + var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptKK1_Page1.trdp"); + + ReportPackager reportPackager = new ReportPackager(); + Telerik.Reporting.Report? report = null; + using (var sourceStream = System.IO.File.OpenRead(rptFile)) + { + report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream); + } + report.DataSource = profile; + + // binding to table + var tblCertificate = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblCertificate"]; + tblCertificate.DataSource = cert; + + var tblTraining = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblTraining"]; + tblTraining.DataSource = training; + + var tblDiscipline = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblDiscipline"]; + tblDiscipline.DataSource = discipline; + + var tblEducation = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblEducation"]; + tblEducation.DataSource = education; + + try + { + // Get avatar Image + var picContent = (await _minioService.DownloadFileAsync(Guid.Parse("08db510a-a7cb-44ef-85c8-f5c214f87972"))).FileContent; + var pictureBox = (Telerik.Reporting.PictureBox)report.Items["pageFooterSection1"].Items["picAvatar"]; + pictureBox.Value = Image.FromStream(new MemoryStream(picContent)); + } + catch { } + + + System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); + + InstanceReportSource instanceReportSource = new InstanceReportSource() + { + ReportDocument = report + }; + + + ReportProcessor reportProcessor = new ReportProcessor(_configuration); + RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo); + + // byte array waiting for merge pdf + var content = result.DocumentBytes; + + // page2 + var salary = (from s in _context.ProfileSalaries + join pos in _context.PositionPaths on s.PositionId equals pos.Id + join pos_no in _context.PositionNumbers on s.PosNoId equals pos_no.Id + join pos_lv in _context.PositionLevels on s.PositionLevelId equals pos_lv.Id + join pos_type in _context.PositionTypes on s.PositionTypeId equals pos_type.Id + where s.Profile.Id == id + orderby s.Date.Value + select new + { + SalaryDate = s.Date == null ? "" : s.Date == new DateTime(1, 1, 1) ? "" : s.Date.Value.ToThaiShortDate(), + Position = s.SalaryClass, + PosNo = pos_no.Name, + Rank = pos_lv.Name, + Salary = s.Amount == null ? "" : s.Amount.ToString().ToInteger().ToNumericText(), + RefAll = s.SalaryRef, + PositionType = pos_type.Name, + PositionLevel = pos_lv.Name, + PositionAmount = s.PositionSalaryAmount, + FullName = $"{s.Profile.FirstName} {s.Profile.LastName}", + OcFullPath = _profileService.GetOrganizationNameFullPath(s.Profile.OcId.Value, false, false), + }).ToList(); + + var rptFile2 = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptKK1_Page2.trdp"); + + ReportPackager reportPackager2 = new ReportPackager(); + Telerik.Reporting.Report? report2 = null; + using (var sourceStream = System.IO.File.OpenRead(rptFile2)) + { + report2 = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream); + } + report2.DataSource = salary; + // binding to table + var tblSalary = (Telerik.Reporting.Table)report2.Items["detailSection1"].Items["tblSalary"]; + tblSalary.DataSource = salary; + + System.Collections.Hashtable deviceInfo2 = new System.Collections.Hashtable(); + + InstanceReportSource instanceReportSource2 = new InstanceReportSource() + { + ReportDocument = report2 + }; + + + ReportProcessor reportProcessor2 = new ReportProcessor(_configuration); + RenderingResult result2 = reportProcessor2.RenderReport("PDF", instanceReportSource2, deviceInfo2); + + // byte array waiting for merge pdf + var content2 = result2.DocumentBytes; + + // merge pdf + using (MemoryStream ms = new MemoryStream()) + { + using (PdfDocument pdf = new PdfDocument(new PdfWriter(ms).SetSmartMode(true))) + { + // Create reader from bytes + using (MemoryStream memoryStream = new MemoryStream(content)) + { + // Create reader from bytes + using (PdfReader reader = new PdfReader(memoryStream)) + { + PdfDocument srcDoc = new PdfDocument(reader); + srcDoc.CopyPagesTo(1, srcDoc.GetNumberOfPages(), pdf); + } + } + + // Create reader from bytes + using (MemoryStream memoryStream = new MemoryStream(content2)) + { + // Create reader from bytes + using (PdfReader reader = new PdfReader(memoryStream)) + { + PdfDocument srcDoc = new PdfDocument(reader); + srcDoc.CopyPagesTo(1, srcDoc.GetNumberOfPages(), pdf); + } + } + + pdf.Close(); + } + + var fileContent = ms.ToArray(); + return File(fileContent, "application/pdf", $"กก_1_{id}.pdf"); + } + } + catch (Exception ex) + { + return Error(ex); + } + } + + #endregion + } +} diff --git a/Core/GlobalMessages.cs b/Core/GlobalMessages.cs new file mode 100644 index 0000000..30057cf --- /dev/null +++ b/Core/GlobalMessages.cs @@ -0,0 +1,11 @@ +namespace BMA.EHR.Recruit.Service.Core +{ + public class GlobalMessages + { + public const string FileNotFoundOnServer = "ไม่พบไฟล์ในระบบ!!"; + public const string CannotInsertToDatabase = "ไม่สามารถบันทึกลงฐานข้อมูลได้!!"; + public const string InvalidRequestParam = "Request parameter ไม่ถูกต้อง!!"; + public const string NoFileToUpload = "ไม่พบไฟล์เพื่อทำการอัพโหลด"; + public const string DataNotFound = "ไม่พบข้อมูลในระบบ"; + } +} diff --git a/Data/ApplicationDbContext.cs b/Data/ApplicationDbContext.cs index 78f6a1a..b6ded4b 100644 --- a/Data/ApplicationDbContext.cs +++ b/Data/ApplicationDbContext.cs @@ -1,4 +1,7 @@ -using BMA.EHR.Recruit.Service.Models.Documents; +using BMA.EHR.MetaData.Service.Models; +using BMA.EHR.Profile.Service.Models; +using BMA.EHR.Profile.Service.Models.HR; +using BMA.EHR.Recruit.Service.Models.Documents; using BMA.EHR.Recruit.Service.Models.Recruits; using Microsoft.EntityFrameworkCore; @@ -52,5 +55,7 @@ namespace BMA.EHR.Report.Service.Data public DbSet RecruitDocuments { get; set; } public DbSet RecruitImportHistories { get; set; } - } + + + } } diff --git a/Data/EHRDbContext.cs b/Data/EHRDbContext.cs new file mode 100644 index 0000000..9abfbfb --- /dev/null +++ b/Data/EHRDbContext.cs @@ -0,0 +1,225 @@ +using BMA.EHR.MetaData.Service.Models; +using BMA.EHR.Profile.Service.Models; +using BMA.EHR.Profile.Service.Models.HR; +using BMA.EHR.Recruit.Service.Models.Documents; +using BMA.EHR.Recruit.Service.Models.Recruits; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Report.Service.Data +{ + public class EHRDbContext : DbContext + { + public EHRDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + //base.OnModelCreating(modelBuilder); + + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + } + + public DbSet Documents { get; set; } + + #region " From Existing DB " + + public DbSet AvailablePositionLevels { get; set; } + + public DbSet PositionMasters { get; set; } + + public DbSet Organizations { get; set; } + + public DbSet PositionNumbers { get; set; } + + public DbSet OrganizationPositions { get; set; } + + public DbSet Prefixes { get; set; } + + public DbSet BloodGroups { get; set; } + + public DbSet Genders { get; set; } + + public DbSet PhysicalStatuses { get; set; } + + public DbSet Religions { get; set; } + + public DbSet EducationLevels { get; set; } + + public DbSet PositionPaths { get; set; } + + public DbSet PositionTypes { get; set; } + + public DbSet PositionEmployeePositions { get; set; } + + public DbSet PositionEmployeePositionSides { get; set; } + + public DbSet PositionEmployeeGroups { get; set; } + + public DbSet PositionEmployeeLines { get; set; } + + public DbSet PositionEmployeeLevels { get; set; } + + public DbSet PositionEmployeeStatuses { get; set; } + + public DbSet PositionLines { get; set; } + + public DbSet PositionExecutives { get; set; } + + public DbSet PositionStatuss { get; set; } + + public DbSet PositionLevels { get; set; } + + public DbSet Relationships { get; set; } + + public DbSet Positions { get; set; } + + public DbSet PositionPathSides { get; set; } + + public DbSet PositionExecutiveSides { get; set; } + + public DbSet InsigniaTypes { get; set; } + + public DbSet Insignias { get; set; } + + public DbSet Provinces { get; set; } + + public DbSet Districts { get; set; } + + public DbSet SubDistricts { get; set; } + + public DbSet Holidays { get; set; } + + public DbSet OrganizationTypes { get; set; } + + public DbSet OrganizationLevels { get; set; } + + public DbSet OrganizationOrganizations { get; set; } + + public DbSet OrganizationShortNames { get; set; } + + public DbSet OrganizationStatuses { get; set; } + + public DbSet OrganizationAgencys { get; set; } + + public DbSet OrganizationGovernmentAgencys { get; set; } + + public DbSet OrganizationTelExternals { get; set; } + + public DbSet OrganizationTelInternals { get; set; } + + public DbSet OrganizationFaxs { get; set; } + + public DbSet RoyalHierarchys { get; set; } + + public DbSet RoyalTypes { get; set; } + + public DbSet Royals { get; set; } + + #endregion + + public DbSet Profiles { get; set; } + + public DbSet ProfileEducations { get; set; } + + public DbSet ProfileEducationHistorys { get; set; } + + public DbSet ProfileHonors { get; set; } + + public DbSet ProfileHonorHistorys { get; set; } + + public DbSet ProfileAssessments { get; set; } + + public DbSet ProfileAssessmentHistorys { get; set; } + + public DbSet ProfileDisciplines { get; set; } + + public DbSet ProfileDisciplineHistorys { get; set; } + + public DbSet ProfileCertificates { get; set; } + + public DbSet ProfileCertificateHistorys { get; set; } + + public DbSet ProfileTrainings { get; set; } + + public DbSet ProfileTrainingHistorys { get; set; } + + public DbSet ProfileInsignias { get; set; } + + public DbSet ProfileInsigniaHistorys { get; set; } + + public DbSet ProfileSalaries { get; set; } + + public DbSet ProfileSalaryHistories { get; set; } + + public DbSet ProfileSalaryOrganizations { get; set; } + + public DbSet ProfileSalaryPositions { get; set; } + + public DbSet ProfileSalaryPositionsNumbers { get; set; } + + public DbSet ProfileHistory { get; set; } + + public DbSet ProfileCoupleHistory { get; set; } + + public DbSet ProfileFatherHistory { get; set; } + + public DbSet ProfileMotherHistory { get; set; } + + public DbSet ProfileFamilyHistory { get; set; } + + public DbSet ProfileGovernmentHistory { get; set; } + + public DbSet ProfileLeaves { get; set; } + + public DbSet ProfileLeaveHistorys { get; set; } + + public DbSet ProfileSalaryPositionLevels { get; set; } + + public DbSet ProfileSalaryPositionTypes { get; set; } + + public DbSet ProfileChildrens { get; set; } + + public DbSet ProfileChildrenHistories { get; set; } + + public DbSet ProfilePapers { get; set; } + + public DbSet ProfileCurrentAddressHistories { get; set; } + + public DbSet ProfileRegistrationAddressHistories { get; set; } + + public DbSet ProfileAddressHistories { get; set; } + + public DbSet ProfileOthers { get; set; } + + public DbSet ProfileOtherHistorys { get; set; } + + public DbSet ProfileAbilitys { get; set; } + + public DbSet ProfileAbilityHistorys { get; set; } + + public DbSet ProfileDutys { get; set; } + + public DbSet ProfileDutyHistorys { get; set; } + + public DbSet ProfileNopaids { get; set; } + + public DbSet ProfileNopaidHistorys { get; set; } + + public DbSet ProfileAvatarHistories { get; set; } + + public DbSet ProfilePositions { get; set; } + } +} diff --git a/Data/ExamDbContext.cs b/Data/ExamDbContext.cs new file mode 100644 index 0000000..19e8268 --- /dev/null +++ b/Data/ExamDbContext.cs @@ -0,0 +1,79 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using BMA.EHR.Recurit.Exam.Service.Models; +using BMA.EHR.Recurit.Exam.Service.Models.Disables; +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Report.Service.Data +{ + public class ExamDbContext : DbContext + { + public ExamDbContext(DbContextOptions options) + : base(options) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + //base.OnModelCreating(modelBuilder); + + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + //modelBuilder.Ignore(); + } + + public DbSet PeriodExams { get; set; } + + public DbSet Candidates { get; set; } + + public DbSet Careers { get; set; } + + public DbSet Educations { get; set; } + + public DbSet Documents { get; set; } + + public DbSet CandidateDocuments { get; set; } + + public DbSet PositionExams { get; set; } + + public DbSet BankExams { get; set; } + + public DbSet PeriodExamDocuments { get; set; } + + public DbSet PeriodExamImages { get; set; } + + public DbSet CMSCandidates { get; set; } + + public DbSet CMSAgencys { get; set; } + + public DbSet CMSGovernments { get; set; } + + public DbSet Disables { get; set; } + + public DbSet DisableAddresses { get; set; } + + public DbSet DisableOccupations { get; set; } + + public DbSet DisableCertificates { get; set; } + + public DbSet DisableEducations { get; set; } + + public DbSet ScoreImports { get; set; } + + public DbSet DisableScores { get; set; } + + public DbSet DisablePayments { get; set; } + + public DbSet DisableDocuments { get; set; } + + public DbSet DisableImportHistories { get; set; } + } +} diff --git a/Models/AvailablePositionLevelEntity.cs b/Models/AvailablePositionLevelEntity.cs new file mode 100644 index 0000000..b797d9d --- /dev/null +++ b/Models/AvailablePositionLevelEntity.cs @@ -0,0 +1,25 @@ + +using BMA.EHR.Report.Service.Models; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models +{ + public class AvailablePositionLevelEntity : EntityBase + { + + [ForeignKey("PositionMasterId")] + public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; } + + [Column(Order = 2), Comment("PositionMasterId")] + public Guid? PositionMasterId { get; set; } + + [Column(Order = 3), Comment("PositionLevelId")] + public Guid? PositionLevelId { get; set; } + + + + + } +} diff --git a/Models/Exam/BankExam.cs b/Models/Exam/BankExam.cs new file mode 100644 index 0000000..71d447a --- /dev/null +++ b/Models/Exam/BankExam.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class BankExam : EntityBase + { + [Required, Comment("Id การสอบ")] + public virtual PeriodExam? PeriodExam { get; set; } + + [Comment("เลขบัญชี")] + public string? AccountNumber { get; set; } + + [Comment("ธนาคาร")] + public string? BankName { get; set; } + + [Comment("ชื่อบัญชี")] + public string? AccountName { get; set; } + } +} diff --git a/Models/Exam/CMSAgency.cs b/Models/Exam/CMSAgency.cs new file mode 100644 index 0000000..c017a70 --- /dev/null +++ b/Models/Exam/CMSAgency.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class CMSAgency : EntityBase + { + [Required, Comment("Id CMS")] + public virtual CMSCandidate? CMSCandidate { get; set; } + + [Comment("ชื่อลิงค์")] + public string? Name { get; set; } + + [Comment("ลิงค์")] + public string? Link { get; set; } + } +} diff --git a/Models/Exam/CMSCandidate.cs b/Models/Exam/CMSCandidate.cs new file mode 100644 index 0000000..f2dce56 --- /dev/null +++ b/Models/Exam/CMSCandidate.cs @@ -0,0 +1,64 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class CMSCandidate : EntityBase + { + + [Comment("Id โลโก้เว็บ")] + public virtual Document? LogoImg { get; set; } + + [Comment("Id Banner")] + public virtual Document? BannerImg { get; set; } + + + [Comment("ชื่อเว็บภาษาไทย")] + public string? NameTh { get; set; } + + [Comment("ชื่อย่อ")] + public string? ShortName { get; set; } + + [Comment("ชื่อเว็บภาษาอังกฤษ")] + public string? NameEn { get; set; } + + [Comment("ข้อมูลเว็บโดยย่อ")] + public string? Description { get; set; } + + + [Comment("ข้อมูลเกี่ยวกับเรา")] + public string? About { get; set; } + + [Comment("ที่อยู่ปัจจุบัน")] + public string? Address { get; set; } + + [Comment("Id จังหวัด")] + public Guid? ProvinceId { get; set; } + + [Comment("จังหวัด")] + public string? ProvinceName { get; set; } + + [Comment("Id อำเภอ")] + public Guid? DistrictId { get; set; } + + [Comment("อำเภอ")] + public string? DistrictName { get; set; } + + [Comment("Id ตำบล")] + public Guid? SubDistrictId { get; set; } + + [Comment("ตำบล")] + public string? SubDistrictName { get; set; } + + [MaxLength(10), Comment("รหัสไปรษณีย์")] + public string? ZipCode { get; set; } + + [MaxLength(20), Comment("โทรศัพท์")] + public string? Telephone { get; set; } + + public List CMSAgencys { get; set; } = new List(); + + public List CMSGovernments { get; set; } = new List(); + } +} diff --git a/Models/Exam/CMSGovernment.cs b/Models/Exam/CMSGovernment.cs new file mode 100644 index 0000000..d946fca --- /dev/null +++ b/Models/Exam/CMSGovernment.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class CMSGovernment : EntityBase + { + [Required, Comment("Id CMS")] + public virtual CMSCandidate? CMSCandidate { get; set; } + + [Comment("ชื่อลิงค์")] + public string? Name { get; set; } + + [Comment("ลิงค์")] + public string? Link { get; set; } + } +} diff --git a/Models/Exam/Candidate.cs b/Models/Exam/Candidate.cs new file mode 100644 index 0000000..3dfed1e --- /dev/null +++ b/Models/Exam/Candidate.cs @@ -0,0 +1,256 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class Candidate : EntityBase + { + [Required, Comment("Id การสอบ")] + public virtual PeriodExam? PeriodExam { get; set; } + + [Comment("Id ตำแหน่งสอบ")] + public virtual PositionExam? PositionExam { get; set; } + + [Required, MaxLength(40), Comment("User Id ผู้สมัคร")] + public string UserId { get; set; } = string.Empty; + + [Required, MaxLength(20), Comment("สถานะผู้สมัคร")] + public string Status { get; set; } = "register"; + + [Comment("เลขประจำตัวสอบ")] + public string? ExamIdenNumber { get; set; } + + [Comment("เลขที่นั่งสอบ")] + public string? SeatNumber { get; set; } + + [Comment("คะแนนเต็มภาค ข")] + public string? PointTotalB { get; set; } + + [Comment("คะแนนภาค ข")] + public string? PointB { get; set; } + + [Comment("ผลสอบภาค ข")] + public string? ResultB { get; set; } + + [Comment("คะแนนเต็มภาค ค")] + public string? PointTotalC { get; set; } + + [Comment("คะแนนภาค ค")] + public string? PointC { get; set; } + + [Comment("ผลสอบภาค ค")] + public string? ResultC { get; set; } + + [Comment("Id รูปโปรไฟล์")] + public virtual Document? ProfileImg { get; set; } + + [Comment("Id หลักฐานชำระเงิน")] + public virtual Document? PaymentImg { get; set; } + + [Comment("ลำดับที่สอบได้")] + public string? Number { get; set; } + + + [Comment("Id คำนำหน้าชื่อ")] + public Guid? PrefixId { get; set; } + + [Comment("คำนำหน้าชื่อ")] + public string? PrefixName { get; set; } + + [MaxLength(100), Column(Order = 1), Comment("ชื่อจริง")] + public string? FirstName { get; set; } + + [MaxLength(100), Column(Order = 2), Comment("นามสกุล")] + public string? LastName { get; set; } + + [MaxLength(40), Column(Order = 3), Comment("สัญชาติ")] + public string? Nationality { get; set; } + + [MaxLength(40), Comment("วันเกิด")] + public DateTime? DateOfBirth { get; set; } + + [Comment("Id สถานภาพ")] + public Guid? RelationshipId { get; set; } + + [Comment("สถานภาพ")] + public string? RelationshipName { get; set; } + + [MaxLength(200), Comment("อีเมล")] + public string? Email { get; set; } + + [MaxLength(20), Comment("เลขประจำตัวประชาชน")] + public string? CitizenId { get; set; } + + [Comment("Id เขตที่ออกบัตรประชาชน")] + public Guid? CitizenDistrictId { get; set; } + + [Comment("เขตที่ออกบัตรประชาชน")] + public string? CitizenDistrictName { get; set; } + + [Comment("Id จังหวัดที่ออกบัตรประชาชน")] + public Guid? CitizenProvinceId { get; set; } + + [Comment("จังหวัดที่ออกบัตรประชาชน")] + public string? CitizenProvinceName { get; set; } + + [Comment("วันที่ออกบัตร")] + public DateTime? CitizenDate { get; set; } + + [MaxLength(20), Comment("โทรศัพท์")] + public string? Telephone { get; set; } + + [MaxLength(20), Comment("โทรศัพท์มือถือ")] + public string? MobilePhone { get; set; } + + [Comment("ความสามารถพิเศษ")] + public string? Knowledge { get; set; } + + + + + [Comment("ที่อยู่ตามทะเบียนบ้าน")] + public string? RegistAddress { get; set; } + + [Comment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน")] + public Guid? RegistProvinceId { get; set; } + + [Comment("จังหวัดที่อยู่ตามทะเบียนบ้าน")] + public string? RegistProvinceName { get; set; } + + [Comment("Id อำเภอที่อยู่ตามทะเบียนบ้าน")] + public Guid? RegistDistrictId { get; set; } + + [Comment("อำเภอที่อยู่ตามทะเบียนบ้าน")] + public string? RegistDistrictName { get; set; } + + [Comment("Id ตำบลที่อยู่ตามทะเบียนบ้าน")] + public Guid? RegistSubDistrictId { get; set; } + + [Comment("ตำบลที่อยู่ตามทะเบียนบ้าน")] + public string? RegistSubDistrictName { get; set; } + + [MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน")] + public string? RegistZipCode { get; set; } + + [Comment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน")] + public bool? RegistSame { get; set; } + + [Comment("ที่อยู่ปัจจุบัน")] + public string? CurrentAddress { get; set; } + + [Comment("Id จังหวัดที่อยู่ปัจจุบัน")] + public Guid? CurrentProvinceId { get; set; } + + [Comment("จังหวัดที่อยู่ปัจจุบัน")] + public string? CurrentProvinceName { get; set; } + + [Comment("Id อำเภอที่อยู่ปัจจุบัน")] + public Guid? CurrentDistrictId { get; set; } + + [Comment("อำเภอที่อยู่ปัจจุบัน")] + public string? CurrentDistrictName { get; set; } + + [Comment("Id ตำบลที่อยู่ปัจจุบัน")] + public Guid? CurrentSubDistrictId { get; set; } + + [Comment("ตำบลที่อยู่ปัจจุบัน")] + public string? CurrentSubDistrictName { get; set; } + + [MaxLength(10), Comment("รหัสไปรษณีย์ที่อยู่ปัจจุบัน")] + public string? CurrentZipCode { get; set; } + + + + [Comment("คู่สมรส")] + public bool? Marry { get; set; } + + [Comment("Id คำนำหน้าชื่อคู่สมรส")] + public Guid? MarryPrefixId { get; set; } + + [Comment("คำนำหน้าชื่อคู่สมรส")] + public string? MarryPrefixName { get; set; } + + [MaxLength(100), Comment("ชื่อจริงคู่สมรส")] + public string? MarryFirstName { get; set; } + + [MaxLength(100), Comment("นามสกุลคู่สมรส")] + public string? MarryLastName { get; set; } + + [MaxLength(200), Comment("อาชีพคู่สมรส")] + public string? MarryOccupation { get; set; } + + [MaxLength(100), Comment("สัญชาติคู่สมรส")] + public string? MarryNationality { get; set; } + + [Comment("Id คำนำหน้าชื่อบิดา")] + public Guid? FatherPrefixId { get; set; } + + [Comment("คำนำหน้าชื่อบิดา")] + public string? FatherPrefixName { get; set; } + + [MaxLength(100), Comment("ชื่อจริงบิดา")] + public string? FatherFirstName { get; set; } + + [MaxLength(100), Comment("นามสกุลบิดา")] + public string? FatherLastName { get; set; } + + [MaxLength(200), Comment("อาชีพบิดา")] + public string? FatherOccupation { get; set; } + + [MaxLength(100), Comment("สัญชาติบิดา")] + public string? FatherNationality { get; set; } + + [Comment("Id คำนำหน้าชื่อมารดา")] + public Guid? MotherPrefixId { get; set; } + + [Comment("คำนำหน้าชื่อมารดา")] + public string? MotherPrefixName { get; set; } + + [MaxLength(100), Comment("ชื่อจริงมารดา")] + public string? MotherFirstName { get; set; } + + [MaxLength(100), Comment("นามสกุลมารดา")] + public string? MotherLastName { get; set; } + + [MaxLength(200), Comment("อาชีพมารดา")] + public string? MotherOccupation { get; set; } + + [MaxLength(100), Comment("สัญชาติมารดา")] + public string? MotherNationality { get; set; } + + + + [Comment("ประเภทอาชีพที่ทำงานมาก่อน")] + public string? OccupationType { get; set; } + + [Comment("ตำแหน่งอาชีพ")] + public string? OccupationPosition { get; set; } + + [Comment("สำนัก/บริษัท บริษัท")] + public string? OccupationCompany { get; set; } + + [Comment("กอง/ฝ่าย บริษัท")] + public string? OccupationDepartment { get; set; } + + [MaxLength(200), Comment("อีเมล บริษัท")] + public string? OccupationEmail { get; set; } + + [MaxLength(20), Comment("โทรศัพท์ บริษัท")] + public string? OccupationTelephone { get; set; } + + [Comment("เหตุผลการไม่อนุมัติ")] + public string? RejectDetail { get; set; } + + [Comment("ผลสมัครสอบ")] + public string? Pass { get; set; } + + [Comment("คะแนนความพึงพอใจ")] + public int? ReviewPoint { get; set; } + + [Comment("ข้อแนะนำ")] + public string? Review { get; set; } + + } +} diff --git a/Models/Exam/CandidateDocument.cs b/Models/Exam/CandidateDocument.cs new file mode 100644 index 0000000..00270b1 --- /dev/null +++ b/Models/Exam/CandidateDocument.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Recruit.Service.Models.Documents; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class CandidateDocument : EntityBase + { + [Required, Comment("Id ผู้สมัครสอบ")] + public virtual Candidate? Candidate { get; set; } + + [Required, Comment("Id ไฟล์เอกสาร")] + public virtual Document? Document { get; set; } + } +} diff --git a/Models/Exam/Career.cs b/Models/Exam/Career.cs new file mode 100644 index 0000000..c4561e0 --- /dev/null +++ b/Models/Exam/Career.cs @@ -0,0 +1,30 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class Career : EntityBase + { + [Required, Column(Order = 7), Comment("Id ผู้สมัคร")] + public virtual Candidate? Candidate { get; set; } + + [Required, Column(Order = 3), Comment("สถานที่ทำงาน/ฝึกงาน")] + public string Name { get; set; } = string.Empty; + + [Required, Column(Order = 4), Comment("ตำแหน่ง/ลักษณะงาน")] + public string Position { get; set; } = string.Empty; + + [Required, MaxLength(20), Column(Order = 5), Comment("เงินเดือนสุดท้ายก่อนออก")] + public int Salary { get; set; } + + [Required, Column(Order = 1), Comment("ระยะเวลาเริ่ม")] + public DateTime DurationStart { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 2), Comment("ระยะเวลาสิ้นสุด")] + public DateTime DurationEnd { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 6), Comment("เหตุผลที่ออก")] + public string Reason { get; set; } = string.Empty; + } +} diff --git a/Models/Exam/Disable/Disable.cs b/Models/Exam/Disable/Disable.cs new file mode 100644 index 0000000..4d789ae --- /dev/null +++ b/Models/Exam/Disable/Disable.cs @@ -0,0 +1,82 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class Disable : EntityBase + { + + [Required, MaxLength(13), Comment("เลขประจำตัวประชาชน")] + public string CitizenId { get; set; } = string.Empty; + + [Required, MaxLength(50)] + public string ExamId { get; set; } = string.Empty; + + [Required, MaxLength(50)] + public string Prefix { get; set; } = string.Empty; + + [Required, MaxLength(150)] + public string FirstName { get; set; } = string.Empty; + + [Required, MaxLength(150)] + public string LastName { get; set; } = string.Empty; + + [MaxLength(20)] + public string Gendor { get; set; } = string.Empty; + + [MaxLength(200)] + public string National { get; set; } = string.Empty; + + [MaxLength(200)] + public string Race { get; set; } = string.Empty; + + [MaxLength(200)] + public string Religion { get; set; } = string.Empty; + + [Required] + public DateTime DateOfBirth { get; set; } + + [MaxLength(20)] + public string Marry { get; set; } = string.Empty; + + [MaxLength(1)] + public string Isspecial { get; set; } = "N"; + + [MaxLength(20)] + public string RefNo { get; set; } = string.Empty; + + [MaxLength(200)] + public string CitizenCardIssuer { get; set; } = string.Empty; + + public DateTime CitizenCardExpireDate { get; set; } + + [MaxLength(200)] + public string Remark { get; set; } = string.Empty; + + [MaxLength(1)] + public string Qualified { get; set; } = "Y"; + + public PeriodExam? PeriodExam { get; set; } + + public virtual List Addresses { get; set; } = new List(); + + public virtual List Occupations { get; set; } = new List(); + + public virtual List Certificates { get; set; } = new List(); + + public virtual List Educations { get; set; } = new List(); + + public virtual List Payments { get; set; } = new List(); + + public virtual List Documents { get; set; } = new List(); + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public DateTime ModifiedDate { get; set; } + + public DateTime ApplyDate { get; set; } + + public string? PositionName { get; set; } + } +} diff --git a/Models/Exam/Disable/DisableAddress.cs b/Models/Exam/Disable/DisableAddress.cs new file mode 100644 index 0000000..2d746ec --- /dev/null +++ b/Models/Exam/Disable/DisableAddress.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisableAddress : EntityBase + { + [MaxLength(200)] + public string Address { get; set; } + + [MaxLength(200)] + public string Moo { get; set; } + + [MaxLength(200)] + public string Soi { get; set; } + + [MaxLength(200)] + public string Road { get; set; } + + [MaxLength(200)] + public string District { get; set; } + + [MaxLength(200)] + public string Amphur { get; set; } + + [MaxLength(200)] + public string Province { get; set; } + + [MaxLength(5)] + public string ZipCode { get; set; } + + [MaxLength(200)] + public string Telephone { get; set; } + + [MaxLength(200)] + public string Mobile { get; set; } + + [MaxLength(200)] + public string Address1 { get; set; } + + [MaxLength(200)] + public string Moo1 { get; set; } + + [MaxLength(200)] + public string Soi1 { get; set; } + + [MaxLength(200)] + public string Road1 { get; set; } + + [MaxLength(200)] + public string District1 { get; set; } + + [MaxLength(200)] + public string Amphur1 { get; set; } + + [MaxLength(200)] + public string Province1 { get; set; } + + [MaxLength(5)] + public string ZipCode1 { get; set; } + + public Disable Disable { get; set; } + } +} diff --git a/Models/Exam/Disable/DisableCertificate.cs b/Models/Exam/Disable/DisableCertificate.cs new file mode 100644 index 0000000..b1108ac --- /dev/null +++ b/Models/Exam/Disable/DisableCertificate.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisableCertificate : EntityBase + { + [MaxLength(50)] + public string CertificateNo { get; set; } + + [MaxLength(200)] + public string Description { get; set; } + + public DateTime IssueDate { get; set; } + + public DateTime ExpiredDate { get; set; } + + public Disable Disable { get; set; } + } +} diff --git a/Models/Exam/Disable/DisableDocument.cs b/Models/Exam/Disable/DisableDocument.cs new file mode 100644 index 0000000..a3dfa82 --- /dev/null +++ b/Models/Exam/Disable/DisableDocument.cs @@ -0,0 +1,13 @@ +using BMA.EHR.Recruit.Service.Models.Documents; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisableDocument : EntityBase + { + public DateTime CreatedDate { get; set; } + + public Document DocumentFile { get; set; } + + public Disable Disable { get; set; } + } +} diff --git a/Models/Exam/Disable/DisableEducation.cs b/Models/Exam/Disable/DisableEducation.cs new file mode 100644 index 0000000..cb2cbb3 --- /dev/null +++ b/Models/Exam/Disable/DisableEducation.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisableEducation : EntityBase + { + [MaxLength(200)] + public string Degree { get; set; } + + [MaxLength(200)] + public string Major { get; set; } + + [MaxLength(20)] + public string MajorGroupId { get; set; } + + [MaxLength(200)] + public string MajorGroupName { get; set; } + + [MaxLength(200)] + public string University { get; set; } + public double GPA { get; set; } = 0.0; + + [MaxLength(1000)] + public string Specialist { get; set; } + + [MaxLength(200)] + public string HighDegree { get; set; } + + public DateTime BachelorDate { get; set; } + + public Disable Disable { get; set; } + } +} diff --git a/Models/Exam/Disable/DisableImportHistory.cs b/Models/Exam/Disable/DisableImportHistory.cs new file mode 100644 index 0000000..bddb2d4 --- /dev/null +++ b/Models/Exam/Disable/DisableImportHistory.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisableImportHistory : EntityBase + { + [Required, Comment("รายละเอียดการนำเข้า"), Column(Order = 1)] + public string Description { get; set; } = string.Empty; + + public PeriodExam PeriodExam { get; set; } + } +} \ No newline at end of file diff --git a/Models/Exam/Disable/DisableOccupation.cs b/Models/Exam/Disable/DisableOccupation.cs new file mode 100644 index 0000000..23f59c6 --- /dev/null +++ b/Models/Exam/Disable/DisableOccupation.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisableOccupation : EntityBase + { + [MaxLength(200)] + public string Occupation { get; set; } + + [MaxLength(200)] + public string WorkAge { get; set; } + + [MaxLength(200)] + public string Position { get; set; } + + [MaxLength(200)] + public string Workplace { get; set; } + + [MaxLength(200)] + public string Telephone { get; set; } + + public Disable Disable { get; set; } + } +} diff --git a/Models/Exam/Disable/DisablePayment.cs b/Models/Exam/Disable/DisablePayment.cs new file mode 100644 index 0000000..437e963 --- /dev/null +++ b/Models/Exam/Disable/DisablePayment.cs @@ -0,0 +1,56 @@ +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisablePayment : EntityBase + { + [MaxLength(50)] + public string PaymentId { get; set; } + + [MaxLength(50)] + public string CompanyCode { get; set; } + + [MaxLength(50)] + public string TextFile { get; set; } + + [MaxLength(50)] + public string BankCode { get; set; } + + [MaxLength(50)] + public string AccountNumber { get; set; } + + [MaxLength(50)] + public string TransDate { get; set; } + + [MaxLength(50)] + public string TransTime { get; set; } + + [MaxLength(200)] + public string CustomerName { get; set; } + + [MaxLength(50)] + public string RefNo1 { get; set; } + + [MaxLength(50)] + public string TermBranch { get; set; } + + [MaxLength(50)] + public string TellerId { get; set; } + + [MaxLength(50)] + public string CreditDebit { get; set; } + + [MaxLength(50)] + public string PaymentType { get; set; } + + [MaxLength(50)] + public string ChequeNo { get; set; } + + public decimal Amount { get; set; } + + [MaxLength(50)] + public string ChqueBankCode { get; set; } + + public Disable Disable { get; set; } + } +} diff --git a/Models/Exam/Disable/DisableScore.cs b/Models/Exam/Disable/DisableScore.cs new file mode 100644 index 0000000..1e081fc --- /dev/null +++ b/Models/Exam/Disable/DisableScore.cs @@ -0,0 +1,54 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class DisableScore : EntityBase + { + [Required, MaxLength(50)] + public string ExamId { get; set; } + + public int SumA { get; set; } + + public int FullA { get; set; } + + public double PercentageA { get; set; } + + [MaxLength(50)] + public string AStatus { get; set; } + + public int SumB { get; set; } + + public int FullB { get; set; } + + public double PercentageB { get; set; } + + [MaxLength(50)] + public string BStatus { get; set; } + + public int SumAB { get; set; } + + [Required, MaxLength(50)] + public string ABStatus { get; set; } + + public int SumC { get; set; } + + public int FullC { get; set; } + + public double PercentageC { get; set; } + + [MaxLength(50)] + public string CStatus { get; set; } + + [Required, MaxLength(50)] + public string ExamStatus { get; set; } + + [MaxLength(200)] + public string Major { get; set; } + + [MaxLength(200), Comment("ลำดับที่สอบได้")] + public string Number { get; set; } = string.Empty; + + public ScoreImport ScoreImport { get; set; } + } +} diff --git a/Models/Exam/Disable/ScoreImport.cs b/Models/Exam/Disable/ScoreImport.cs new file mode 100644 index 0000000..90c32ee --- /dev/null +++ b/Models/Exam/Disable/ScoreImport.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Recurit.Exam.Service.Models.Disables +{ + public class ScoreImport : EntityBase + { + public int? Year { get; set; } + + public Document ImportFile { get; set; } = new Document(); + + public virtual List Scores { get; set; } = new List(); + + [ForeignKey("FK_Score_Import_ID")] + public Guid PeriodExamId { get; set; } + + public PeriodExam PeriodExam { get; set; } + } +} diff --git a/Models/Exam/District.cs b/Models/Exam/District.cs new file mode 100644 index 0000000..0d6c13d --- /dev/null +++ b/Models/Exam/District.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +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; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual List SubDistricts { get; set; } = new(); + + public virtual Province? Province { get; set; } + } +} diff --git a/Models/Exam/Education.cs b/Models/Exam/Education.cs new file mode 100644 index 0000000..2954925 --- /dev/null +++ b/Models/Exam/Education.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class Education : EntityBase + { + [Required, Column(Order = 7), Comment("Id ผู้สมัคร")] + public virtual Candidate? Candidate { get; set; } + + [Comment("Idวุฒิที่ได้รับ")] + public Guid? EducationLevelId { get; set; } + + [Comment("วุฒิที่ได้รับ")] + public string? EducationLevelName { get; set; } + + [Required, Column(Order = 4), Comment("สาขาวิชา/วิชาเอก")] + public string Major { get; set; } = string.Empty; + + [Required, MaxLength(10), Column(Order = 6), Comment("คะแนนเฉลี่ยตลอดหลักสูตร")] + public float Scores { get; set; } + + [Required, Column(Order = 3), Comment("ชื่อสถานศึกษา")] + public string Name { get; set; } = string.Empty; + + [Required, Column(Order = 1), Comment("ระยะเวลาเริ่ม")] + public DateTime DurationStart { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 2), Comment("ระยะเวลาสิ้นสุด")] + public DateTime DurationEnd { get; set; } = DateTime.Now.Date; + } +} diff --git a/Models/Exam/EducationLevel.cs b/Models/Exam/EducationLevel.cs new file mode 100644 index 0000000..314bd8c --- /dev/null +++ b/Models/Exam/EducationLevel.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +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; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/Exam/EntityBase.cs b/Models/Exam/EntityBase.cs new file mode 100644 index 0000000..e83053c --- /dev/null +++ b/Models/Exam/EntityBase.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text.Json.Serialization; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class EntityBase + { + [Key, Column(Order = 0), Comment("PrimaryKey")] + [JsonPropertyName("id")] + public Guid Id { get; set; } + + [Required, Column(Order = 100), Comment("สร้างข้อมูลเมื่อ")] + public DateTime CreatedAt { get; set; } = DateTime.Now; + + [Column(Order = 101), Comment("User Id ที่สร้างข้อมูล"), MaxLength(40)] + public string CreatedUserId { get; set; } = string.Empty; + + [Column(Order = 102), Comment("แก้ไขข้อมูลล่าสุดเมื่อ")] + public DateTime? LastUpdatedAt { get; set; } + + [Column(Order = 103), Comment("User Id ที่แก้ไขข้อมูลล่าสุด"), MaxLength(40)] + public string LastUpdateUserId { get; set; } = string.Empty; + + [Column(Order = 104), Comment("ชื่อ User ที่สร้างข้อมูล"), MaxLength(200)] + public string CreatedFullName { get; set; } = string.Empty; + + [Column(Order = 105), Comment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), MaxLength(200)] + public string LastUpdateFullName { get; set; } = string.Empty; + } +} diff --git a/Models/Exam/OrganizationOrganization.cs b/Models/Exam/OrganizationOrganization.cs new file mode 100644 index 0000000..06c6532 --- /dev/null +++ b/Models/Exam/OrganizationOrganization.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class OrganizationOrganization : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/Exam/OrganizationShortName.cs b/Models/Exam/OrganizationShortName.cs new file mode 100644 index 0000000..8dfcac3 --- /dev/null +++ b/Models/Exam/OrganizationShortName.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class OrganizationShortName : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสหน่วยงาน")] + public string AgencyCode { get; set; } = string.Empty; + [Required, MaxLength(100), Column(Order = 2), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ")] + public string GovernmentCode { get; set; } = string.Empty; + [Required, MaxLength(100), Column(Order = 3), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 4), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/Exam/PeriodExam.cs b/Models/Exam/PeriodExam.cs new file mode 100644 index 0000000..6565920 --- /dev/null +++ b/Models/Exam/PeriodExam.cs @@ -0,0 +1,105 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using BMA.EHR.Recurit.Exam.Service.Models.Disables; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class PeriodExam : EntityBase + { + [Required, MaxLength(150), Column(Order = 8), Comment("ชื่อการสอบ")] + public string Name { get; set; } = string.Empty; + + [Required, Comment("ตรวจสอบเอกสารหลังประกาศผลสอบ")] + public bool CheckDocument { get; set; } = false; + + [Required, Comment("คนพิการ")] + public bool CheckDisability { get; set; } = false; + + [Column(Order = 9), Comment("รอบการสอบ")] + public int? Round { get; set; } + + [Comment("ปีงบประมาณ")] + public int? Year { get; set; } + + [Comment("ค่าธรรมเนียม")] + public float? Fee { get; set; } = 0; + + [Required, Column(Order = 1), Comment("วันเริ่มสมัครสอบ")] + public DateTime RegisterStartDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 2), Comment("วันสิ้นสุดสมัครสอบ")] + public DateTime RegisterEndDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 3), Comment("วันเริ่มชำระเงิน")] + public DateTime PaymentStartDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 4), Comment("วันสิ้นสุดชำระเงิน")] + public DateTime PaymentEndDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 5), Comment("วันประกาศผลสอบ")] + public DateTime AnnouncementDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 6), Comment("วันเริ่มประกาศ")] + public DateTime AnnouncementStartDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 7), Comment("วันสิ้นสุดประกาศ")] + public DateTime AnnouncementEndDate { get; set; } = DateTime.Now.Date; + + [Required, Comment("วันที่สอบ")] + public DateTime ExamDate { get; set; } = DateTime.Now.Date; + + [Comment("Id รหัสส่วนราชการ")] + public Guid? OrganizationCodeId { get; set; } + + [Comment("ชื่อรหัสส่วนราชการ")] + public string? OrganizationCodeName { get; set; } + + [Comment("Id หน่วยงาน")] + public Guid? OrganizationId { get; set; } + + [Comment("ชื่อหน่วยงาน")] + public string? OrganizationName { get; set; } + + [Comment("ชำระเงินผ่านกรุงไทย")] + public string? PaymentKrungThai { get; set; } + + [Comment("รายละเอียดสมัครสอบ")] + public string? Detail { get; set; } + + [Comment("หมายเหตุ")] + public string? Note { get; set; } + + [Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Comment("เช็คอัพคะแนน")] + public bool SetSeat { get; set; } = false; + + [Comment("ประกาศนี้มีสมัครสอบคัดเลือก")] + public bool AnnouncementExam { get; set; } = false; + + [Comment("สำนัก")] + public string? Category { get; set; } + + [Comment("รายชื่อคนสม้ครในรอบ")] + public List Candidate { get; set; } = new List(); + + [Comment("ตำแหน่งสมัคร")] + public List PositionExam { get; set; } = new List(); + + [Comment("ช่องทางชำระเงิน")] + public List BankExam { get; set; } = new List(); + + [Comment("เอกสารอื่นๆ")] + public virtual List PeriodExamDocuments { get; set; } = new(); + + [Comment("รูป")] + public virtual List PeriodExamImages { get; set; } = new(); + public Document? ImportFile { get; set; } = new Document(); + public List Disables { get; set; } = new List(); + public ScoreImport? ScoreImport { get; set; } + public List ImportHostories { get; set; } = new List(); + } +} diff --git a/Models/Exam/PeriodExamDocument.cs b/Models/Exam/PeriodExamDocument.cs new file mode 100644 index 0000000..c3e817d --- /dev/null +++ b/Models/Exam/PeriodExamDocument.cs @@ -0,0 +1,14 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class PeriodExamDocument : EntityBase + { + [Required, Comment("Id รอบสมัครสอบ")] + public virtual PeriodExam? PeriodExam { get; set; } + [Required, Comment("Id ไฟล์เอกสาร")] + public virtual Document? Document { get; set; } + } +} diff --git a/Models/Exam/PeriodExamImage.cs b/Models/Exam/PeriodExamImage.cs new file mode 100644 index 0000000..4403ec8 --- /dev/null +++ b/Models/Exam/PeriodExamImage.cs @@ -0,0 +1,14 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class PeriodExamImage : EntityBase + { + [Required, Comment("Id รอบสมัครสอบ")] + public virtual PeriodExam? PeriodExam { get; set; } + [Required, Comment("Id ไฟล์รูป")] + public virtual Document? Document { get; set; } + } +} diff --git a/Models/Exam/PositionExam.cs b/Models/Exam/PositionExam.cs new file mode 100644 index 0000000..486dad8 --- /dev/null +++ b/Models/Exam/PositionExam.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Recurit.Exam.Service.Models +{ + public class PositionExam : EntityBase + { + [Required, Comment("Id การสอบ")] + public virtual PeriodExam? PeriodExam { get; set; } + + [Comment("Id ตำแหน่ง")] + public Guid? PositionId { get; set; } + + [Comment("ชื่อตำแหน่ง")] + public string? PositionName { get; set; } + + [Comment("Id ประเภทแบบฟอร์ม")] + public string? TypeId { get; set; } + + [Comment("ชื่อประเภทแบบฟอร์ม")] + public string? TypeName { get; set; } + } +} diff --git a/Models/Exam/Prefix.cs b/Models/Exam/Prefix.cs new file mode 100644 index 0000000..91cf8ce --- /dev/null +++ b/Models/Exam/Prefix.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +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; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/Exam/Province.cs b/Models/Exam/Province.cs new file mode 100644 index 0000000..aea5c64 --- /dev/null +++ b/Models/Exam/Province.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +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; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual List Districts { get; set; } = new(); + } +} diff --git a/Models/Exam/Relationship.cs b/Models/Exam/Relationship.cs new file mode 100644 index 0000000..dae82d2 --- /dev/null +++ b/Models/Exam/Relationship.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +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; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; +} \ No newline at end of file diff --git a/Models/Exam/Religion.cs b/Models/Exam/Religion.cs new file mode 100644 index 0000000..ae493ec --- /dev/null +++ b/Models/Exam/Religion.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +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; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/Exam/SubDistrict.cs b/Models/Exam/SubDistrict.cs new file mode 100644 index 0000000..d01c634 --- /dev/null +++ b/Models/Exam/SubDistrict.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +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; + + [Required, MaxLength(10), Column(Order = 2), Comment("รหัสไปรษณีย์")] + public string ZipCode { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual District? District { get; set; } + } +} diff --git a/Models/HR/Profile.cs b/Models/HR/Profile.cs new file mode 100644 index 0000000..8447557 --- /dev/null +++ b/Models/HR/Profile.cs @@ -0,0 +1,264 @@ +using BMA.EHR.MetaData.Service.Models; +using BMA.EHR.Recruit.Service.Models.Documents; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class Profile : EntityBase + { + [Key] + public Guid Id { get; set; } + + [MaxLength(13)] + public string? CitizenId { get; set; } + + [MaxLength(50)] + public string? ProfileType { get; set; } + + [MaxLength(20)] + public string? EmployeeType { get; set; } + + [MaxLength(20)] + public string? EmployeeClass { get; set; } + + public Guid? PrefixId { get; set; } + + [MaxLength(100)] + [Required] + public string? FirstName { get; set; } + + [MaxLength(100)] + [Required] + public string? LastName { get; set; } + + [MaxLength(100)] + public string AvatarRef { get; set; } + + public Guid? GenderId { get; set; } + + [MaxLength(100)] + public string? Nationality { get; set; } + + [MaxLength(100)] + public string? Race { get; set; } + + public Guid? ReligionId { get; set; } + + [Required] + public DateTime BirthDate { get; set; } + + public Guid? BloodGroupId { get; set; } + + public Guid? RelationshipId { get; set; } + + [MaxLength(50)] + public string? TelephoneNumber { get; set; } + + public bool? Couple { get; set; } + + public Guid? CouplePrefixId { get; set; } + + [MaxLength(100)] + public string? CoupleFirstName { get; set; } + + [MaxLength(100)] + public string? CoupleLastName { get; set; } + + [MaxLength(100)] + public string? CoupleCareer { get; set; } + + public Guid? FatherPrefixId { get; set; } + + [MaxLength(100)] + public string? FatherFirstName { get; set; } + + [MaxLength(100)] + public string? FatherLastName { get; set; } + + [MaxLength(100)] + public string? FatherCareer { get; set; } + + public Guid? MotherPrefixId { get; set; } + + [MaxLength(100)] + public string? MotherFirstName { get; set; } + + [MaxLength(100)] + public string? MotherLastName { get; set; } + + [MaxLength(100)] + public string? MotherCareer { get; set; } + + [MaxLength(200)] + public string? CurrentAddress { get; set; } + + public Guid? CurrentSubDistrictId { get; set; } + + public Guid? CurrentDistrictId { get; set; } + + public Guid? CurrentProvinceId { get; set; } + + [MaxLength(5)] + public string? CurrentZipCode { get; set; } + + public bool? RegistrationSame { get; set; } = false; + + [MaxLength(200)] + public string? RegistrationAddress { get; set; } + + public Guid? RegistrationSubDistrictId { get; set; } + + public Guid? RegistrationDistrictId { get; set; } + + public Guid? RegistrationProvinceId { get; set; } + + [MaxLength(5)] + public string? RegistrationZipCode { get; set; } + + public DateTime? DateAppoint { get; set; } + + public DateTime? DateStart { get; set; } + + public DateTime? DateRetire { get; set; } + + public string? ReasonSameDate { get; set; } + // public Guid? AffiliationId { get; set; } + // public Guid? PositionId { get; set; } + // public Guid? WorkId { get; set; } + // public Guid? TypeId { get; set; } + // public Guid? LevelId { get; set; } + // public Guid? NumberId { get; set; } + // public Guid? BusinessId { get; set; } + public Guid? OcId { get; set; } + public string? Oc { get; set; } + public Guid? OrganizationShortNameId { get; set; } + public string? OrganizationShortName { get; set; } + public string? GovernmentCode { get; set; } + public Guid? OrganizationOrganizationId { get; set; } + public string? OrganizationOrganization { get; set; } + public Guid? PositionId { get; set; } + public string? Position { get; set; } + public Guid? PosNoId { get; set; } + public string? PosNo { get; set; } + public Guid? PositionLineId { get; set; } + public string? PositionLine { get; set; } + public Guid? PositionPathSideId { get; set; } + public string? PositionPathSide { get; set; } + public Guid? PositionTypeId { get; set; } + public string? PositionType { get; set; } + public Guid? PositionLevelId { get; set; } + public string? PositionLevel { get; set; } + public Guid? PositionExecutiveId { get; set; } + public string? PositionExecutive { get; set; } + public Guid? PositionExecutiveSideId { get; set; } + public string? PositionExecutiveSide { get; set; } + + + [MaxLength(100)] + public string Physical { get; set; } + + [MaxLength(100)] + public string Ability { get; set; } + + public bool IsActive { get; set; } = true; + + public bool IsLeave { get; set; } = false; + + public DateTime? LeaveDate { get; set; } + + [MaxLength(1000)] + public string? LeaveReason { get; set; } + + public DateTime? CreatedDate { get; set; } + + public DateTime? ModifiedDate { get; set; } + + [MaxLength(250)] + public string CreatedUser { get; set; } = string.Empty; + + [MaxLength(5)] + public string EntryStatus { get; set; } = "st1"; // สถานะการตรวจสอบ st1 = create; st2 = pending + + public bool IsTransfer { get; set; } = false; + + public DateTime? TransferDate { get; set; } + + public int GovAgeAbsent { get; set; } = 0; + + public int GovAgePlus { get; set; } = 0; + + // public OrganizationEntity? Organization { get; set; } + + // public PositionNumberEntity PositionNumber { get; set; } + + // public Position Position { get; set; } + + // public PositionExecutive PositionExecutive { get; set; } + + public bool IsVerified { get; set; } = false; + + [MaxLength(100)] + public string VerifiedUser { get; set; } = string.Empty; + + public DateTime? VerifiedDate { get; set; } + + public Document? Avatar { get; set; } + + public bool IsProbation { get; set; } = true; + + // public PositionType PositionType { get; set; } // ประเภทตำแหน่ง + + // public PositionLevel PositionLevel { get; set; } // ระดับ + + // public OrganizationPositionEntity? OrganizationPosition { get; set; } + + public virtual List Educations { get; set; } = new List(); + + public virtual List Honors { get; set; } = new List(); + public virtual List Assessments { get; set; } = new List(); + + public virtual List Disciplines { get; set; } = new List(); + + public virtual List Certificates { get; set; } = new List(); + + public virtual List Trainings { get; set; } = new List(); + + public virtual List Insignias { get; set; } = new List(); + + public virtual List Salaries { get; set; } = new List(); + + public virtual List ProfileHistory { get; set; } = new List(); + + public virtual List CoupleHistory { get; set; } = new List(); + + public virtual List FatherHistory { get; set; } = new List(); + + public virtual List MotherHistory { get; set; } = new List(); + + public virtual List FamilyHistory { get; set; } = new List(); + + public virtual List GovernmentHistory { get; set; } = new List(); + + public virtual List Leaves { get; set; } = new List(); + + public virtual List CurrentAddressHistory { get; set; } = new List(); + + public virtual List RegistrationAddressHistory { get; set; } = new List(); + + public virtual List AddressHistory { get; set; } = new List(); + + public virtual List Others { get; set; } = new List(); + + public virtual List Abilitys { get; set; } = new List(); + + public virtual List Dutys { get; set; } = new List(); + + public virtual List Nopaids { get; set; } = new List(); + + public virtual List AvatarHistory { get; set; } = new List(); + + public virtual List Papers { get; set; } = new List(); + + public virtual List Childrens { get; set; } = new List(); + } +} diff --git a/Models/HR/ProfileAbility.cs b/Models/HR/ProfileAbility.cs new file mode 100644 index 0000000..30fae62 --- /dev/null +++ b/Models/HR/ProfileAbility.cs @@ -0,0 +1,44 @@ +using BMA.EHR.Report.Service.Models; +using System; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAbility : EntityBase + { + /// + /// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ) + /// + public string? Field { get; set; } + + /// + /// รายละเอียด + /// + public string? Detail { get; set; } + + /// + /// หมายเหตุ + /// + public string? Remark { get; set; } + + /// + /// วันที่เริ่มต้น + /// + public DateTime? DateStart { get; set; } + + /// + /// วันที่สิ้นสุด + /// + public DateTime? DateEnd { get; set; } + + /// + /// เอกสารอ้างอิง + /// + public string? Reference { get; set; } + // public string? Side { get; set; } + // public string? Detail { get; set; } + // public string? Note { get; set; } + public virtual List ProfileAbilityHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} \ No newline at end of file diff --git a/Models/HR/ProfileAbilityHistory.cs b/Models/HR/ProfileAbilityHistory.cs new file mode 100644 index 0000000..7897dea --- /dev/null +++ b/Models/HR/ProfileAbilityHistory.cs @@ -0,0 +1,43 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAbilityHistory : EntityBase + { + /// + /// ด้าน (ใช้เฉพาะ ความสามารถพิเศษ) + /// + public string? Field { get; set; } + + /// + /// รายละเอียด + /// + public string? Detail { get; set; } + + /// + /// หมายเหตุ + /// + public string? Remark { get; set; } + + /// + /// วันที่เริ่มต้น + /// + public DateTime? DateStart { get; set; } + + /// + /// วันที่สิ้นสุด + /// + public DateTime? DateEnd { get; set; } + + /// + /// เอกสารอ้างอิง + /// + public string? Reference { get; set; } + // public string? Side { get; set; } + // public string? Detail { get; set; } + // public string? Note { get; set; } + public virtual ProfileAbility? ProfileAbility { get; set; } + } +} \ No newline at end of file diff --git a/Models/HR/ProfileAddressHistory.cs b/Models/HR/ProfileAddressHistory.cs new file mode 100644 index 0000000..a833e76 --- /dev/null +++ b/Models/HR/ProfileAddressHistory.cs @@ -0,0 +1,33 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAddressHistory : EntityBase + { + public bool? RegistrationSame { get; set; } + [MaxLength(200)] + public string? RegistrationAddress { get; set; } + public Guid? RegistrationSubDistrictId { get; set; } + public string? RegistrationSubDistrict { get; set; } + public Guid? RegistrationDistrictId { get; set; } + public string? RegistrationDistrict { get; set; } + public Guid? RegistrationProvinceId { get; set; } + public string? RegistrationProvince { get; set; } + [MaxLength(5)] + public string? RegistrationZipCode { get; set; } + [MaxLength(200)] + public string? CurrentAddress { get; set; } + public Guid? CurrentSubDistrictId { get; set; } + public string? CurrentSubDistrict { get; set; } + public Guid? CurrentDistrictId { get; set; } + public string? CurrentDistrict { get; set; } + public Guid? CurrentProvinceId { get; set; } + public string? CurrentProvince { get; set; } + [MaxLength(5)] + public string? CurrentZipCode { get; set; } + public virtual Profile? Profile { get; set; } + } +} + diff --git a/Models/HR/ProfileAssessment.cs b/Models/HR/ProfileAssessment.cs new file mode 100644 index 0000000..0674b80 --- /dev/null +++ b/Models/HR/ProfileAssessment.cs @@ -0,0 +1,15 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAssessment : EntityBase + { + public string? Name { get; set; } + public DateTime? Date { get; set; } + public double? Point { get; set; } + public virtual List ProfileAssessmentHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileAssessmentHistory.cs b/Models/HR/ProfileAssessmentHistory.cs new file mode 100644 index 0000000..177f9ca --- /dev/null +++ b/Models/HR/ProfileAssessmentHistory.cs @@ -0,0 +1,14 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAssessmentHistory : EntityBase + { + public string? Name { get; set; } + public DateTime? Date { get; set; } + public double? Point { get; set; } + public virtual ProfileAssessment? ProfileAssessment { get; set; } + } +} diff --git a/Models/HR/ProfileAvatarHistory.cs b/Models/HR/ProfileAvatarHistory.cs new file mode 100644 index 0000000..67f665c --- /dev/null +++ b/Models/HR/ProfileAvatarHistory.cs @@ -0,0 +1,18 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using BMA.EHR.Report.Service.Models; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileAvatarHistory : EntityBase + { + // [Key] + // public int Id { get; set; } + + // public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Document AvatarFile { get; set; } + + public Profile Profile { get; set; } + } +} diff --git a/Models/HR/ProfileCertificate.cs b/Models/HR/ProfileCertificate.cs new file mode 100644 index 0000000..70ae3b4 --- /dev/null +++ b/Models/HR/ProfileCertificate.cs @@ -0,0 +1,28 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCertificate : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + [MaxLength(20)] + public string? CertificateNo { get; set; } + [MaxLength(200)] + public string? Issuer { get; set; } + public DateTime? IssueDate { get; set; } + public DateTime? ExpireDate { get; set; } + [MaxLength(100)] + public string? CertificateType { get; set; } + // public string? Name { get; set; } + // public string? CertiNumber { get; set; } + // public DateTime? Start { get; set; } + // public DateTime? End { get; set; } + public virtual List ProfileCertificateHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileCertificateHistory.cs b/Models/HR/ProfileCertificateHistory.cs new file mode 100644 index 0000000..c7bccff --- /dev/null +++ b/Models/HR/ProfileCertificateHistory.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCertificateHistory : EntityBase + { + [MaxLength(20)] + public string? CertificateNo { get; set; } + [MaxLength(200)] + public string? Issuer { get; set; } + public DateTime? IssueDate { get; set; } + public DateTime? ExpireDate { get; set; } + [MaxLength(100)] + public string? CertificateType { get; set; } + // public string? Name { get; set; } + // public string? CertiNumber { get; set; } + // public DateTime? Start { get; set; } + // public DateTime? End { get; set; } + public virtual ProfileCertificate? ProfileCertificate { get; set; } + } +} diff --git a/Models/HR/ProfileChildren.cs b/Models/HR/ProfileChildren.cs new file mode 100644 index 0000000..427d033 --- /dev/null +++ b/Models/HR/ProfileChildren.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileChildren : EntityBase + { + public Guid? ChildrenPrefixId { get; set; } + public string? ChildrenPrefix { get; set; } + public string? ChildrenFirstName { get; set; } + public string? ChildrenLastName { get; set; } + public string? ChildrenCareer { get; set; } + public virtual List ProfileChildrenHistorys { get; set; } = new List(); + public Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileChildrenHistory.cs b/Models/HR/ProfileChildrenHistory.cs new file mode 100644 index 0000000..618bdcf --- /dev/null +++ b/Models/HR/ProfileChildrenHistory.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileChildrenHistory : EntityBase + { + public Guid? ChildrenPrefixId { get; set; } + public string? ChildrenPrefix { get; set; } + public string? ChildrenFirstName { get; set; } + public string? ChildrenLastName { get; set; } + public string? ChildrenCareer { get; set; } + } +} diff --git a/Models/HR/ProfileCoupleHistory.cs b/Models/HR/ProfileCoupleHistory.cs new file mode 100644 index 0000000..01b8a8a --- /dev/null +++ b/Models/HR/ProfileCoupleHistory.cs @@ -0,0 +1,30 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCoupleHistory + { + [Key] + public int Id { get; set; } + + [Required] + [MaxLength(50)] + public string Prefix { get; set; } + + [Required] + [MaxLength(100)] + public string FirstName { get; set; } + + [Required] + [MaxLength(100)] + public string LastName { get; set; } + + [MaxLength(100)] + public string Career { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} diff --git a/Models/HR/ProfileCurrentAddressHistory.cs b/Models/HR/ProfileCurrentAddressHistory.cs new file mode 100644 index 0000000..0effa46 --- /dev/null +++ b/Models/HR/ProfileCurrentAddressHistory.cs @@ -0,0 +1,33 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileCurrentAddressHistory + { + [Key] + public int Id { get; set; } + + [MaxLength(200)] + [Required] + public string Address { get; set; } + + [Required] + public Guid SubDistrictId { get; set; } + + [Required] + public Guid DistrictId { get; set; } + + [Required] + public Guid ProvinceId { get; set; } + + [MaxLength(5)] + [Required] + public string ZipCode { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} + diff --git a/Models/HR/ProfileDiscipline.cs b/Models/HR/ProfileDiscipline.cs new file mode 100644 index 0000000..ac1baff --- /dev/null +++ b/Models/HR/ProfileDiscipline.cs @@ -0,0 +1,28 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDiscipline : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + public string? Level { get; set; } + [Column(TypeName = "text")] + public string? Detail { get; set; } + public string? RefCommandNo { get; set; } + public DateTime? RefCommandDate { get; set; } + public DateTime? Date { get; set; } + // public DateTime? Date { get; set; } + // public string? Status { get; set; } + // public string? Level { get; set; } + // public string? RefNo { get; set; } + // public DateTime? RefDate { get; set; } + public virtual List ProfileDisciplineHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileDisciplineHistory.cs b/Models/HR/ProfileDisciplineHistory.cs new file mode 100644 index 0000000..cd4f965 --- /dev/null +++ b/Models/HR/ProfileDisciplineHistory.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDisciplineHistory : EntityBase + { + public string? Level { get; set; } + [Column(TypeName = "text")] + public string? Detail { get; set; } + public string? RefCommandNo { get; set; } + public DateTime? RefCommandDate { get; set; } + public DateTime? Date { get; set; } + // public DateTime? Date { get; set; } + // public string? Status { get; set; } + // public string? Level { get; set; } + // public string? RefNo { get; set; } + // public DateTime? RefDate { get; set; } + public virtual ProfileDiscipline? ProfileDiscipline { get; set; } + } +} diff --git a/Models/HR/ProfileDuty.cs b/Models/HR/ProfileDuty.cs new file mode 100644 index 0000000..f8f518d --- /dev/null +++ b/Models/HR/ProfileDuty.cs @@ -0,0 +1,16 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDuty : EntityBase + { + public DateTime? DateStart { get; set; } + public DateTime? DateEnd { get; set; } + public string? Detail { get; set; } + public string? Reference { get; set; } + public virtual List ProfileDutyHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} \ No newline at end of file diff --git a/Models/HR/ProfileDutyHistory.cs b/Models/HR/ProfileDutyHistory.cs new file mode 100644 index 0000000..6020a87 --- /dev/null +++ b/Models/HR/ProfileDutyHistory.cs @@ -0,0 +1,15 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileDutyHistory : EntityBase + { + public DateTime? DateStart { get; set; } + public DateTime? DateEnd { get; set; } + public string? Detail { get; set; } + public string? Reference { get; set; } + public virtual ProfileDuty? ProfileDuty { get; set; } + } +} \ No newline at end of file diff --git a/Models/HR/ProfileEducation.cs b/Models/HR/ProfileEducation.cs new file mode 100644 index 0000000..cc93425 --- /dev/null +++ b/Models/HR/ProfileEducation.cs @@ -0,0 +1,44 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.MetaData.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileEducation : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + [MaxLength(1000)] + public string? Institute { get; set; } + [MaxLength(200)] + public string? Degree { get; set; } + [MaxLength(200)] + public string? Field { get; set; } + [MaxLength(20)] + public string? Gpa { get; set; } + [MaxLength(1000)] + public string? Country { get; set; } + [MaxLength(1000)] + public string? Duration { get; set; } + [MaxLength(1000)] + public string? Other { get; set; } + [MaxLength(1000)] + public string? FundName { get; set; } + public int DurationYear { get; set; } + public DateTime? FinishDate { get; set; } + public DateTime? StartDate { get; set; } + public DateTime? EndDate { get; set; } + // public EducationLevel? EducationLevel { get; set; } + public string? EducationLevel { get; set; } + public Guid? EducationLevelId { get; set; } + // public string? Name { get; set; } + // public int? Start { get; set; } + // public int? End { get; set; } + // public string? Education { get; set; } + // public string? Major { get; set; } + public virtual List ProfileEducationHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + + } +} diff --git a/Models/HR/ProfileEducationHistory.cs b/Models/HR/ProfileEducationHistory.cs new file mode 100644 index 0000000..cf6101b --- /dev/null +++ b/Models/HR/ProfileEducationHistory.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.MetaData.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileEducationHistory : EntityBase + { + [MaxLength(1000)] + public string? Institute { get; set; }// + [MaxLength(200)] + public string? Degree { get; set; }// + [MaxLength(200)] + public string? Field { get; set; }// + [MaxLength(20)] + public string? Gpa { get; set; }// + [MaxLength(1000)] + public string? Country { get; set; }// + [MaxLength(1000)] + public string? Duration { get; set; }// + [MaxLength(1000)] + public string? Other { get; set; }// + [MaxLength(1000)] + public string? FundName { get; set; }// + public int DurationYear { get; set; }// + public DateTime? FinishDate { get; set; }// + public DateTime? StartDate { get; set; }// + public DateTime? EndDate { get; set; }// + public string? EducationLevel { get; set; } + public Guid? EducationLevelId { get; set; } + public virtual ProfileEducation? ProfileEducation { get; set; } + } +} diff --git a/Models/HR/ProfileFamilyHistory.cs b/Models/HR/ProfileFamilyHistory.cs new file mode 100644 index 0000000..43e8863 --- /dev/null +++ b/Models/HR/ProfileFamilyHistory.cs @@ -0,0 +1,32 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileFamilyHistory : EntityBase + { + public bool? Couple { get; set; } + + public Guid? CouplePrefixId { get; set; } + public string? CouplePrefix { get; set; } + public string? CoupleFirstName { get; set; } + public string? CoupleLastName { get; set; } + public string? CoupleCareer { get; set; } + + public Guid? FatherPrefixId { get; set; } + public string? FatherPrefix { get; set; } + public string? FatherFirstName { get; set; } + public string? FatherLastName { get; set; } + public string? FatherCareer { get; set; } + + public Guid? MotherPrefixId { get; set; } + public string? MotherPrefix { get; set; } + public string? MotherFirstName { get; set; } + public string? MotherLastName { get; set; } + public string? MotherCareer { get; set; } + public virtual Profile? Profile { get; set; } + + public virtual List Childrens { get; set; } = new List(); + } +} diff --git a/Models/HR/ProfileFatherHistory.cs b/Models/HR/ProfileFatherHistory.cs new file mode 100644 index 0000000..d29ea92 --- /dev/null +++ b/Models/HR/ProfileFatherHistory.cs @@ -0,0 +1,30 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileFatherHistory + { + [Key] + public int Id { get; set; } + + [Required] + [MaxLength(50)] + public string Prefix { get; set; } + + [Required] + [MaxLength(100)] + public string FirstName { get; set; } + + [Required] + [MaxLength(100)] + public string LastName { get; set; } + + [MaxLength(100)] + public string Career { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} diff --git a/Models/HR/ProfileGovernmentHistory.cs b/Models/HR/ProfileGovernmentHistory.cs new file mode 100644 index 0000000..d5e8472 --- /dev/null +++ b/Models/HR/ProfileGovernmentHistory.cs @@ -0,0 +1,37 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileGovernmentHistory : EntityBase + { + // public Guid? AffiliationId { get; set; } + // public Guid? PositionId { get; set; } + // public Guid? WorkId { get; set; } + // public Guid? TypeId { get; set; } + // public Guid? LevelId { get; set; } + // public Guid? NumberId { get; set; } + // public Guid? BusinessId { get; set; } + public string? ReasonSameDate { get; set; } + public Guid? OcId { get; set; } + public string? Oc { get; set; } + public Guid? PositionId { get; set; } + public string? Position { get; set; } + public Guid? PosNoId { get; set; } + public string? PosNo { get; set; } + public string? PositionLine { get; set; } + // public string? PositionPathSide { get; set; } + public string? PositionType { get; set; } + public string? PositionLevel { get; set; } + public string? PositionExecutive { get; set; } + // public string? PositionExecutiveSide { get; set; } + public DateTime? DateAppoint { get; set; } + public DateTime? DateStart { get; set; } + public string? RetireDate { get; set; } + public string? GovAge { get; set; } + public int? GovAgeAbsent { get; set; } = 0; + public int? GovAgePlus { get; set; } = 0; + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileHistory.cs b/Models/HR/ProfileHistory.cs new file mode 100644 index 0000000..2f2473c --- /dev/null +++ b/Models/HR/ProfileHistory.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileHistory : EntityBase + { + [MaxLength(13)] + public string? CitizenId { get; set; } + public Guid? PrefixId { get; set; } + public string? Prefix { get; set; } + [MaxLength(100)] + [Required] + public string? FirstName { get; set; } + [MaxLength(100)] + [Required] + public string? LastName { get; set; } + public Guid? GenderId { get; set; } + public string? Gender { get; set; } + [MaxLength(100)] + public string? Nationality { get; set; } + [MaxLength(100)] + public string? Race { get; set; } + public Guid? ReligionId { get; set; } + public string? Religion { get; set; } + [Required] + public DateTime BirthDate { get; set; } + public Guid? BloodGroupId { get; set; } + public string? BloodGroup { get; set; } + public Guid? RelationshipId { get; set; } + public string? Relationship { get; set; } + [MaxLength(50)] + public string? TelephoneNumber { get; set; } + [MaxLength(20)] + public string? EmployeeType { get; set; } + [MaxLength(20)] + public string? EmployeeClass { get; set; } + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileHonor.cs b/Models/HR/ProfileHonor.cs new file mode 100644 index 0000000..7bf556a --- /dev/null +++ b/Models/HR/ProfileHonor.cs @@ -0,0 +1,28 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileHonor : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + // [MaxLength(20)] + // public string? No { get; set; } + [MaxLength(200)] + public string? Issuer { get; set; } + [MaxLength(2000)] + public string? Detail { get; set; } + public DateTime? IssueDate { get; set; } + + // public DateTime? ReceiveDate { get; set; } + // public string? Detail { get; set; } + // public Guid? OrganizationOrganizationId { get; set; } + // public string? OrganizationOrganization { get; set; } + public virtual List ProfileHonorHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileHonorHistory.cs b/Models/HR/ProfileHonorHistory.cs new file mode 100644 index 0000000..ab6f92b --- /dev/null +++ b/Models/HR/ProfileHonorHistory.cs @@ -0,0 +1,21 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileHonorHistory : EntityBase + { + [MaxLength(200)] + public string? Issuer { get; set; } + [MaxLength(2000)] + public string? Detail { get; set; } + public DateTime? IssueDate { get; set; } + + // public DateTime? ReceiveDate { get; set; } + // public string? Detail { get; set; } + // public Guid? OrganizationOrganizationId { get; set; } + // public string? OrganizationOrganization { get; set; } + public virtual ProfileHonor? ProfileHonor { get; set; } + } +} diff --git a/Models/HR/ProfileInsignia.cs b/Models/HR/ProfileInsignia.cs new file mode 100644 index 0000000..47aa18a --- /dev/null +++ b/Models/HR/ProfileInsignia.cs @@ -0,0 +1,50 @@ +using BMA.EHR.MetaData.Service.Models; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileInsignia : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + // public Insignia Insignia { get; set; } + // public DateTime DateReceive { get; set; } + public int Year { get; set; } + // [MaxLength(300)] + // public string? Level { get; set; } + [MaxLength(20)] + public string? No { get; set; } + [MaxLength(300)] + public string? Issue { get; set; } + [MaxLength(30)] + public string? VolumeNo { get; set; } + [MaxLength(30)] + public string? Volume { get; set; } + [MaxLength(30)] + public string? Section { get; set; } + [MaxLength(30)] + public string? Page { get; set; } + // public DateTime? DateStamp { get; set; } + public DateTime? DateAnnounce { get; set; } + // public DateTime? EndDate { get; set; } + + + // public int? Year { get; set; } + public DateTime? ReceiveDate { get; set; } + public string? InsigniaType { get; set; } + // public InsigniaType? InsigniaType { get; set; } + public string? Insignia { get; set; } + public Guid? InsigniaId { get; set; } + // public Insignia? Insignia { get; set; } + // public string? No { get; set; } + // public string? GazetteNo { get; set; } + // public string? Volume { get; set; } + // public string? Book { get; set; } + // public string? Section { get; set; } + // public string? Page { get; set; } + public virtual List ProfileInsigniaHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileInsigniaHistory.cs b/Models/HR/ProfileInsigniaHistory.cs new file mode 100644 index 0000000..6d94f6e --- /dev/null +++ b/Models/HR/ProfileInsigniaHistory.cs @@ -0,0 +1,40 @@ +using BMA.EHR.MetaData.Service.Models; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileInsigniaHistory : EntityBase + { + public int Year { get; set; } + // [MaxLength(300)] + // public string? Level { get; set; } + [MaxLength(20)] + public string? No { get; set; } + [MaxLength(300)] + public string? Issue { get; set; } + [MaxLength(30)] + public string? VolumeNo { get; set; } + [MaxLength(30)] + public string? Volume { get; set; } + [MaxLength(30)] + public string? Section { get; set; } + [MaxLength(30)] + public string? Page { get; set; } + // public DateTime? DateStamp { get; set; } + public DateTime? DateAnnounce { get; set; } + // public DateTime? EndDate { get; set; } + + // public int? Year { get; set; } + public DateTime? ReceiveDate { get; set; } + public string? InsigniaType { get; set; } + public string? Insignia { get; set; } + public Guid? InsigniaId { get; set; } + // public string? No { get; set; } + // public string? GazetteNo { get; set; } + // public string? Volume { get; set; } + // public string? Book { get; set; } + // public string? Section { get; set; } + // public string? Page { get; set; } + public virtual ProfileInsignia? ProfileInsignia { get; set; } + } +} diff --git a/Models/HR/ProfileLeave.cs b/Models/HR/ProfileLeave.cs new file mode 100644 index 0000000..64dd91d --- /dev/null +++ b/Models/HR/ProfileLeave.cs @@ -0,0 +1,58 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileLeave : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + public int Year { get; set; } + public double? RestCount { get; set; } + public double? RestDay { get; set; } + public double? SickCount { get; set; } + public double? SickDay { get; set; } + public double? AbsentCount { get; set; } + public double? AbsentDay { get; set; } + public double? LateCount { get; set; } + public double? LateDay { get; set; } + public double? OtherCount { get; set; } + public double? OtherDay { get; set; } + public double? PersonalCount { get; set; } + public double? PersonalDay { get; set; } + public double? MaternityCount { get; set; } + public double? MaternityDay { get; set; } + public double? WifeCount { get; set; } + public double? WifeDay { get; set; } + public double? OrdainCount { get; set; } + public double? OrdainDay { get; set; } + public double? MilitaryCount { get; set; } + public double? MilitaryDay { get; set; } + public double? StudyCount { get; set; } + public double? StudyDay { get; set; } + public double? AgencyCount { get; set; } + public double? AgencyDay { get; set; } + public double? CoupleCount { get; set; } + public double? CoupleDay { get; set; } + public double? TherapyCount { get; set; } + public double? TherapyDay { get; set; } + // public int? Year { get; set; } + // public double? Holiday { get; set; } + // public double? Sick { get; set; } + // public double? Government { get; set; } + // public double? Late { get; set; } + // public double? Other { get; set; } + // public double? Business { get; set; } + // public double? Maternity { get; set; } + // public double? HelpMaternity { get; set; } + // public double? Ordination { get; set; } + // public double? Study { get; set; } + // public double? International { get; set; } + // public double? Spouse { get; set; } + // public double? Rehabilitation { get; set; } + public virtual List ProfileLeaveHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileLeaveHistory.cs b/Models/HR/ProfileLeaveHistory.cs new file mode 100644 index 0000000..018ce42 --- /dev/null +++ b/Models/HR/ProfileLeaveHistory.cs @@ -0,0 +1,53 @@ +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileLeaveHistory : EntityBase + { + public int Year { get; set; } + public double? RestCount { get; set; } + public double? RestDay { get; set; } + public double? SickCount { get; set; } + public double? SickDay { get; set; } + public double? AbsentCount { get; set; } + public double? AbsentDay { get; set; } + public double? LateCount { get; set; } + public double? LateDay { get; set; } + public double? OtherCount { get; set; } + public double? OtherDay { get; set; } + public double? PersonalCount { get; set; } + public double? PersonalDay { get; set; } + public double? MaternityCount { get; set; } + public double? MaternityDay { get; set; } + public double? WifeCount { get; set; } + public double? WifeDay { get; set; } + public double? OrdainCount { get; set; } + public double? OrdainDay { get; set; } + public double? MilitaryCount { get; set; } + public double? MilitaryDay { get; set; } + public double? StudyCount { get; set; } + public double? StudyDay { get; set; } + public double? AgencyCount { get; set; } + public double? AgencyDay { get; set; } + public double? CoupleCount { get; set; } + public double? CoupleDay { get; set; } + public double? TherapyCount { get; set; } + public double? TherapyDay { get; set; } + // public int? Year { get; set; } + // public double? Holiday { get; set; } + // public double? Sick { get; set; } + // public double? Government { get; set; } + // public double? Late { get; set; } + // public double? Other { get; set; } + // public double? Business { get; set; } + // public double? Maternity { get; set; } + // public double? HelpMaternity { get; set; } + // public double? Ordination { get; set; } + // public double? Study { get; set; } + // public double? International { get; set; } + // public double? Spouse { get; set; } + // public double? Rehabilitation { get; set; } + public virtual ProfileLeave? ProfileLeave { get; set; } + } +} diff --git a/Models/HR/ProfileMotherHistory.cs b/Models/HR/ProfileMotherHistory.cs new file mode 100644 index 0000000..fedac87 --- /dev/null +++ b/Models/HR/ProfileMotherHistory.cs @@ -0,0 +1,30 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileMotherHistory + { + [Key] + public int Id { get; set; } + + [Required] + [MaxLength(50)] + public string Prefix { get; set; } + + [Required] + [MaxLength(100)] + public string FirstName { get; set; } + + [Required] + [MaxLength(100)] + public string LastName { get; set; } + + [MaxLength(100)] + public string Career { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} diff --git a/Models/HR/ProfileNopaid.cs b/Models/HR/ProfileNopaid.cs new file mode 100644 index 0000000..3818024 --- /dev/null +++ b/Models/HR/ProfileNopaid.cs @@ -0,0 +1,26 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileNopaid : EntityBase + { + // [Key] + // public int Id { get; set; } + // [Required] + // public int Order { get; set; } + // [MaxLength(20)] + // public string No { get; set; } + // [MaxLength(200)] + // public string Issuer { get; set; } + // [MaxLength(2000)] + // public string Detail { get; set; } + // public DateTime IssueDate { get; set; } + public DateTime? Date { get; set; } + public string? Detail { get; set; } + public string? Reference { get; set; } + public virtual List ProfileNopaidHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileNopaidHistory.cs b/Models/HR/ProfileNopaidHistory.cs new file mode 100644 index 0000000..0327c1d --- /dev/null +++ b/Models/HR/ProfileNopaidHistory.cs @@ -0,0 +1,14 @@ +using System; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileNopaidHistory : EntityBase + { + public DateTime? Date { get; set; } + public string? Detail { get; set; } + public string? Reference { get; set; } + public virtual ProfileNopaid? ProfileNopaid { get; set; } + } +} diff --git a/Models/HR/ProfileOther.cs b/Models/HR/ProfileOther.cs new file mode 100644 index 0000000..3842cfa --- /dev/null +++ b/Models/HR/ProfileOther.cs @@ -0,0 +1,15 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileOther : EntityBase + { + public DateTime? Date { get; set; } + public string? Detail { get; set; } + public virtual List ProfileOtherHistorys { get; set; } = new List(); + public Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileOtherHistory.cs b/Models/HR/ProfileOtherHistory.cs new file mode 100644 index 0000000..433135c --- /dev/null +++ b/Models/HR/ProfileOtherHistory.cs @@ -0,0 +1,14 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileOtherHistory : EntityBase + { + public DateTime? Date { get; set; } + public string? Detail { get; set; } + public ProfileOther? ProfileOther { get; set; } + } +} diff --git a/Models/HR/ProfilePaper.cs b/Models/HR/ProfilePaper.cs new file mode 100644 index 0000000..fc17eb0 --- /dev/null +++ b/Models/HR/ProfilePaper.cs @@ -0,0 +1,18 @@ +using BMA.EHR.Recruit.Service.Models.Documents; +using System.ComponentModel.DataAnnotations; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfilePaper : EntityBase + { + // [Key] + // public int Id { get; set; } + [Required, MaxLength(255)] + public string? Detail { get; set; } + [Required, MaxLength(255)] + public string? CategoryName { get; set; } + public Document Document { get; set; } + public virtual Profile Profile { get; set; } + } +} diff --git a/Models/HR/ProfileRegistrationAddressHistory.cs b/Models/HR/ProfileRegistrationAddressHistory.cs new file mode 100644 index 0000000..eaf81cc --- /dev/null +++ b/Models/HR/ProfileRegistrationAddressHistory.cs @@ -0,0 +1,33 @@ +using System; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileRegistrationAddressHistory + { + [Key] + public int Id { get; set; } + + [MaxLength(200)] + [Required] + public string Address { get; set; } + + [Required] + public Guid SubDistrictId { get; set; } + + [Required] + public Guid DistrictId { get; set; } + + [Required] + public Guid ProvinceId { get; set; } + + [MaxLength(5)] + [Required] + public string ZipCode { get; set; } + + public DateTime CreatedDate { get; set; } = DateTime.Now; + + public Profile Profile { get; set; } + } +} + diff --git a/Models/HR/ProfileSalary.cs b/Models/HR/ProfileSalary.cs new file mode 100644 index 0000000..253bb8b --- /dev/null +++ b/Models/HR/ProfileSalary.cs @@ -0,0 +1,25 @@ +using BMA.EHR.MetaData.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalary : EntityBase + { + public DateTime? Date { get; set; } + public double? Amount { get; set; } + public double? PositionSalaryAmount { get; set; } + public Guid? OcId { get; set; } + public Guid? OrganizationShortNameId { get; set; } + public Guid? PositionId { get; set; } + public Guid? PosNoId { get; set; } + public Guid? PositionLineId { get; set; } + public Guid? PositionPathSideId { get; set; } + public Guid? PositionTypeId { get; set; } + public Guid? PositionLevelId { get; set; } + public Guid? PositionExecutiveId { get; set; } + public Guid? PositionExecutiveSideId { get; set; } + public string? SalaryClass { get; set; } + public string? SalaryRef { get; set; } + public virtual List ProfileSalaryHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileSalaryHistory.cs b/Models/HR/ProfileSalaryHistory.cs new file mode 100644 index 0000000..796af6d --- /dev/null +++ b/Models/HR/ProfileSalaryHistory.cs @@ -0,0 +1,34 @@ +using BMA.EHR.MetaData.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryHistory : EntityBase + { + public DateTime? Date { get; set; } + public double? Amount { get; set; } + public double? PositionSalaryAmount { get; set; } + public Guid? OcId { get; set; } + public string? Oc { get; set; } + public Guid? OrganizationShortNameId { get; set; } + public string? OrganizationShortName { get; set; } + public Guid? PositionId { get; set; } + public string? Position { get; set; } + public Guid? PosNoId { get; set; } + public string? PosNo { get; set; } + public Guid? PositionLineId { get; set; } + public string? PositionLine { get; set; } + public Guid? PositionPathSideId { get; set; } + public string? PositionPathSide { get; set; } + public Guid? PositionTypeId { get; set; } + public string? PositionType { get; set; } + public Guid? PositionLevelId { get; set; } + public string? PositionLevel { get; set; } + public Guid? PositionExecutiveId { get; set; } + public string? PositionExecutive { get; set; } + public Guid? PositionExecutiveSideId { get; set; } + public string? PositionExecutiveSide { get; set; } + public string? SalaryClass { get; set; } + public string? SalaryRef { get; set; } + public virtual ProfileSalary? ProfileSalary { get; set; } + } +} diff --git a/Models/HR/ProfileSalaryOrganization.cs b/Models/HR/ProfileSalaryOrganization.cs new file mode 100644 index 0000000..5b02328 --- /dev/null +++ b/Models/HR/ProfileSalaryOrganization.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Profile.Service.Models; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryOrganization + { + [ForeignKey("ProfileSalary")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public OrganizationEntity Organization { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} diff --git a/Models/HR/ProfileSalaryPosition.cs b/Models/HR/ProfileSalaryPosition.cs new file mode 100644 index 0000000..0312204 --- /dev/null +++ b/Models/HR/ProfileSalaryPosition.cs @@ -0,0 +1,19 @@ +using BMA.EHR.MetaData.Service.Models; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPosition + { + [ForeignKey("ProfileSalary")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + public Position Position { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} diff --git a/Models/HR/ProfileSalaryPositionLevel.cs b/Models/HR/ProfileSalaryPositionLevel.cs new file mode 100644 index 0000000..2fae436 --- /dev/null +++ b/Models/HR/ProfileSalaryPositionLevel.cs @@ -0,0 +1,20 @@ +using BMA.EHR.MetaData.Service.Models; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPositionLevel + { + [ForeignKey("ProfileSalary")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public PositionLevel PositionLevel { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} + diff --git a/Models/HR/ProfileSalaryPositionNumber.cs b/Models/HR/ProfileSalaryPositionNumber.cs new file mode 100644 index 0000000..6e93f54 --- /dev/null +++ b/Models/HR/ProfileSalaryPositionNumber.cs @@ -0,0 +1,19 @@ +using BMA.EHR.Profile.Service.Models; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPositionNumber + { + [ForeignKey("ProfileSalary")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public PositionNumberEntity PositionNumber { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + } +} diff --git a/Models/HR/ProfileSalaryPositionType.cs b/Models/HR/ProfileSalaryPositionType.cs new file mode 100644 index 0000000..d7b0daa --- /dev/null +++ b/Models/HR/ProfileSalaryPositionType.cs @@ -0,0 +1,22 @@ +using BMA.EHR.MetaData.Service.Models; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileSalaryPositionType + { + + [ForeignKey("ProfileSalary")] + public int Id { get; set; } + + [MaxLength(200)] + public string Comment { get; set; } + + // public PositionType PositionType { get; set; } + + // public ProfileSalary ProfileSalary { get; set; } + + } +} + diff --git a/Models/HR/ProfileTraining.cs b/Models/HR/ProfileTraining.cs new file mode 100644 index 0000000..adbcad2 --- /dev/null +++ b/Models/HR/ProfileTraining.cs @@ -0,0 +1,34 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileTraining : EntityBase + { + [MaxLength(100)] + public string? Subject { get; set; } + [Column(TypeName = "text")] + public string? Detail { get; set; } + [MaxLength(200)] + public string? Host { get; set; } + [MaxLength(200)] + public string? ClassName { get; set; } + [MaxLength(200)] + public string? Place { get; set; } + [MaxLength(50)] + public string? Reference { get; set; } + public DateTime? StartDate { get; set; } + public DateTime? EndDate { get; set; } + // public string? Course { get; set; } + // public DateTime? Start { get; set; } + // public DateTime? End { get; set; } + // public string? Location { get; set; } + // public string? Detail { get; set; } + // public string? Organize { get; set; } + // public string? Gen { get; set; } + public virtual List ProfileTrainingHistorys { get; set; } = new List(); + public virtual Profile? Profile { get; set; } + } +} diff --git a/Models/HR/ProfileTrainingHistory.cs b/Models/HR/ProfileTrainingHistory.cs new file mode 100644 index 0000000..171428d --- /dev/null +++ b/Models/HR/ProfileTrainingHistory.cs @@ -0,0 +1,33 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models.HR +{ + public class ProfileTrainingHistory : EntityBase + { + [MaxLength(100)] + public string? Subject { get; set; } + [Column(TypeName = "text")] + public string? Detail { get; set; } + [MaxLength(200)] + public string? Host { get; set; } + [MaxLength(200)] + public string? ClassName { get; set; } + [MaxLength(200)] + public string? Place { get; set; } + [MaxLength(50)] + public string? Reference { get; set; } + public DateTime? StartDate { get; set; } + public DateTime? EndDate { get; set; } + // public string? Course { get; set; } + // public DateTime? Start { get; set; } + // public DateTime? End { get; set; } + // public string? Location { get; set; } + // public string? Detail { get; set; } + // public string? Organize { get; set; } + // public string? Gen { get; set; } + public virtual ProfileTraining? ProfileTraining { get; set; } + } +} diff --git a/Models/MetaData/BloodGroup.cs b/Models/MetaData/BloodGroup.cs new file mode 100644 index 0000000..29ad2d1 --- /dev/null +++ b/Models/MetaData/BloodGroup.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class BloodGroup : EntityBase + { + [Required, MaxLength(2), Column(Order = 1), Comment("ชื่อหมู่โลหิต")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/District.cs b/Models/MetaData/District.cs new file mode 100644 index 0000000..a99b70b --- /dev/null +++ b/Models/MetaData/District.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Asn1.X509; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class District : EntityBase + { + [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual List SubDistricts { get; set; } = new(); + + public virtual Province? Province { get; set; } + } +} diff --git a/Models/MetaData/EducationLevel.cs b/Models/MetaData/EducationLevel.cs new file mode 100644 index 0000000..5f45f77 --- /dev/null +++ b/Models/MetaData/EducationLevel.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class EducationLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ระดับการศึกษา")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/EntityBase.cs b/Models/MetaData/EntityBase.cs new file mode 100644 index 0000000..90a39ee --- /dev/null +++ b/Models/MetaData/EntityBase.cs @@ -0,0 +1,32 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text.Json.Serialization; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class EntityBase + { + [Key, Column(Order = 0), Comment("PrimaryKey")] + [JsonPropertyName("id")] + public Guid Id { get; set; } + + [Required, Column(Order = 100), Comment("สร้างข้อมูลเมื่อ")] + public DateTime CreatedAt { get; set; } = DateTime.Now; + + [Column(Order = 101), Comment("User Id ที่สร้างข้อมูล"), MaxLength(40)] + public string CreatedUserId { get; set; } = string.Empty; + + [Column(Order = 102), Comment("แก้ไขข้อมูลล่าสุดเมื่อ")] + public DateTime? LastUpdatedAt { get; set; } + + [Column(Order = 103), Comment("User Id ที่แก้ไขข้อมูลล่าสุด"), MaxLength(40)] + public string LastUpdateUserId { get; set; } = string.Empty; + + [Column(Order = 104), Comment("ชื่อ User ที่สร้างข้อมูล"), MaxLength(200)] + public string CreatedFullName { get; set; } = string.Empty; + + [Column(Order = 105), Comment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด"), MaxLength(200)] + public string LastUpdateFullName { get; set; } = string.Empty; + } +} diff --git a/Models/MetaData/Gendor.cs b/Models/MetaData/Gendor.cs new file mode 100644 index 0000000..31042f0 --- /dev/null +++ b/Models/MetaData/Gendor.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Gender : EntityBase + { + [Required, MaxLength(20), Column(Order = 1), Comment("เพศ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/Holiday.cs b/Models/MetaData/Holiday.cs new file mode 100644 index 0000000..369c359 --- /dev/null +++ b/Models/MetaData/Holiday.cs @@ -0,0 +1,27 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Holiday : EntityBase + { + [Required, Column(Order = 1), Comment("ประจำปี")] + public int Year { get; set; } = 0; + + [Required, Column(Order = 2), Comment("วันหยุด")] + public DateTime HolidayDate { get; set; } = DateTime.Now.Date; + + [Required, Column(Order = 3), Comment("วันหยุด(Original)")] + public DateTime OriginalDate { get; set; } = DateTime.Now.Date; + + [Required, MaxLength(250), Column(Order = 4), Comment("ชื่อวันหยุด")] + public string Name { get; set; } = string.Empty; + + [Required, Column(Order = 5), Comment("เป็นวันหยุดพิเศษหรือไม่")] + public bool IsSpecial { get; set; } = true; + + [Required, Column(Order = 6), Comment("ประเภทของวันหยุดสำหรับ ทำงาน 5 วัน=`NORMAL`,ทำงาน 6 วัน=`6DAYS`")] + public string Category { get; set; } = "NORMAL"; + } +} diff --git a/Models/MetaData/Insignia.cs b/Models/MetaData/Insignia.cs new file mode 100644 index 0000000..b0b905a --- /dev/null +++ b/Models/MetaData/Insignia.cs @@ -0,0 +1,23 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Insignia: EntityBase + { + [Required, MaxLength(50), Column(Order = 1), Comment("ชื่อเครื่องราชย์")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(10), Column(Order = 2), Comment("ชื่อย่อเครื่องราชย์")] + public string ShortName { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + [Column(Order = 4), Comment("ลำดับชั้นของเครื่องราชย์ เอาไว้ตรวจสอบเวลาขอว่าต้องได้ชั้นที่สูงกว่าที่เคยได้รับแล้วเท่านั้น")] + public int Level { get; set; } = 0; + + public virtual InsigniaType? InsigniaType { get; set; } + } +} diff --git a/Models/MetaData/InsigniaType.cs b/Models/MetaData/InsigniaType.cs new file mode 100644 index 0000000..ceba1f1 --- /dev/null +++ b/Models/MetaData/InsigniaType.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Asn1.X509; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class InsigniaType : EntityBase + { + [Required, MaxLength(50), Column(Order = 1), Comment("ชื่อประเภทเครื่องราชย์")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationAgency.cs b/Models/MetaData/OrganizationAgency.cs new file mode 100644 index 0000000..990a5d3 --- /dev/null +++ b/Models/MetaData/OrganizationAgency.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationAgency : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงานต้นสังกัด")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationFax.cs b/Models/MetaData/OrganizationFax.cs new file mode 100644 index 0000000..684dcc6 --- /dev/null +++ b/Models/MetaData/OrganizationFax.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationFax : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์โทรสาร")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationGovernmentAgency.cs b/Models/MetaData/OrganizationGovernmentAgency.cs new file mode 100644 index 0000000..796b4fe --- /dev/null +++ b/Models/MetaData/OrganizationGovernmentAgency.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationGovernmentAgency : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ส่วนราชการต้นสังกัด")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationLevel.cs b/Models/MetaData/OrganizationLevel.cs new file mode 100644 index 0000000..b6c366c --- /dev/null +++ b/Models/MetaData/OrganizationLevel.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ระดับ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationOrganization.cs b/Models/MetaData/OrganizationOrganization.cs new file mode 100644 index 0000000..b82a2aa --- /dev/null +++ b/Models/MetaData/OrganizationOrganization.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationOrganization : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ หน่วยงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationShortName.cs b/Models/MetaData/OrganizationShortName.cs new file mode 100644 index 0000000..59955ac --- /dev/null +++ b/Models/MetaData/OrganizationShortName.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationShortName : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสหน่วยงาน")] + public string AgencyCode { get; set; } = string.Empty; + [Required, MaxLength(100), Column(Order = 2), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ รหัสส่วนราชการ")] + public string GovernmentCode { get; set; } = string.Empty; + [Required, MaxLength(100), Column(Order = 3), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ตัวย่อหน่วยงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 4), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationStatus.cs b/Models/MetaData/OrganizationStatus.cs new file mode 100644 index 0000000..91a8b0d --- /dev/null +++ b/Models/MetaData/OrganizationStatus.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ สถานะ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationTelExternal.cs b/Models/MetaData/OrganizationTelExternal.cs new file mode 100644 index 0000000..237cfb4 --- /dev/null +++ b/Models/MetaData/OrganizationTelExternal.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationTelExternal : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายนอก")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationTelInternal.cs b/Models/MetaData/OrganizationTelInternal.cs new file mode 100644 index 0000000..6db4aa2 --- /dev/null +++ b/Models/MetaData/OrganizationTelInternal.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationTelInternal : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ เบอร์ติดต่อภายใน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/OrganizationType.cs b/Models/MetaData/OrganizationType.cs new file mode 100644 index 0000000..20f0eac --- /dev/null +++ b/Models/MetaData/OrganizationType.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class OrganizationType : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ข้อมูลโครงสร้างหน่วยงานชื่อ ประเภท")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PhysicalStatus.cs b/Models/MetaData/PhysicalStatus.cs new file mode 100644 index 0000000..673206a --- /dev/null +++ b/Models/MetaData/PhysicalStatus.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Asn1.X509; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PhysicalStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("สถานภาพทางกาย")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/Position.cs b/Models/MetaData/Position.cs new file mode 100644 index 0000000..f5bc03d --- /dev/null +++ b/Models/MetaData/Position.cs @@ -0,0 +1,36 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Position : EntityBase + { + [Required, MaxLength(300), Column(Order = 1), Comment("ชื่อตำแหน่งในสายงาน")] + public string Name { get; set; } = string.Empty; + + [MaxLength(300), Column(Order = 2), Comment("ด้านของสายงาน")] + public virtual PositionPathSide? PathSide { get; set; } + + [MaxLength(300), Column(Order = 3), Comment("ชื่อตำแหน่งทางการบริหาร")] + public string ExecutiveName { get; set; } = string.Empty; + + [MaxLength(300), Column(Order = 4), Comment("ด้านทางการบริหาร")] + public virtual PositionExecutiveSide? ExecutiveSide { get; set; } + + [Column(Order = 5), Comment("สายงาน")] + public virtual PositionPath? PositionPath { get; set; } + + [Column(Order = 6), Comment("ตำแหน่งประเภท")] + public virtual PositionType? PositionType { get; set; } + + [Column(Order = 7), Comment("ระดับ")] + public virtual PositionLevel? PositionLevel { get; set; } + + [Column(Order = 8),Comment("ตำแหน่งสำหรับข้าราชการหรือลูกจ้าง officer/employee")] + public string PositionCategory { get; set; } = string.Empty; + + [Column(Order = 9), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionEmployeeGroup.cs b/Models/MetaData/PositionEmployeeGroup.cs new file mode 100644 index 0000000..0f50f06 --- /dev/null +++ b/Models/MetaData/PositionEmployeeGroup.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionEmployeeGroup : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อกลุ่มงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionEmployeeLevel.cs b/Models/MetaData/PositionEmployeeLevel.cs new file mode 100644 index 0000000..518bf27 --- /dev/null +++ b/Models/MetaData/PositionEmployeeLevel.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionEmployeeLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionEmployeeLine.cs b/Models/MetaData/PositionEmployeeLine.cs new file mode 100644 index 0000000..df9e97e --- /dev/null +++ b/Models/MetaData/PositionEmployeeLine.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionEmployeeLine : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสายงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionEmployeePosition.cs b/Models/MetaData/PositionEmployeePosition.cs new file mode 100644 index 0000000..02a4f6a --- /dev/null +++ b/Models/MetaData/PositionEmployeePosition.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionEmployeePosition : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionEmployeePositionSide.cs b/Models/MetaData/PositionEmployeePositionSide.cs new file mode 100644 index 0000000..dc3ca79 --- /dev/null +++ b/Models/MetaData/PositionEmployeePositionSide.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionEmployeePositionSide : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อด้านของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionEmployeeStatus.cs b/Models/MetaData/PositionEmployeeStatus.cs new file mode 100644 index 0000000..4a6fcce --- /dev/null +++ b/Models/MetaData/PositionEmployeeStatus.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionEmployeeStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสถานะของตำแหน่งข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionExecutive.cs b/Models/MetaData/PositionExecutive.cs new file mode 100644 index 0000000..4dd5fd7 --- /dev/null +++ b/Models/MetaData/PositionExecutive.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionExecutive : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อตำแหน่งทางการบริหารของข้อมูลตำแหน่งของข้าราชการ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionExecutiveSide.cs b/Models/MetaData/PositionExecutiveSide.cs new file mode 100644 index 0000000..98db7f2 --- /dev/null +++ b/Models/MetaData/PositionExecutiveSide.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Asn1.X509; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionExecutiveSide : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อด้านทางการบริหาร")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionLevel.cs b/Models/MetaData/PositionLevel.cs new file mode 100644 index 0000000..54ca1a5 --- /dev/null +++ b/Models/MetaData/PositionLevel.cs @@ -0,0 +1,18 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionLevel : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อระดับตำแหน่ง")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(100), Column(Order = 2), Comment("ชื่อย่อระดับตำแหน่ง")] + public string ShortName { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionLine.cs b/Models/MetaData/PositionLine.cs new file mode 100644 index 0000000..c3c6e2b --- /dev/null +++ b/Models/MetaData/PositionLine.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionLine : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสายงานของข้อมูลตำแหน่งของข้าราชการ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionPath.cs b/Models/MetaData/PositionPath.cs new file mode 100644 index 0000000..d48cc09 --- /dev/null +++ b/Models/MetaData/PositionPath.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionPath : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสายงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionPathSide.cs b/Models/MetaData/PositionPathSide.cs new file mode 100644 index 0000000..890f8a3 --- /dev/null +++ b/Models/MetaData/PositionPathSide.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Asn1.X509; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionPathSide : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อด้านของสายงาน")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionStatus.cs b/Models/MetaData/PositionStatus.cs new file mode 100644 index 0000000..aed9c60 --- /dev/null +++ b/Models/MetaData/PositionStatus.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionStatus : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อสถานะของตำแหน่งของข้อมูลตำแหน่งของข้าราชการ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/PositionType.cs b/Models/MetaData/PositionType.cs new file mode 100644 index 0000000..3661f81 --- /dev/null +++ b/Models/MetaData/PositionType.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class PositionType : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อประเภทตำแหน่ง")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/Prefix.cs b/Models/MetaData/Prefix.cs new file mode 100644 index 0000000..56b2cd0 --- /dev/null +++ b/Models/MetaData/Prefix.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Prefix : EntityBase + { + [Required, MaxLength(50), Column(Order = 2), Comment("รายละเอียดคำนำหน้า")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/Province.cs b/Models/MetaData/Province.cs new file mode 100644 index 0000000..4f55dcc --- /dev/null +++ b/Models/MetaData/Province.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Province : EntityBase + { + [Required, MaxLength(150), Column(Order = 1), Comment("จังหวัด")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual List Districts { get; set; } = new(); + } +} diff --git a/Models/MetaData/Relationship.cs b/Models/MetaData/Relationship.cs new file mode 100644 index 0000000..3b8b6a5 --- /dev/null +++ b/Models/MetaData/Relationship.cs @@ -0,0 +1,14 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models; + +public class Relationship: EntityBase +{ + [Required, MaxLength(50), Column(Order = 1), Comment("ชื่อความสัมพันธ์")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; +} \ No newline at end of file diff --git a/Models/MetaData/Religion.cs b/Models/MetaData/Religion.cs new file mode 100644 index 0000000..65bb8af --- /dev/null +++ b/Models/MetaData/Religion.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Asn1.X509; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Religion : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ศาสนา")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/Royal.cs b/Models/MetaData/Royal.cs new file mode 100644 index 0000000..faa8dfb --- /dev/null +++ b/Models/MetaData/Royal.cs @@ -0,0 +1,18 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class Royal : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อประเภทข้อมูลเหรียญตรา")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(10), Column(Order = 2), Comment("ชื่อย่อเหรียญตรา")] + public string ShortName { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/RoyalHierarchy.cs b/Models/MetaData/RoyalHierarchy.cs new file mode 100644 index 0000000..5fa848d --- /dev/null +++ b/Models/MetaData/RoyalHierarchy.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class RoyalHierarchy : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อลำดับชั้นข้อมูลเครื่องราชฯ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/RoyalType.cs b/Models/MetaData/RoyalType.cs new file mode 100644 index 0000000..391e7cc --- /dev/null +++ b/Models/MetaData/RoyalType.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class RoyalType : EntityBase + { + [Required, MaxLength(100), Column(Order = 1), Comment("ชื่อประเภทข้อมูลเครื่องราชฯ")] + public string Name { get; set; } = string.Empty; + + [Column(Order = 2), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + } +} diff --git a/Models/MetaData/SubDistrict.cs b/Models/MetaData/SubDistrict.cs new file mode 100644 index 0000000..d08c542 --- /dev/null +++ b/Models/MetaData/SubDistrict.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using Org.BouncyCastle.Asn1.X509; +using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; + +namespace BMA.EHR.MetaData.Service.Models +{ + public class SubDistrict : EntityBase + { + [Required, MaxLength(150), Column(Order = 1), Comment("เขต/อำเภอ")] + public string Name { get; set; } = string.Empty; + + [Required, MaxLength(10), Column(Order = 2), Comment("รหัสไปรษณีย์")] + public string ZipCode { get; set; } = string.Empty; + + [Column(Order = 3), Comment("สถานะการใช้งาน")] + public bool IsActive { get; set; } = true; + + public virtual District? District { get; set; } + } +} diff --git a/Models/OrganizationEntity.cs b/Models/OrganizationEntity.cs new file mode 100644 index 0000000..723a102 --- /dev/null +++ b/Models/OrganizationEntity.cs @@ -0,0 +1,73 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models +{ + public class OrganizationEntity : EntityBase + { + + //[ForeignKey("OrganizationOrganizationId")] + //public OrganizationOrganization? OrganizationOrganization_OrganizationOrganizationId { get; set; } + + [Column(Order = 2), Comment("OrganizationOrganizationId")] + public Guid? OrganizationOrganizationId { get; set; } + + //[ForeignKey("OrganizationShortNameId")] + //public OrganizationShortName? OrganizationShortName_OrganizationShortNameId { get; set; } + + [Column(Order = 3), Comment("OrganizationShortNameId")] + public Guid? OrganizationShortNameId { get; set; } + + //[ForeignKey("OrganizationTypeId")] + //public OrganizationType? OrganizationType_OrganizationTypeId { get; set; } + + [Column(Order = 4), Comment("OrganizationTypeId")] + public Guid? OrganizationTypeId { get; set; } + + //[ForeignKey("OrganizationLevelId")] + //public OrganizationLevel? OrganizationLevel_OrganizationLevelId { get; set; } + + [Column(Order = 5), Comment("OrganizationLevelId")] + public Guid? OrganizationLevelId { get; set; } + + //[ForeignKey("OrganizationTelExternalId")] + //public OrganizationTelExternal? OrganizationTelExternal_OrganizationTelExternalId { get; set; } + + [Column(Order = 6), Comment("OrganizationTelExternalId")] + public Guid? OrganizationTelExternalId { get; set; } + + //[ForeignKey("OrganizationTelInternalId")] + //public OrganizationTelInternal? OrganizationTelInternal_OrganizationTelInternalId { get; set; } + + [Column(Order = 7), Comment("OrganizationTelInternalId")] + public Guid? OrganizationTelInternalId { get; set; } + + //[ForeignKey("OrganizationFaxId")] + //public OrganizationFax? OrganizationFax_OrganizationFaxId { get; set; } + + [Column(Order = 8), Comment("OrganizationFaxId")] + public Guid? OrganizationFaxId { get; set; } + + [ForeignKey("ParentId")] + public OrganizationEntity? Organization_ParentId { get; set; } + + [Column(Order = 9), Comment("ParentId")] + public Guid? ParentId { get; set; } + + [Column(Order = 10), Comment("OrganizationAgencyId")] + public Guid? OrganizationAgencyId { get; set; } + + [Column(Order = 11), Comment("OrganizationGovernmentAgencyId")] + public Guid? OrganizationGovernmentAgencyId { get; set; } + + [Column(Order = 12), Comment("OrganizationOrder")] + public int? OrganizationOrder { get; set; } + + [Column(Order = 13), Comment("OrganizationUserNote")] + public string? OrganizationUserNote { get; set; } + public List Organizations { get; } = new(); + + } +} diff --git a/Models/OrganizationPositionEntity.cs b/Models/OrganizationPositionEntity.cs new file mode 100644 index 0000000..be30531 --- /dev/null +++ b/Models/OrganizationPositionEntity.cs @@ -0,0 +1,31 @@ +using BMA.EHR.Report.Service.Models; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace BMA.EHR.Profile.Service.Models +{ + public class OrganizationPositionEntity : EntityBase + { + [ForeignKey("PositionMasterId")] + public PositionMasterEntity? PositionMaster_PositionMasterId { get; set; } + + [Column(Order = 2), Comment("Position Master")] + public Guid? PositionMasterId { get; set; } + + [Column(Order = 3), Comment("Is Director")] + public bool? IsDirector { get; set; } + + [Column(Order = 4), Comment("positionUserNote")] + public string? PositionUserNote { get; set; } + + [ForeignKey("OrganizationId")] + public OrganizationEntity? Organization_OrganizationId { get; set; } + + [Column(Order = 5), Comment("OrganizationId")] + public Guid? OrganizationId { get; set; } + + [Column(Order = 6), Comment("PositionNumberId")] + public Guid? PositionNumberId { get; set; } + } +} diff --git a/Models/PositionMasterEntity.cs b/Models/PositionMasterEntity.cs new file mode 100644 index 0000000..219ab6d --- /dev/null +++ b/Models/PositionMasterEntity.cs @@ -0,0 +1,72 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models +{ + public class PositionMasterEntity : EntityBase + { + + //[ForeignKey("PositionId")] + //public Position? Position_PositionId { get; set; } + + [Column(Order = 2), Comment("PositionId")] + public Guid? PositionId { get; set; } + + //[ForeignKey("PositionPathId")] + //public PositionPath? PositionPath_PositionPathId { get; set; } + + [Column(Order = 3), Comment("PositionPathId")] + public Guid? PositionPathId { get; set; } + + //[ForeignKey("PositionTypeId")] + //public PositionType? PositionType_PositionTypeId { get; set; } + + [Column(Order = 4), Comment("PositionTypeId")] + public Guid? PositionTypeId { get; set; } + + //[ForeignKey("PositionExecutiveId")] + //public PositionExecutive? PositionExecutive_PositionExecutiveId { get; set; } + + [Column(Order = 5), Comment("PositionExecutiveId")] + public Guid? PositionExecutiveId { get; set; } + + //[ForeignKey("ExcutiveSideId")] + //public PositionExecutiveSide? PositionExecutiveSide_ExcutiveSideId { get; set; } + + [Column(Order = 6), Comment("PositionExecutiveSideId")] + public Guid? PositionExecutiveSideId { get; set; } + + //[ForeignKey("PathSideId")] + //public PositionPathSide? PositionPathSide_PathSideId { get; set; } + + [Column(Order = 7), Comment("PositionPathSideId")] + public Guid? PositionPathSideId { get; set; } + + [Column(Order = 8), Comment("PositionLineId")] + public Guid? PositionLineId { get; set; } + + //[Column(Order = 9), Comment("PositionLevelId")] + //public Guid? PositionLevelId { get; set; } + + [Column(Order = 10), Comment("PositionStatusId")] + public Guid? PositionStatusId { get; set; } + + [Column(Order = 11), Comment("PositionCondition")] + public string? PositionCondition { get; set; } + + [Column(Order = 12), Comment("PositionStatus")] + public Guid? PositionStatus { get; set; } + + [Column(Order = 13), Comment("PositionMasterUserNote")] + public string? PositionMasterUserNote { get; set; } + + [Column(Order = 14), Comment("IsDirector")] + public bool? IsDirector { get; set; } + + //public List AvailablePositionLevels { get; } = new(); + + + } +} diff --git a/Models/PositionNumberEntity.cs b/Models/PositionNumberEntity.cs new file mode 100644 index 0000000..6382108 --- /dev/null +++ b/Models/PositionNumberEntity.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models +{ + public class PositionNumberEntity : EntityBase + { + + [MaxLength(300), Column(Order = 2), Comment("ชื่อ")] + public string? Name { get; set; } + + //[ForeignKey("OrganizationShortNameId")] + //public OrganizationShortName? OrganizationShortName_OrganizationShortNameId { get; set; } + + [Column(Order = 3), Comment("Shortname")] + public Guid? OrganizationShortNameId { get; set; } + } +} diff --git a/Models/ProfilePosition.cs b/Models/ProfilePosition.cs new file mode 100644 index 0000000..b77a6e1 --- /dev/null +++ b/Models/ProfilePosition.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using BMA.EHR.Report.Service.Models; + +namespace BMA.EHR.Profile.Service.Models +{ + /// + /// Link Profile กับ OrganizationPosition + /// + public class ProfilePosition : EntityBase + { + public OrganizationPositionEntity OrganizationPosition { get; set; } + + public Guid OrganizationPositionId { get; set; } + + public Guid? ProfileId { get; set; } + } +} diff --git a/Program.cs b/Program.cs index 42c66c6..a205bfa 100644 --- a/Program.cs +++ b/Program.cs @@ -16,6 +16,7 @@ using MongoDB.Bson.Serialization; using BMA.EHR.Report.Service; using Microsoft.AspNetCore.Mvc.ApiExplorer; using BMA.EHR.Recruit.Service.Services; +using BMA.EHR.Profile.Service.Services; var builder = WebApplication.CreateBuilder(args); var issuer = builder.Configuration["Jwt:Issuer"]; @@ -27,18 +28,18 @@ builder.Services.AddHttpContextAccessor(); builder.Services.AddApiVersioning(opt => { - opt.DefaultApiVersion = new ApiVersion(1, 0); - opt.AssumeDefaultVersionWhenUnspecified = true; - opt.ReportApiVersions = true; - opt.ApiVersionReader = ApiVersionReader.Combine(new UrlSegmentApiVersionReader(), - new HeaderApiVersionReader("x-api-version"), - new MediaTypeApiVersionReader("x-api-version")); + opt.DefaultApiVersion = new ApiVersion(1, 0); + opt.AssumeDefaultVersionWhenUnspecified = true; + opt.ReportApiVersions = true; + opt.ApiVersionReader = ApiVersionReader.Combine(new UrlSegmentApiVersionReader(), + new HeaderApiVersionReader("x-api-version"), + new MediaTypeApiVersionReader("x-api-version")); }); builder.Services.AddVersionedApiExplorer(setup => { - setup.GroupNameFormat = "'v'VVV"; - setup.SubstituteApiVersionInUrl = true; + setup.GroupNameFormat = "'v'VVV"; + setup.SubstituteApiVersionInUrl = true; }); builder.Services.AddEndpointsApiExplorer(); @@ -46,17 +47,17 @@ builder.Services.AddEndpointsApiExplorer(); // Authorization builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(opt => { - opt.RequireHttpsMetadata = false; //false for dev - opt.Authority = issuer; - opt.TokenValidationParameters = new() - { - ValidateIssuer = true, - ValidateAudience = false, - ValidateLifetime = true, - ValidateIssuerSigningKey = true, - ValidIssuer = issuer, - IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key)) - }; + opt.RequireHttpsMetadata = false; //false for dev + opt.Authority = issuer; + opt.TokenValidationParameters = new() + { + ValidateIssuer = true, + ValidateAudience = false, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = issuer, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(key)) + }; }); builder.Services.AddAuthorization(); @@ -70,26 +71,36 @@ BsonSerializer.RegisterSerializer(new DateTimeSerializer(BsonType.String)); // Register DbContext var recruitConnection = builder.Configuration.GetConnectionString("RecruitConnection"); builder.Services.AddDbContext(options => - options.UseMySql(recruitConnection, ServerVersion.AutoDetect(recruitConnection), o => o.MigrationsHistoryTable("__ReportMigrationsHistory")), ServiceLifetime.Transient); + options.UseMySql(recruitConnection, ServerVersion.AutoDetect(recruitConnection), o => o.MigrationsHistoryTable("__ReportMigrationsHistory")), ServiceLifetime.Transient); + +var ehrConnection = builder.Configuration.GetConnectionString("EHRConnection"); +builder.Services.AddDbContext(options => + options.UseMySql(ehrConnection, ServerVersion.AutoDetect(ehrConnection), o => o.MigrationsHistoryTable("__ReportMigrationsHistory")), ServiceLifetime.Transient); + +var examConnection = builder.Configuration.GetConnectionString("ExamConnection"); +builder.Services.AddDbContext(options => + options.UseMySql(examConnection, ServerVersion.AutoDetect(examConnection), o => o.MigrationsHistoryTable("__ReportMigrationsHistory")), ServiceLifetime.Transient); // Add config CORS builder.Services.AddCors(options => options.AddDefaultPolicy(builder => { - builder - .AllowAnyOrigin() - .AllowAnyMethod() - .AllowAnyHeader() - .SetIsOriginAllowedToAllowWildcardSubdomains(); + builder + .AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader() + .SetIsOriginAllowedToAllowWildcardSubdomains(); })); // Register Service builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); // Add services to the container. builder.Services.AddControllers(options => { - options.SuppressAsyncSuffixInActionNames = false; + options.SuppressAsyncSuffixInActionNames = false; }) .AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore); @@ -97,21 +108,22 @@ builder.Services.AddSwaggerGen(); builder.Services.ConfigureOptions(); builder.Services.AddHealthChecks(); + var app = builder.Build(); var apiVersionDescriptionProvider = app.Services.GetRequiredService(); if (app.Environment.IsDevelopment()) { - app.UseSwagger(); - app.UseSwaggerUI(options => - { - foreach (var description in apiVersionDescriptionProvider.ApiVersionDescriptions) - { - options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", - description.GroupName.ToUpperInvariant()); - } - }); + app.UseSwagger(); + app.UseSwaggerUI(options => + { + foreach (var description in apiVersionDescriptionProvider.ApiVersionDescriptions) + { + options.SwaggerEndpoint($"/swagger/{description.GroupName}/swagger.json", + description.GroupName.ToUpperInvariant()); + } + }); } app.MapHealthChecks("/health"); @@ -132,32 +144,32 @@ await db.Database.MigrateAsync(); app.Run(); void ConfigureLogs() { - var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); - var configuration = new ConfigurationBuilder() - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) - .AddJsonFile( - $"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", - optional: true) - .Build(); + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddJsonFile( + $"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", + optional: true) + .Build(); - Log.Logger = new LoggerConfiguration() - .Enrich.FromLogContext() - // .WriteTo.Debug() - .MinimumLevel.Error() - .WriteTo.Console() - .Enrich.WithExceptionDetails() - // .Enrich.WithEnvironmentUserName() - .WriteTo.Elasticsearch(ConfigureElasticSink(configuration, environment ?? "")) - .Enrich.WithProperty("Environment", environment) - .ReadFrom.Configuration(configuration) - .CreateLogger(); + Log.Logger = new LoggerConfiguration() + .Enrich.FromLogContext() + // .WriteTo.Debug() + .MinimumLevel.Error() + .WriteTo.Console() + .Enrich.WithExceptionDetails() + // .Enrich.WithEnvironmentUserName() + .WriteTo.Elasticsearch(ConfigureElasticSink(configuration, environment ?? "")) + .Enrich.WithProperty("Environment", environment) + .ReadFrom.Configuration(configuration) + .CreateLogger(); } ElasticsearchSinkOptions ConfigureElasticSink(IConfigurationRoot configuration, string environment) { - return new ElasticsearchSinkOptions(new Uri(configuration["ElasticConfiguration:Uri"] ?? "")) - { - AutoRegisterTemplate = true, - IndexFormat = $"{Assembly.GetExecutingAssembly()?.GetName()?.Name?.ToLower().Replace(".", "-")}-{environment?.ToLower().Replace(".", "-")}" - }; + return new ElasticsearchSinkOptions(new Uri(configuration["ElasticConfiguration:Uri"] ?? "")) + { + AutoRegisterTemplate = true, + IndexFormat = $"{Assembly.GetExecutingAssembly()?.GetName()?.Name?.ToLower().Replace(".", "-")}-{environment?.ToLower().Replace(".", "-")}" + }; } diff --git a/Report/Organization/rptAccount1.trdp b/Report/Organization/rptAccount1.trdp new file mode 100644 index 0000000000000000000000000000000000000000..a18371c9e8af5f6997d018589cdc82f23105f4cf GIT binary patch literal 2238 zcmai$S5Om*5{8q|Vu6666A!&7^e$4Q6RH#esZs+10U|{blp=}{dKaXb0MdJjpblU_ zT978)0tg5qh*84**xi^5+l+ZN#Oz0MSzbm^|V740YQ9(*w|Tz27MZ>vP3G!e^(%g&e@5JD_G z3={|_=GorQO&jbhVTn5Sm_I&f-8F$&t6}KwAnjv?kb@C%^`A>_4hdsVJdwu-Tcq9A zG>QPY>EPbNKo5ea-K^Buu%4ufPqjxz{#UhY*R~}?a`5cp zIN6jm=IVI~qiN?9SST5dL$bg#a8=VFjYJzi{8BAh-g+T53B{fWAOM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fCyd>^;dzaWS{-lkaFT^%+h~(b z*}Rq|A+TrodNSv-raF>qxiK@+IjaS= znmx4yQ%BA&HNI(R^heL|6`g~Vn8WPfyTl}V5pp7$^eq}t0`vIQ=UZJgeycw~`rz+_ zsGL(uwx1646r|Vnf`c&LK^QmND71H&%m1UPs0ETGPL8$5R56+xN@BYTUI(X=&Egz)tlQ$^0%vs#QP~&d^loI_@e( zkqo`jd>Jp6BbYgE%14|)C)(VfcuU#@|FFBI!>5_`DQ=d9vTs&bz{Hs+I=OH&HQrBU zMT797UrjAQZTM#>8@+$h2^WpY3JC-u0RJm2{4)~#86E!l`=>wu{%dj?KmLnbR!9cM P-!jl?<4(6U`1kcMxd!Bz literal 0 HcmV?d00001 diff --git a/Report/Profile/rptKK1Summary.trbp b/Report/Profile/rptKK1Summary.trbp new file mode 100644 index 0000000000000000000000000000000000000000..d4350b50e828405245301d6a96b022ef7f93ed77 GIT binary patch literal 600 zcmWIWW@Zs#U|`^22+v*>=DnjpayF3n8;JQBWEfIX(=ziiOEUBG^eS?56c$M^Xe1H-}fu(AK5yaoTN>z6GztZ?^D zOE~2_N6b>SV&2ney%`6tFjRy_nNPly=*T(mL`{*$W|vPJGg-Q?RI>c@&;5NwYX9#~ z-2bZI`OeFq!XJR*#g0E;DyIV7zYU0mfnJPu&d)1J%`1rysVqn>jwR$zRX=aOCIf-J zUdGiDC5b(mrOoht&go#go?|=VW`E{zyk>+Jjn!-0|YYRNd z-C=oObH+~HzJTn?S~oAH=-QwQ#>a(|Hre*7O;wz9-b;Gf#e%lr_KP=mzvTEHTIwKe zGx>Sbb-oLqeAdon7n`nn`F2iUbB5V{tEC5ySXg9Roc>WH$dc9hU;Gz)fHxzPE(5M; lM2{@gNJZC+8a~K+9|Jj9LMy-xB*1*KI=Wp{T*=aRs&U@WLf_SYwks;`m54SuIgGCP9 za1!QqBKYUjZ-j9Ab?5j-&gnCP3k9MxEuw0Ke5dz4)UUS2XMlsWdd9}*PU8FSJ)Ad_ zWIe}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nAGZws zWOl^xHg=L_w2JYxf{NJ0JSzVL%@oL^)9ysUS&?mp`*}#WK6X|>H-Zq~{&JhS+2=<0 zU@vRG_gctvQ*R#R{oCq^Dc))c&i4^O0EpY=8NbdG^~td`Z%pa|L@8q|WysY;$12-f z*l;2&*(`VDy7yCuZKgYJEij+Zbe6l_9aew*a=y{CU@{>|Zz+y@Rt~cwOGqC+7QXWQ>*^g<4X1&SrETzffgt#(= z8FH#zt%R!#%*0*>xPk?ybFIxNnDfTrhj$3`iYbQ9-C_CcNv=qT4CxneL#`erS9*dSap;NVp&KJ9Qv?6=cu!L>^#?R^gb?X=ajYl^61J2k-b5y})7G^VX^mJh0^$KAt@%Qi^H03a~78JzG^Qd2nmhBObd%znXRw(0(K zZxgsWADh1;iTM>yus-EJa`=plD`U)Uf8fP6o5F=3%InGGS6$cJ?*s*rz<3xJV_CA! z{}H1&hy39QJD7uaO_E7-Ly)exU)YbY7>d3lC^BV|CGvBg)_OrI)<^HgQx*^>RD{p^ zvexV}p{?qN^XS~8=Q(9h6-hCZT#Y4rnX)?FJHO$#v!$IMxX|QteZBMNFEFRCFlZJ& z_!U#=P53{lRV3$lLFqrk$IZWm@sC>Ri90#ETR6HKY4|u>xEcKa_*FupB627zYDClW zEHR7$t{E-kYBvXSpU6L&7~WYDCfam1Lg51)XK&E$4+K0)zRQNYB;I_+$oH*j%{-GZg?*r$e0v*tH*7ACG#YzO>=?1YzF22i}3J$b&;L zf&JeMG5^!*@_)C-{Lec7$w~ivo$-Io{*$5pPwaml`hUlgl7s!9u0TZ|8s@*YLH?WL L{~`*-e`Ws*djFwT literal 0 HcmV?d00001 diff --git a/Report/Profile/rptKK1_Page2.trdp b/Report/Profile/rptKK1_Page2.trdp new file mode 100644 index 0000000000000000000000000000000000000000..c27bee04d425be8315949d4b0c4a52fa85d1cb79 GIT binary patch literal 2192 zcmai$X*|>m7svk$hDpQCT0{1IOJf~V#8^j6mK3V7jbvwJm!)wH5pG7}CL@v*HIcz2 zdzma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u!Xw(@ax zO6p)ZMt&=bkgD76X8@zcyPCBIoriRTB`m-qel@LHvZ!U6-!=%VBbHuCv2Rg}Z61zYX z$CZs3eE!ENz*=;NIURK?*rn;W UploadFileAsync(IFormFile file, string newFileName = "") + { + var fileName = ""; + var fileExt = Path.GetExtension(file.FileName); + if (newFileName != "") + fileName = $"{newFileName}"; + else + fileName = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"'); + + + var tmpDir = Path.Combine(_webHostEnvironment.ContentRootPath, "tmp"); + if (!Directory.Exists(tmpDir)) + Directory.CreateDirectory(tmpDir); + + var tmpFile = Path.Combine(tmpDir, $"tmp_{DateTime.Now.ToString("ddMMyyyyHHmmss")}{fileExt}"); + + try + { + using (var ms = new MemoryStream()) + { + var id = Guid.NewGuid(); + file.CopyTo(ms); + var fileBytes = ms.ToArray(); + System.IO.MemoryStream filestream = new System.IO.MemoryStream(fileBytes); + + var request = new PutObjectRequest + { + BucketName = _bucketName, + Key = id.ToString("D"), + InputStream = filestream, + ContentType = file.ContentType, + CannedACL = S3CannedACL.PublicRead + }; + + await _s3Client.PutObjectAsync(request); + + // create document object + var doc = new Document() + { + FileName = fileName, + FileType = file.ContentType, + FileSize = Convert.ToInt32(file.Length), + ObjectRefId = id, + CreatedDate = DateTime.Now + }; + + await _context.Documents.AddAsync(doc); + await _context.SaveChangesAsync(); + + return doc; + } + } + catch + { + throw; + } + finally + { + File.Delete(tmpFile); + } + } + + public async Task DownloadFileAsync(Guid fileId) + { + try + { + var doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == fileId); + + if (doc == null) + throw new Exception(GlobalMessages.FileNotFoundOnServer); + + using (var memoryStream = new MemoryStream()) + { + GetObjectRequest request = new GetObjectRequest + { + BucketName = _bucketName, + Key = doc.ObjectRefId.ToString("D") + }; + + using (GetObjectResponse response = await _s3Client.GetObjectAsync(request)) + { + using (Stream responseStream = response.ResponseStream) + { + responseStream.CopyTo(memoryStream); + } + } + + var fileContent = memoryStream.ToArray(); + + return new FileDownloadResponse + { + FileName = doc.FileName, + FileType = doc.FileType, + FileContent = fileContent + }; + }; + } + catch + { + throw; + } + } + + public async Task DeleteFileAsync(Guid fileId) + { + try + { + var doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == fileId); + + if (doc == null) + throw new Exception(GlobalMessages.FileNotFoundOnServer); + else + { + DeleteObjectRequest request = new DeleteObjectRequest + { + BucketName = _bucketName, + Key = doc?.ObjectRefId.ToString("D") + }; + + // delete from minio + await _s3Client.DeleteObjectAsync(request); + + + _context.Documents.Remove(doc); + await _context.SaveChangesAsync(); + } + } + catch + { + throw; + } + } + + public async Task GetFilePath(Guid fileId) + { + + var doc = await _context.Documents.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == fileId); + + if (doc == null) + throw new Exception(GlobalMessages.FileNotFoundOnServer); + + //var config = new AmazonS3Config + //{ + // ServiceURL = Configuration.GetValue("MinIO:Endpoint"), + // ForcePathStyle = true + //}; + + DateTime expires = DateTime.UtcNow.AddHours(6); + GetPreSignedUrlRequest request = new GetPreSignedUrlRequest + { + BucketName = _bucketName, + Key = doc?.ObjectRefId.ToString("D"), + Expires = expires, + }; + string path = _s3Client.GetPreSignedURL(request); + + return path; + } + + public Image ByteArrayToImage(byte[] bytesArr) + { + using (MemoryStream memstr = new MemoryStream(bytesArr)) + { + Image img = Image.FromStream(memstr); + return img; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Services/ProfileService.cs b/Services/ProfileService.cs new file mode 100644 index 0000000..cbbbce1 --- /dev/null +++ b/Services/ProfileService.cs @@ -0,0 +1,485 @@ +using BMA.EHR.Profile.Service.Models; +using BMA.EHR.Report.Service.Data; +using Microsoft.EntityFrameworkCore; +using System.Text.RegularExpressions; + +namespace BMA.EHR.Profile.Service.Services +{ + public class OrganizationItem + { + public Guid Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public int Order { get; set; } = 0; + } + + public class ProfileService + { + private readonly EHRDbContext _context; + + public ProfileService(EHRDbContext context) + { + _context = context; + } + + public string ConvertRelationshipToEng(string thai_text) + { + switch (thai_text) + { + case "หย่า": + case "หย่าร้าง": return "divorced"; + case "โสด": return "single"; + case "สมรส": return "married"; + case "แยกกันอยู่": return "seperated"; + default: return "na"; + } + } + + public string ConvertGenderToEng(string thai_text) + { + switch (thai_text) + { + case "ชาย": return "male"; + case "หญิง": return "female"; + default: return "na"; + } + } + + #region " Organizations " + + public string FindOCFullPath(Guid id, bool showRoot = false) + { + try + { + var ocList = GetOcNameFullPath(id, showRoot); + var ret = String.Empty; + foreach (var oc in ocList) + { + ret = oc + " " + ret; + } + + ret = ret.Substring(0, ret.Length - 1); + + return ret; + } + catch + { + throw; + } + } + + public string FindOCFullPathWithNewLine(Guid id, bool showRoot = false, string suppress = "") + { + try + { + var ocList = GetOcNameFullPath(id, showRoot); + var ret = String.Empty; + foreach (var oc in ocList) + { + if ((oc == suppress) && ocList.Count > 1) continue; + ret = $"{oc}\r\n{ret}"; + } + + ret = ret.Substring(0, ret.Length - 2); + + return ret; + } + catch + { + throw; + } + } + + public string GetOrganizationNameFullPathNewLine(Guid id, bool showRoot = false, bool descending = false) + { + try + { + var ocList = GetOCWithFullPath(id, showRoot); + if (descending) + ocList = ocList.OrderBy(x => x.Order).ToList(); + + var ret = String.Empty; + foreach (var oc in ocList) + { + ret = $"{oc.Name}\r\n{ret}"; + } + + ret = ret.Substring(0, ret.Length - 1); + + return ret; + } + catch + { + throw; + } + } + + public string GetOrganizationNameFullPath(Guid id, bool showRoot = false, bool descending = false) + { + try + { + var ocList = GetOCWithFullPath(id, showRoot); + if (descending) + ocList = ocList.OrderBy(x => x.Order).ToList(); + + var ret = String.Empty; + foreach (var oc in ocList) + { + ret = oc.Name + " " + ret; + } + + ret = ret.Substring(0, ret.Length - 1); + + return ret; + } + catch + { + throw; + } + } + + public List GetOCWithFullPath(Guid id, bool showRoot = false) + { + try + { + var ocList = new List(); + + var organizations = _context.Organizations.ToList(); + var organizationOrganizations = _context.OrganizationOrganizations.ToList(); + + + var oc = (from o in organizations + join oc_name in organizationOrganizations on o.OrganizationOrganizationId equals oc_name.Id + select new + { + Id = o.Id, + Name = oc_name.Name, + //o.IsActive, + o.ParentId, + IsRoot = o.ParentId == null + }).FirstOrDefault(x => x.Id == id); + + + //ocList.Add(new OrganizationItem { Id = oc.Id, Name = oc.Name }); + + if (!showRoot) + { + if (!oc.IsRoot) + ocList.Add(new OrganizationItem { Id = oc.Id, Name = oc.Name }); + } + else + ocList.Add(new OrganizationItem { Id = oc.Id, Name = oc.Name }); + + if (oc.ParentId != null) + { + ocList.AddRange(GetOCWithFullPath(oc.ParentId.Value, showRoot)); + } + + return ocList; + } + catch + { + throw; + } + } + + public List GetOcNameFullPath(Guid id, bool showRoot = false) + { + try + { + var ocList = new List(); + + var organizations = _context.Organizations.ToList(); + var organizationOrganizations = _context.OrganizationOrganizations.ToList(); + + var oc = (from o in organizations + join oc_name in organizationOrganizations on o.OrganizationOrganizationId equals oc_name.Id + select new + { + Id = o.Id, + Name = oc_name.Name, + //o.IsActive, + o.ParentId, + IsRoot = o.ParentId == null + }).FirstOrDefault(x => x.Id == id); + + if (!showRoot) + { + if (!oc.IsRoot) + ocList.Add(oc.Name); + } + else + ocList.Add(oc.Name); + + //ocList.Add(oc.Name); + + if (oc.ParentId != null) + { + ocList.AddRange(GetOcNameFullPath(oc.ParentId.Value, showRoot)); + } + + return ocList; + } + catch + { + throw; + } + } + + public List GetAllIdByRoot(Guid id) + { + try + { + var ret = new List(); + + var oc = _context.Organizations.FirstOrDefault(x => x.Id == id); + if (oc != null) + ret.Add(oc.Id); + + var child = _context.Organizations.AsQueryable().Where(x => x.ParentId == id).ToList(); + if (child.Any()) + { + foreach (var item in child) + { + ret.AddRange(GetAllIdByRoot(item.Id)); + } + } + + return ret; + } + catch + { + throw; + } + } + + public List GetOCWithChildrenByRoot(Guid id) + { + try + { + var ret = new List(); + + var organizations = _context.Organizations.ToList(); + var organizationOrganizations = _context.OrganizationOrganizations.ToList(); + + // var oc = _context.Organizations.FirstOrDefault(x => x.Id == id && x.IsActive); + var oc = (from o in organizations + join oc_name in organizationOrganizations on o.OrganizationOrganizationId equals oc_name.Id + select new + { + Id = o.Id, + Name = oc_name.Name, + //o.IsActive, + o.ParentId, + IsRoot = o.ParentId == null + }).FirstOrDefault(x => x.Id == id); + + var child = (from o in organizations + join oc_name in organizationOrganizations on o.OrganizationOrganizationId equals oc_name.Id + select new + { + Id = o.Id, + Name = oc_name.Name, + //o.IsActive, + o.ParentId, + IsRoot = o.ParentId == null + }) + .Where(x => x.ParentId == id) + .ToList(); + + // var child = _context.Organizations.AsQueryable().Where(x => x.ParentId == id && x.IsActive).ToList(); + + + if (child.Any()) + { + var node = new + { + id = oc.Id, + label = oc.Name, + children = new List() + }; + foreach (var item in child) + { + node.children.AddRange(GetOCWithChildrenByRoot(item.Id)); + } + + ret.Add(node); + } + else + { + var node = new + { + id = oc.Id, + label = oc.Name, + }; + ret.Add(node); + } + + return ret; + } + catch + { + throw; + } + } + + public List GetOcByRoot(Guid id) + { + try + { + var ret = new List(); + var oc = _context.Organizations.FirstOrDefault(x => x.Id == id); + ret.Add(oc); + var child = _context.Organizations.AsQueryable().Where(x => x.ParentId == id).ToList(); + if (child.Any()) + { + foreach (var item in child) + { + //ret.Add(item); + var c = _context.Organizations.AsQueryable().Where(x => x.ParentId == item.Id).ToList(); + if (c.Any()) + ret.AddRange(GetOcByRoot(item.Id)); + else + ret.Add(item); + } + } + return ret; + } + catch + { + throw; + } + } + + public string GetPositionLevel(Guid id) + { + try + { + var level = (from alv in _context.AvailablePositionLevels + join lv in _context.PositionLevels on alv.PositionLevelId equals lv.Id + where alv.PositionMasterId == id + select lv.Name).ToList(); + + + var count = 0; + var ret = String.Empty; + foreach (var lv in level) + { + if (count != 0) + ret = $"{ret}หรือ\r\n{lv}"; + else + ret += lv; + + count++; + } + + return ret; + } + catch + { + throw; + } + } + + #endregion + + #region " Profiles " + + public async Task GetProfileById(Guid profileId) + { + try + { + var profile = await _context.Profiles.AsQueryable() + // .Include(p => p.Organization) + .Include(p => p.Position) + // .ThenInclude(p => p.PositionPath) + // .Include(p => p.PositionNumber) + + .Include(p => p.Certificates) + .Include(p => p.Disciplines) + .Include(p => p.Educations) + .Include(p => p.Honors) + .Include(p => p.Insignias) + .Include(p => p.Trainings) + + // .Include(p => p.Salaries) + // .ThenInclude(s => s.SalaryPosition) + // .Include(s => s.Salaries) + // .ThenInclude(s => s.SalaryOrganization) + // .Include(p => p.Salaries) + // .ThenInclude(s => s.SalaryPositionNumber) + // .Include(p => p.Salaries) + // .ThenInclude(s => s.SalaryPositionLevel) + // .Include(p => p.Salaries) + // .ThenInclude(s => s.SalaryPositionType) + .Include(x => x.Avatar) + + // .Include(x => x.PositionType) + // .Include(x => x.PositionLevel) + .Include(x => x.Childrens) + .FirstOrDefaultAsync(p => p.Id == profileId); + + return profile; + } + catch + { + throw; + } + } + + public bool ValidateProfileById(string profileId) + { + var idcardno = profileId; + + if (string.IsNullOrEmpty(idcardno)) + { + return false; + } + + if (idcardno.Length != 13) + { + return false; + } + + bool isDigit = Regex.IsMatch(idcardno, @"^[0-9]*$"); + if (!isDigit) + { + return false; + } + + + int sum = 0; + for (int i = 0; i < 12; i++) + { + sum += Convert.ToInt32(idcardno.Substring(i, 1)) * (13 - i); + } + + int checksum = (11 - (sum % 11)) % 10; + if (checksum != Convert.ToInt32(idcardno.Substring(12))) + { + return false; + } + + return true; + + } + + public async Task CheckExistCitizenId(string profileId) + { + try + { + var profile = await _context.Profiles.AsQueryable().Where(p => p.CitizenId == profileId).FirstOrDefaultAsync(); + + return profile != null; + } + catch + { + throw; + } + } + + + #endregion + } +} diff --git a/appsettings.Development.json b/appsettings.Development.json index a54f5fa..686aa8e 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -14,7 +14,9 @@ "AllowedHosts": "*", "ConnectionStrings": { "MongoConnection": "mongodb://admin:adminVM123@127.0.0.1:27017", - "RecruitConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "RecruitConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "EHRConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI", diff --git a/appsettings.json b/appsettings.json index a54f5fa..84a786b 100644 --- a/appsettings.json +++ b/appsettings.json @@ -14,7 +14,10 @@ "AllowedHosts": "*", "ConnectionStrings": { "MongoConnection": "mongodb://admin:adminVM123@127.0.0.1:27017", - "RecruitConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "RecruitConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_recruit;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "EHRConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;", + "ExamConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_exam;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",