ต้นแบบการทำรายงาน
This commit is contained in:
parent
3332af583b
commit
3c11d1b5a1
6 changed files with 83 additions and 5 deletions
|
|
@ -22,6 +22,7 @@ namespace BMA.EHR.Application
|
||||||
services.AddTransient<OrganizationCommonRepository>();
|
services.AddTransient<OrganizationCommonRepository>();
|
||||||
services.AddTransient<InboxRepository>();
|
services.AddTransient<InboxRepository>();
|
||||||
services.AddTransient<NotificationRepository>();
|
services.AddTransient<NotificationRepository>();
|
||||||
|
services.AddTransient<RetirementRepository>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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<List<RetirementPeriod>> GetListRetirePeriodAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 1. query
|
||||||
|
var data = await _dbContext.Set<RetirementPeriod>()
|
||||||
|
.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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -40,10 +40,6 @@
|
||||||
<ProjectReference Include="..\BMA.EHR.Infrastructure\BMA.EHR.Infrastructure.csproj" />
|
<ProjectReference Include="..\BMA.EHR.Infrastructure\BMA.EHR.Infrastructure.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Controllers\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include=".github\workflows\build-local.yaml" />
|
<None Include=".github\workflows\build-local.yaml" />
|
||||||
<None Include=".github\workflows\release.yaml" />
|
<None Include=".github\workflows\release.yaml" />
|
||||||
|
|
|
||||||
18
BMA.EHR.Report.Service/Controllers/RetireReportController.cs
Normal file
18
BMA.EHR.Report.Service/Controllers/RetireReportController.cs
Normal file
|
|
@ -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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -14,7 +14,7 @@
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
|
//"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": {
|
"Jwt": {
|
||||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue