diff --git a/BMA.EHR.Application/ApplicationServicesRegistration.cs b/BMA.EHR.Application/ApplicationServicesRegistration.cs index bac9063a..502acb37 100644 --- a/BMA.EHR.Application/ApplicationServicesRegistration.cs +++ b/BMA.EHR.Application/ApplicationServicesRegistration.cs @@ -22,6 +22,7 @@ namespace BMA.EHR.Application services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); return services; } diff --git a/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs new file mode 100644 index 00000000..672d378b --- /dev/null +++ b/BMA.EHR.Application/Repositories/Reports/RetireReportRepository.cs @@ -0,0 +1,63 @@ +using BMA.EHR.Application.Common.Interfaces; +using BMA.EHR.Domain.Extensions; +using BMA.EHR.Domain.Models.Retirement; +using Microsoft.AspNetCore.Http; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BMA.EHR.Application.Repositories.Reports +{ + public class RetireReportRepository + { + #region " Fields " + + private readonly IApplicationDBContext _dbContext; + + #endregion + + #region " Constructor and Destructor " + + public RetireReportRepository(IApplicationDBContext dbContext) + { + _dbContext = dbContext; + } + + #endregion + + #region " Methods " + + public async Task> GetListRetirePeriodAsync() + { + try + { + // 1. query + var data = await _dbContext.Set() + .Include(x => x.RetirementPeriodHistorys) + .Include(x => x.RetirementProfiles) + .ThenInclude(x => x.Profile) + .ToListAsync(); + + // 2. data not found throw exception + + + // 3. Load Report File + + + + return data; + + + } + catch + { + throw; + } + } + + #endregion + } +} diff --git a/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj b/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj index f405e447..14bde6b8 100644 --- a/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj +++ b/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj @@ -40,10 +40,6 @@ - - - - diff --git a/BMA.EHR.Report.Service/Controllers/RetireReportController.cs b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs new file mode 100644 index 00000000..918cbfce --- /dev/null +++ b/BMA.EHR.Report.Service/Controllers/RetireReportController.cs @@ -0,0 +1,18 @@ +using BMA.EHR.Domain.Common; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; + +namespace BMA.EHR.Report.Service.Controllers +{ + [Route("api/v{version:apiVersion}/report/retire")] + [ApiVersion("2.0")] + [ApiController] + [Produces("application/json")] + [Authorize] + [SwaggerTag("API รายงานระบบเกษียณ")] + public class RetireReportController : BaseController + { + } +} diff --git a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp index 31a57df3..a0cc5f8e 100644 Binary files a/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp and b/BMA.EHR.Report.Service/Reports/32-ประกาศเกษียณลูกจ้างประจำ.trdp differ diff --git a/BMA.EHR.Report.Service/appsettings.json b/BMA.EHR.Report.Service/appsettings.json index 4c80fbc7..254ef302 100644 --- a/BMA.EHR.Report.Service/appsettings.json +++ b/BMA.EHR.Report.Service/appsettings.json @@ -14,7 +14,7 @@ "AllowedHosts": "*", "ConnectionStrings": { //"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB", - "DefaultConnection": "server=127.0.0.1;user=root;password=P@ssw0rd;port=3308;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" + "DefaultConnection": "server=192.168.1.9;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;" }, "Jwt": { "Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",