fix สิทธิ์เครื่องราช รายงาน
This commit is contained in:
parent
1496c1a438
commit
f1ab73fd39
2 changed files with 48 additions and 6 deletions
|
|
@ -3,9 +3,12 @@ using BMA.EHR.Domain.Common;
|
|||
using BMA.EHR.Domain.Extensions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Swashbuckle.AspNetCore.Annotations;
|
||||
using Telerik.Reporting;
|
||||
using Telerik.Reporting.Processing;
|
||||
using BMA.EHR.Application.Repositories;
|
||||
|
||||
namespace BMA.EHR.Report.Service.Controllers
|
||||
{
|
||||
|
|
@ -23,19 +26,20 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
private readonly IConfiguration _configuration;
|
||||
private readonly InsigniaReportRepository _repository;
|
||||
private readonly GenericReportGenerator _reportGenerator;
|
||||
|
||||
private readonly PermissionRepository _permission;
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Constuctor and Destructor "
|
||||
|
||||
public InsigniaReportController(IWebHostEnvironment hostingEnvironment, IConfiguration configuration, InsigniaReportRepository repository, GenericReportGenerator reportGenerator)
|
||||
public InsigniaReportController(IWebHostEnvironment hostingEnvironment, IConfiguration configuration, InsigniaReportRepository repository, GenericReportGenerator reportGenerator, PermissionRepository permission)
|
||||
{
|
||||
|
||||
_hostingEnvironment = hostingEnvironment;
|
||||
_configuration = configuration;
|
||||
_repository = repository;
|
||||
_reportGenerator = reportGenerator;
|
||||
_permission = permission;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -384,7 +388,12 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
{
|
||||
try
|
||||
{
|
||||
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_INSIGNIA_REPORT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var mimeType = "";
|
||||
switch (exportType.Trim().ToLower())
|
||||
{
|
||||
|
|
@ -421,6 +430,12 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
{
|
||||
try
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_INSIGNIA_REPORT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
var data = await _repository.GetSummaryCoinReport(id);
|
||||
var SummaryTotal = await _repository.GetSummaryTotalCoinReport(id);
|
||||
var YearInsignalPeriod = await _repository.GetYearInsigniaPeriod(id);
|
||||
|
|
@ -493,6 +508,13 @@ namespace BMA.EHR.Report.Service.Controllers
|
|||
{
|
||||
try
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_INSIGNIA_REPORT");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||
}
|
||||
|
||||
//Guid ids = Guid.Parse(id);
|
||||
var data = await _repository.GetCoinReport(id);
|
||||
var YearInsignalPeriod = await _repository.GetYearInsigniaPeriod(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue